Summary: T-Rex is a minimalistic regular expression library written in ANSI C Name: trex Version: 1.3 Release: 1 License: LGPLv2+ Group: System Environment/Libraries Source0: http://sourceforge.net/projects/tiny-rex/files/%{name}_1_3.tar.gz URL: http://sourceforge.net/projects/tiny-rex/ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root %description T-Rex is a minimalistic regular expression library written in ANSI C, supports the following POSIX expressions: ?,*,+,^,$,.,[a-b],() plus the perl style greedy closures {n}. It can be conditionally compiled to support 8-bits or 16-bits character strings. The library is available as 32-bit and 64-bit. %package devel Requires: %{name} = %{version}-%{release} Summary: Development files for use with the %{name} package Group: Development/Libraries %description devel This package contains header files and static libraries for use when building applications which use the T-Rex library. 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 %{name} %build # setup environment for 32-bit and 64-bit builds export AR="ar -X32_64" # first build the 64-bit version export CC="cc -qcpluscmt -q64" ${CC} -c %{name}.c -o %{name}.o ${AR} -rv lib%{name}.a %{name}.o CreateExportList -X64 %{name}.exp lib%{name}.a ${CC} -qmkshrobj lib%{name}.a -o shr.o -bE:%{name}.exp rm -f %{name}.o lib%{name}.a %{name}.exp # now build the 32-bit version export CC="cc -qcpluscmt -q32" ${CC} -c %{name}.c -o %{name}.o ${AR} -rv lib%{name}.a %{name}.o CreateExportList -X32 %{name}.exp lib%{name}.a ${CC} -qmkshrobj lib%{name}.a -o shr64.o -bE:%{name}.exp # now create the AIX-style shared library ${AR} -X32 -rv lib%{name}.a shr.o ${AR} -X64 -q lib%{name}.a shr64.o %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT}%{_libdir} cp lib%{name}.a ${RPM_BUILD_ROOT}%{_libdir}/ chmod 0644 ${RPM_BUILD_ROOT}%{_libdir}/* mkdir -p ${RPM_BUILD_ROOT}%{_includedir} cp TRexpp.h %{name}.h ${RPM_BUILD_ROOT}%{_includedir}/ chmod 0644 ${RPM_BUILD_ROOT}%{_includedir}/* ( cd ${RPM_BUILD_ROOT} for dir in include lib 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 history.txt readme.txt %{_libdir}/*.a /usr/lib/*.a %files devel %defattr(-,root,system,-) %{_includedir}/* /usr/include/* %changelog * Mon Nov 08 2010 Michael Perzl - 1.3-1 - first version for AIX V5.1 and higher