boost/ocaml/python - all NON-WORKING at the moment.
[fedora-mingw.git] / boost / mingw32-boost.spec
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 Name:           mingw32-boost
8 Version:        1.34.1
9 Release:        1%{?dist}
10 Summary:        MinGW Windows port of Boost C++ Libraries
11
12 License:        Boost
13 Group:          Development/Libraries
14 URL:            http://www.boost.org/
15 Source0:        http://downloads.sourceforge.net/boost/boost_1_34_1.tar.bz2
16 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
17
18 Patch0:         boost-configure.patch
19 Patch1:         boost-gcc-soname.patch
20 #Patch2:         boost-use-rpm-optflags.patch
21 Patch3:         boost-run-tests.patch
22 Patch4:         boost-regex.patch
23 Patch5:         boost-gcc43.patch
24
25 BuildArch:      noarch
26
27 BuildRequires:  mingw32-filesystem >= 30
28 BuildRequires:  mingw32-gcc
29 BuildRequires:  mingw32-binutils
30 #BuildRequires:  mingw-libstdc++
31 BuildRequires:  mingw32-bzip2
32 BuildRequires:  mingw32-zlib
33 # These are required by the native package:
34 #BuildRequires:  mingw32-python
35 #BuildRequires:  mingw32-libicu
36
37
38 %description
39 Boost provides free peer-reviewed portable C++ source libraries.  The
40 emphasis is on libraries which work well with the C++ Standard
41 Library, in the hopes of establishing "existing practice" for
42 extensions and providing reference implementations so that the Boost
43 libraries are suitable for eventual standardization. (Some of the
44 libraries have already been proposed for inclusion in the C++
45 Standards Committee's upcoming C++ Standard Library Technical Report.)
46
47
48 %prep
49 %setup -q -n boost_1_34_1
50 %patch0 -p0
51 %patch1 -p0
52 #%patch2 -p0
53 %patch3 -p0
54 %patch4 -p0
55 %patch5 -p1
56
57
58 %build
59 BOOST_ROOT=`pwd`
60 staged_dir=stage
61 export BOOST_ROOT
62
63 # build make tools, ie bjam, necessary for building libs, docs, and testing
64 (cd tools/jam/src && ./build.sh)
65 BJAM=`find tools/jam/src/ -name bjam -a -type f`
66
67 #BUILD_FLAGS="--with-toolset=gcc --prefix=$RPM_BUILD_ROOT%{_prefix}"
68 BUILD_FLAGS="--with-toolset=gcc --with-bjam=$BJAM"
69 #PYTHON_VERSION=$(python -c 'import sys; print sys.version[:3]')
70 #PYTHON_FLAGS="--with-python-root=/usr --with-python-version=$PYTHON_VERSION"
71 PYTHON_FLAGS="--without-libraries=python"
72 #REGEX_FLAGS="--with-icu"
73 REGEX_FLAGS="--without-icu"
74
75 ./configure $BUILD_FLAGS $PYTHON_FLAGS $REGEX_FLAGS
76
77 # Make it use the cross-compiler instead of gcc.
78 rm user-config.jam
79 echo "using gcc : : %{_mingw32_cc} : ;" > user-config.jam
80
81 make all
82
83
84 %install
85 rm -rf $RPM_BUILD_ROOT
86 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
87 mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}
88
89 # install lib
90 for i in `find stage -type f -name \*.a`; do
91   NAME=`basename $i`;
92   install -p -m 0644 $i $RPM_BUILD_ROOT%{_mingw32_libdir}/$NAME;
93 done;
94 for i in `find stage -type f -name \*.so`; do
95   NAME=$i;
96   SONAME=$i.3;
97   VNAME=$i.%{version};
98   base=`basename $i`;
99   NAMEbase=$base;
100   SONAMEbase=$base.3;
101   VNAMEbase=$base.%{version};
102   mv $i $VNAME;
103   ln -s $VNAMEbase $SONAME;
104   ln -s $VNAMEbase $NAME;
105   install -p -m 755 $VNAME $RPM_BUILD_ROOT%{_libdir}/$VNAMEbase;
106   mv $SONAME $RPM_BUILD_ROOT%{_libdir}/$SONAMEbase;
107   mv $NAME $RPM_BUILD_ROOT%{_libdir}/$NAMEbase;
108 done;
109
110 # install include files
111 find %{name} -type d | while read a; do
112   mkdir -p $RPM_BUILD_ROOT%{_includedir}/$a
113   find $a -mindepth 1 -maxdepth 1 -type f \
114     | xargs -r install -m 644 -p -t $RPM_BUILD_ROOT%{_includedir}/$a
115 done
116
117 # remove scripts used to generate include files
118 find $RPM_BUILD_ROOT%{_includedir}/ \( -name '*.pl' -o -name '*.sh' \) -exec rm {} \;
119
120
121 %clean
122 rm -rf $RPM_BUILD_ROOT
123
124
125 %files
126 %defattr(-,root,root)
127 %{_mingw32_bindir}/foo.dll
128 %{_mingw32_libdir}/foo.dll.a
129 # etc.
130
131
132 %changelog
133 * Wed Sep 24 2008 Your Name <you@example.com> - 1.2.3-1
134 - Initial RPM release.