Name: oniguruma Version: 5.9.3 Release: 1 Summary: Regular expressions library Group: System Environment/Libraries License: BSD URL: http://www.geocities.jp/kosako3/oniguruma/ Source0: http://www.geocities.jp/kosako3/oniguruma/archive/onig-%{version}.tar.gz # FIXME # Don't know exactly why, however without Patch0 onig_new returns # NULL reg variable Patch0: oniguruma-5.9.2-onig_new-returns-NULL-reg.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: patch %define _libdir64 %{_prefix}/lib64 %description Oniguruma is a regular expressions library. The characteristics of this library is that different character encoding for every regular expression object can be specified. (supported APIs: GNU regex, POSIX and Oniguruma native) The library is available as 32-bit and 64-bit. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. 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 "xlc -q64" or "gcc -maix64". %prep %setup -q -n onig-%{version} export PATH=/opt/freeware/bin:$PATH %patch0 -p1 -b .nullreg mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cp -r 32bit/* 64bit/ %build cd 64bit # first build the 64-bit version export OBJECT_MODE=64 export CC="xlc -q64" ./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 CC="xlc" ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --enable-shared --disable-static make %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit export OBJECT_MODE=64 gmake DESTDIR=${RPM_BUILD_ROOT} install ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in * ; do mv -f ${f} ${f}_64 done ) cd ../32bit export OBJECT_MODE=32 gmake DESTDIR=${RPM_BUILD_ROOT} install ( cd ${RPM_BUILD_ROOT}%{_libdir64} for f in *.a ; do /usr/bin/ar -X64 -x ${f} done cd ${RPM_BUILD_ROOT}%{_libdir} for f in *.a ; do /usr/bin/ar -X32 -x ${f} done ) # add the 64-bit shared objects to the shared libraries containing already the # 32-bit shared objects /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/libonig.a ${RPM_BUILD_ROOT}%{_libdir64}/libonig.so* ( 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 32bit/AUTHORS 32bit/COPYING 32bit/HISTORY 32bit/README 32bit/index.html %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %doc 32bit/doc/API 32bit/doc/FAQ 32bit/doc/RE %{_bindir}/* %{_includedir}/* %{_libdir}/*.la %{_libdir64}/*.la /usr/bin/* /usr/include/* /usr/lib/*.la /usr/lib64/*.la %changelog * Tue Jan 08 2013 Michael Perzl - 5.9.3-1 - updated to version 5.9.3 * Thu Nov 25 2010 Michael Perzl - 5.9.2-1 - first version for AIX V5.1 and higher