%define apr_version 1.5.2-2 %define apr_util_version 1.5.4-3 %define krb5_version 1.14-1 %define openssl_version 1.0.2j-2 %define scons_version 2.5.1-1 %define zlib_version 1.2.11-1 Summary: High-Performance Asynchronous HTTP Client Library Name: serf Version: 1.3.9 Release: 2 License: Apache License 2.0 Group: Applications/Databases URL: http://serf.apache.org/ Source0: https://archive.apache.org/dist/serf/%{name}-%{version}.tar.bz2 Source1: %{name}-%{version}-1-aix.patch Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: scons >= 2.3.0-1 #BuildRequires: apr-devel >= %{apr_version} #BuildRequires: apr-util-devel >= %{apr_util_version} #BuildRequires: krb5-devel >= %{krb5_version} #BuildRequires: openssl-devel >= %{openssl_version} BuildRequires: zlib-devel >= %{zlib_version} #Requires: apr >= %{apr_version} #Requires: apr-util >= %{apr_util_version} #Requires: krb5 >= %{krb5_version} #Requires: openssl >= %{openssl_version} Requires: zlib >= %{zlib_version} %define _libdir64 %{_prefix}/lib64 %description The serf library is a C-based HTTP client library built upon the Apache Portable Runtime (APR) library. It multiplexes connections, running the read/write communication asynchronously. Memory copies and transformations are kept to a minimum to provide high performance operation. %package devel Summary: Header files and libraries for developing apps which use serf. Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkg-config #Requires: apr-devel >= %{apr_version} #Requires: apr-util-devel >= %{apr_util_version} %description devel The serf-devel package contains the header files and libraries needed to develop programs that use the serf HTTP client library. %prep %setup -q %patch0 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CC="xlc_r" export PATH="%{_prefix}/bin:$PATH" #function to build a shared library build_shared_library() { f=$2 CreateExportList -X${1} ${f}.exp ${f}.a ${CC} -q${1} -qmkshrobj ${f}.a -o ${f}.so.0.0.0 -Wl,-bE:${f}.exp -Wl,-bernotok $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} rm -f ${f}.exp ${f}.a /usr/bin/ar -X${1} -rv ${f}.a ${f}.so.0.0.0 } cd 64bit # first build the 64-bit version export OBJECT_MODE=64 scons \ AR="/usr/bin/ar -X64" \ CC="/usr/vac/bin/xlc_r -q64 -O2 -qstrict -I/opt/freeware/64/include" \ PREFIX=%{_prefix} \ LIBDIR=%{_libdir64} \ APR=%{_prefix}/bin/apr-1-config_64 \ APU=%{_prefix}/bin/apu-1-config_64 \ %{?_smp_mflags} build_shared_library 64 libserf-1 -L/opt/freeware/lib64 -L/opt/freeware/lib -lssl -lcrypto -Wl,-brtl -lapr-1 -laprutil-1 -liconv -lz (scons -i check || true) cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 scons_32 \ AR="/usr/bin/ar -X32" \ CC="/usr/vac/bin/xlc_r -q32 -O2 -D_LARGE_FILES -qstrict -I/opt/freeware/include" \ PREFIX=%{_prefix} \ LIBDIR=%{_libdir} \ APR=%{_prefix}/bin/apr-1-config \ APU=%{_prefix}/bin/apu-1-config \ %{?_smp_mflags} build_shared_library 32 libserf-1 -L/opt/freeware/lib -lssl -lcrypto -Wl,-brtl -lapr-1 -laprutil-1 -liconv -lz (scons_32 -i check || true) %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit export OBJECT_MODE=64 scons install --install-sandbox=${RPM_BUILD_ROOT} cd ../32bit export OBJECT_MODE=32 scons_32 install --install-sandbox=${RPM_BUILD_ROOT} ( cd ${RPM_BUILD_ROOT}%{_libdir64} for f in *.a ; do /usr/bin/ar -X64 -x ${f} done ln -s libserf-1.so.0.0.0 libserf-1.so.0 ln -s libserf-1.so.0.0.0 libserf-1.so cd ${RPM_BUILD_ROOT}%{_libdir} for f in *.a ; do /usr/bin/ar -X32 -x ${f} done ln -s libserf-1.so.0.0.0 libserf-1.so.0 ln -s libserf-1.so.0.0.0 libserf-1.so ) # add the missing 64-bit shared object to the AIX-style shared library /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/libserf-1.a ${RPM_BUILD_ROOT}%{_libdir64}/libserf-1.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 ) %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,root) %doc 32bit/CHANGES 32bit/LICENSE 32bit/NOTICE 32bit/README %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,root) %doc 32bit/design-guide.txt %{_includedir}/* %{_libdir}/pkgconfig/* %{_libdir64}/pkgconfig/* /usr/include/* %changelog * Wed Jan 11 2017 Michael Perzl - 1.3.9-1 - update to version 1.3.9 * Wed Nov 16 2016 Michael Perzl - 1.2.1-3 - recompiled against latest versions * Fri Mar 04 2016 Michael Perzl - 1.2.1-2 - recompiled against latest versions * Wed Jun 19 2013 Michael Perzl - 1.2.1-1 - update to version 1.2.1 * Fri May 03 2013 Michael Perzl - 1.2.0-1 - update to version 1.2.0 * Tue Jan 08 2013 Michael Perzl - 1.1.1-1 - update to version 1.1.1 * Mon Jun 18 2012 Michael Perzl - 1.1.0-1 - update to version 1.1.0 * Mon Jun 18 2012 Michael Perzl - 1.0.3-1 - update to version 1.0.3 * Thu Sep 22 2011 Michael Perzl - 1.0.0-1 - update to version 1.0.0 * Thu Sep 22 2011 Michael Perzl - 0.7.2-1 - update to version 0.7.2 * Thu Dec 03 2010 Michael Perzl - 0.7.0-1 - update to version 0.7.0, added 64-bit library * Tue Dec 18 2007 Michael Perzl - 0.1.2-1 - first version for AIX5L v5.1 and higher