%define aprver 0 Summary: Apache Portable Runtime library Name: apr Version: 0.9.17 Release: 1 License: Apache Software License Group: System Environment/Libraries URL: http://apr.apache.org/ Source0: http://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2 Source1: http://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2.asc Source2: http://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2.md5 Source3: %{name}.h BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %define _libdir64 %{_prefix}/lib64 %description The mission of the Apache Portable Runtime (APR) is to provide a free library of C data structures and routines, forming a system portability layer to as many operating systems as possible, including Unices, MS Win32, BeOS and OS/2. The library is available as 32-bit and 64-bit. %package devel Group: Development/Libraries Summary: APR library development kit Requires: %{name} = %{version}-%{release} %description devel This package provides the support files which can be used to build applications using the APR library. The mission of the Apache Portable Runtime (APR) is to provide a free library of C data structures and routines. If you are compiling a 32-bit program, no special compiler options are needed. If you are compiling a 64-bit program, you have to compile and link your application with "cc -q64" or "gcc -maix64". %prep %setup -q mkdir -p ../64bit cp -r * ../64bit/ mv ../64bit . %build # setup environment for 32-bit and 64-bit builds export AR="ar -X32_64" export NM="nm -X32_64" cd 64bit # first build the 64-bit version export CC="cc -q64" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --enable-static --enable-shared \ --with-installbuilddir=%{_libdir64}/%{name}-%{aprver}/build make %{?_smp_mflags} cd .. # now build the 32-bit version export CC="cc" ./configure \ --prefix=%{_prefix} \ --enable-static --enable-shared \ --with-installbuilddir=%{_libdir}/%{name}-%{aprver}/build make %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit make DESTDIR=${RPM_BUILD_ROOT} install mv ${RPM_BUILD_ROOT}%{_includedir}/%{name}-%{aprver}/%{name}.h ${RPM_BUILD_ROOT}%{_includedir}/%{name}-%{aprver}/%{name}-ppc64.h cd .. make DESTDIR=${RPM_BUILD_ROOT} install mv ${RPM_BUILD_ROOT}%{_includedir}/%{name}-%{aprver}/%{name}.h ${RPM_BUILD_ROOT}%{_includedir}/%{name}-%{aprver}/%{name}-ppc32.h cp %{SOURCE3} ${RPM_BUILD_ROOT}%{_includedir}/%{name}-%{aprver}/%{name}.h ( cd ${RPM_BUILD_ROOT} for dir in bin include lib lib64 do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc CHANGES LICENSE NOTICE %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %doc docs/APRDesign.html docs/canonical_filenames.html %doc docs/incomplete_types docs/non_apr_programs %{_bindir}/* %{_includedir}/* %{_libdir}/*.a %{_libdir64}/*.a %{_libdir}/%{name}.exp %{_libdir64}/%{name}.exp %{_libdir}/%{name}-%{aprver} %{_libdir64}/%{name}-%{aprver} /usr/bin/* /usr/include/* /usr/lib/*.a /usr/lib64/*.a %changelog * Tue Apr 21 2009 Michael Perzl - 0.9.17-1 - first version for AIX V5.1 and higher