%define _libdir64 %{_prefix}/lib64 Summary: POSIX regexp functions Name: librx Version: 1.5 Release: 1 License: GPLv2+ URL: http://www.gnu.org/software/rx/rx.html Group: Applications/Text # Originally downloaded from ftp://ftp.gnu.org/gnu/rx/rx-1.5.tar.bz2 # The FSF no longer offers this code. Source0: rx-%{version}.tar.bz2 Patch0: rx-%{version}-shared.patch Patch1: rx-%{version}-texinfo.patch Patch2: rx-%{version}-libtoolmode.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: patch, texinfo, libtool %description Rx is, among other things, an implementation of the interface specified by POSIX for programming with regular expressions. Some other implementations are GNU regex.c and Henry Spencer's regex library. The library is available as 32-bit and 64-bit. %package devel Summary: POSIX regexp functions, developers library Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel Rx is, among other things, an implementation of the interface specified by POSIX for programming with regular expressions. Some other implementations are GNU regex.c and Henry Spencer's regex library. This package contains files needed for development with librx. 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 -n rx-%{version} export PATH=/opt/freeware/bin:$PATH %patch0 -p1 %patch1 -p1 -b .texipatch %patch2 -p1 -b .libtoolmode autoreconf -fiv cd rx autoreconf -fiv cd .. mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build cd 64bit # first build the 64-bit version export OBJECT_MODE=64 export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --enable-shared --disable-static make %{?_smp_mflags} cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --enable-shared --disable-static make %{?_smp_mflags} make doc/rx.info %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT}%{_libdir} mkdir -p ${RPM_BUILD_ROOT}%{_libdir64} mkdir -p ${RPM_BUILD_ROOT}%{_includedir} mkdir -p ${RPM_BUILD_ROOT}%{_infodir} cd 64bit export OBJECT_MODE=64 make DESTDIR=${RPM_BUILD_ROOT} install mv ${RPM_BUILD_ROOT}%{_libdir}/* ${RPM_BUILD_ROOT}%{_libdir64}/ cd ../32bit export OBJECT_MODE=32 make DESTDIR=${RPM_BUILD_ROOT} install gzip --best doc/rx.info cp doc/rx.info.gz ${RPM_BUILD_ROOT}%{_infodir} chmod 0644 ${RPM_BUILD_ROOT}%{_infodir}/* chmod -x ${RPM_BUILD_ROOT}%{_includedir}/rxposix.h # create proper AIX-style shared libraries rm -f ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a /usr/bin/ar -X32 -rv ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a ${RPM_BUILD_ROOT}%{_libdir}/%{name}.so.0.0.0 /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a ${RPM_BUILD_ROOT}%{_libdir64}/%{name}.so.0.0.0 ( cd ${RPM_BUILD_ROOT} for dir in include lib lib64 do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %post devel /sbin/install-info %{_infodir}/rx.info.gz %{_infodir}/dir 2>/dev/null || : %postun devel if [ "$1" = 0 ]; then /sbin/install-info --delete %{_infodir}/rx.info.gz %{_infodir}/dir 2>/dev/null || : fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %doc 32bit/ANNOUNCE 32bit/BUILDING 32bit/COOKOFF 32bit/rx/ChangeLog %{_includedir}/* %{_libdir}/*.la %{_libdir64}/*.la /usr/include/* /usr/lib/*.la /usr/lib64/*.la %changelog * Mon Jul 09 2012 Michael Perzl - 1.5-1 - first version for AIX V5.1 and higher