smock: use $basearch in smock.mock.extra
[fedora-mingw.git] / boost / mingw32-boost.spec-1.37.0beta1
1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
6
7 %define boost_version 1_37_0_beta1
8
9 Name:           mingw32-boost
10 Version:        1.37.0_beta1
11 Release:        1%{?dist}
12 Summary:        MinGW Windows port of Boost C++ Libraries
13
14 License:        Boost
15 Group:          Development/Libraries
16 URL:            http://www.boost.org/
17 Source0:        http://downloads.sourceforge.net/boost/boost_%{boost_version}.tar.bz2
18 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
19
20 # On the advice of #boost, we're using 1.37.0 beta1 which is
21 # quite different from the native Fedora package.
22 #Patch0:         boost-configure.patch
23 #Patch1:         boost-gcc-soname.patch
24 #Patch2:         boost-use-rpm-optflags.patch
25 #Patch3:         boost-run-tests.patch
26 #Patch4:         boost-regex.patch
27 #Patch5:         boost-gcc43.patch
28
29 BuildArch:      noarch
30
31 BuildRequires:  mingw32-filesystem >= 30
32 BuildRequires:  mingw32-gcc
33 BuildRequires:  mingw32-gcc-c++
34 BuildRequires:  mingw32-binutils
35 BuildRequires:  mingw32-bzip2
36 BuildRequires:  mingw32-zlib
37 # These are required by the native package:
38 #BuildRequires:  mingw32-python
39 #BuildRequires:  mingw32-libicu
40
41
42 %description
43 Boost provides free peer-reviewed portable C++ source libraries.  The
44 emphasis is on libraries which work well with the C++ Standard
45 Library, in the hopes of establishing "existing practice" for
46 extensions and providing reference implementations so that the Boost
47 libraries are suitable for eventual standardization. (Some of the
48 libraries have already been proposed for inclusion in the C++
49 Standards Committee's upcoming C++ Standard Library Technical Report.)
50
51
52 %prep
53 %setup -q -n boost_%{boost_version}
54 #%patch0 -p0
55 #%patch1 -p0
56 #%patch2 -p0
57 #%patch3 -p0
58 #%patch4 -p0
59 #%patch5 -p1
60
61
62 %build
63 BOOST_ROOT=`pwd`
64 staged_dir=stage
65 export BOOST_ROOT
66
67 # build make tools, ie bjam, necessary for building libs, docs, and testing
68 (cd tools/jam/src && ./build.sh)
69 BJAM=`find tools/jam/src/ -name bjam -a -type f`
70
71 # Make it use the cross-compiler instead of gcc.
72 echo "using gcc : : %{_mingw32_cc} : ;" > user-config.jam
73
74 $BJAM \
75   --user-config=user-config.jam \
76   --toolset=gcc-4.3.2-mingw \
77   --with-program_options \
78   link=static,shared \
79   runtime-link=static,shared \
80   --target-os=windows \
81   --prefix=%{_mingw32_prefix} \
82   --threadapi=win32 \
83   release
84
85 exit 1
86
87
88 %install
89 rm -rf $RPM_BUILD_ROOT
90 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
91 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
92 mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}
93
94 # Boost doesn't build shared libraries for some reason.  However it
95 # builds *.a files which we can trivially convert to *.dll (they
96 # contain objects which are already compiled for PIC).
97 function a2dll
98 {
99   rm -rf .a2dll
100   mkdir .a2dll
101   pushd .a2dll
102   ar x ../$1
103   error=0
104   i686-pc-mingw32-gcc -shared \
105     -o ../$2.dll \
106     -Wl,--out-implib,../$2.dll.a \
107     *.o -lbz2 -lz -lstdc++ || error=1
108   popd
109   rm -rf .a2dll
110   return $error
111 }
112
113 for f in `find bin.v2 -name '*.a'`; do
114   b=`basename $f .a`
115   d=`dirname $f`
116   if a2dll $f $d/$b; then
117     install $d/$b.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
118     install $d/$b.dll.a $RPM_BUILD_ROOT%{_mingw32_libdir}
119   else
120     echo '*** FAILED TO BUILD' $d/$b.dll
121   fi
122 done
123
124 # install include files
125 find boost -type d | while read a; do
126   mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}/$a
127   find $a -mindepth 1 -maxdepth 1 -type f \
128     | xargs -r install -m 644 -p -t $RPM_BUILD_ROOT%{_mingw32_includedir}/$a
129 done
130
131 # remove scripts used to generate include files
132 find $RPM_BUILD_ROOT%{_mingw32_includedir}/ \( -name '*.pl' -o -name '*.sh' \) -exec rm {} \;
133
134
135 %clean
136 rm -rf $RPM_BUILD_ROOT
137
138
139 %files
140 %defattr(-,root,root)
141 %{_mingw32_includedir}/boost
142 %{_mingw32_bindir}/libboost_date_time.dll
143 %{_mingw32_libdir}/libboost_date_time.dll.a
144 %{_mingw32_bindir}/libboost_date_time-mt.dll
145 %{_mingw32_libdir}/libboost_date_time-mt.dll.a
146 %{_mingw32_bindir}/libboost_filesystem.dll
147 %{_mingw32_libdir}/libboost_filesystem.dll.a
148 %{_mingw32_bindir}/libboost_filesystem-mt.dll
149 %{_mingw32_libdir}/libboost_filesystem-mt.dll.a
150 %{_mingw32_bindir}/libboost_graph.dll
151 %{_mingw32_libdir}/libboost_graph.dll.a
152 %{_mingw32_bindir}/libboost_graph-mt.dll
153 %{_mingw32_libdir}/libboost_graph-mt.dll.a
154 %{_mingw32_bindir}/libboost_iostreams.dll
155 %{_mingw32_libdir}/libboost_iostreams.dll.a
156 %{_mingw32_bindir}/libboost_iostreams-mt.dll
157 %{_mingw32_libdir}/libboost_iostreams-mt.dll.a
158 %{_mingw32_bindir}/libboost_program_options.dll
159 %{_mingw32_libdir}/libboost_program_options.dll.a
160 %{_mingw32_bindir}/libboost_program_options-mt.dll
161 %{_mingw32_libdir}/libboost_program_options-mt.dll.a
162 %{_mingw32_bindir}/libboost_regex.dll
163 %{_mingw32_libdir}/libboost_regex.dll.a
164 %{_mingw32_bindir}/libboost_regex-mt.dll
165 %{_mingw32_libdir}/libboost_regex-mt.dll.a
166 %{_mingw32_bindir}/libboost_serialization.dll
167 %{_mingw32_libdir}/libboost_serialization.dll.a
168 %{_mingw32_bindir}/libboost_serialization-mt.dll
169 %{_mingw32_libdir}/libboost_serialization-mt.dll.a
170 %{_mingw32_bindir}/libboost_signals.dll
171 %{_mingw32_libdir}/libboost_signals.dll.a
172 %{_mingw32_bindir}/libboost_signals-mt.dll
173 %{_mingw32_libdir}/libboost_signals-mt.dll.a
174 %{_mingw32_bindir}/libboost_wave.dll
175 %{_mingw32_libdir}/libboost_wave.dll.a
176 %{_mingw32_bindir}/libboost_wave-mt.dll
177 %{_mingw32_libdir}/libboost_wave-mt.dll.a
178 # These fail to build: they depend on linking with other parts of boost.
179 #libboost_prg_exec_monitor.dll
180 #libboost_test_exec_monitor.dll
181 #libboost_unit_test_framework.dll
182 #libboost_unit_test_framework-mt.dll
183 #libboost_test_exec_monitor-mt.dll
184 #libboost_prg_exec_monitor-mt.dll
185 #libboost_wserialization.dll
186 #libboost_wserialization-mt.dll
187 #libboost_thread-mt.dll
188
189
190 %changelog
191 * Sat Oct 24 2008 Richard W.M. Jones <rjones@redhat.com> - 1.34.1-2
192 - Initial RPM release.