Summary: A CGI (Common Gateway Interface) library Name: cgilib Version: 0.7 Release: 1 License: GPL Group: System/Libraries URL: http://www.infodrom.org/projects/cgilib/ Source0: %{name}-%{version}.tar.gz Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: make %define _libdir64 %{_prefix}/lib64 %description This is quite a simple library that provides an easy CGI interface (Common Gateway Interface). It provides an easy to use interface to CGI if you need to write your program in C instead of perl. The library is available as 32-bit and 64-bit. %package devel Summary: Development library and header files for the %{libname} library Group: Development/C Requires: %{name} = %{version} %description devel Header files and develpment documentation for %{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 "cc_r -q64" or "gcc -maix64". %prep %setup -q %patch0 touch NEWS autoreconf -fiv mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CC="cc_r" # first build the 64-bit version cd 64bit 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} \ --mandir=%{_mandir} \ --enable-shared --disable-static make %{?_smp_mflags} # now build the 32-bit version cd ../32bit export OBJECT_MODE=32 export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --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 ../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 ) # 32-bit shared objects /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/libcgi.a ${RPM_BUILD_ROOT}%{_libdir64}/libcgi.so* ( cd ${RPM_BUILD_ROOT} for dir in 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/ChangeLog 32bit/COPYING 32bit/README %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system) %{_includedir}/* %{_libdir}/*.la %{_libdir64}/*.la %{_mandir}/man?/* /usr/include/* /usr/lib/*.la /usr/lib64/*.la %changelog * Fri Sep 19 2014 Michael Perzl - 0.7-1 - updated to version 0.7 - provided RTL-style shared members * Tue Jul 01 2008 Michael Perzl - 0.6-1 - first version for AIX V5.1 and higher