%define _libdir64 %{_prefix}/lib64 Name: json-c Version: 0.13 Release: 1 Summary: A JSON implementation in C Group: Development/Libraries License: MIT URL: https://github.com/json-c/json-c/wiki Source0: https://s3.amazonaws.com/json-c_releases/releases/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Patch0: %{name}-%{version}-aix.patch BuildRequires: patch make %description JSON-C implements a reference counting object model that allows you to easily construct JSON objects in C, output them as JSON formatted strings and parse JSON formatted strings back into the C representation of JSON objects. %package devel Summary: Development headers and library for json-c Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkg-config %description devel This package contains the development headers and library for json-c. %package doc Summary: Reference manual for json-c Group: Documentation %description doc This package contains the reference manual for json-c. %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 cd 64bit # first build the 64-bit version export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export OBJECT_MODE=64 ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --enable-shared --disable-static gmake %{?_smp_mflags} cd ../32bit # now build the 32-bit version export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export OBJECT_MODE=32 ./configure \ --prefix=%{_prefix} \ --enable-shared --disable-static gmake %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit export OBJECT_MODE=64 gmake install DESTDIR=${RPM_BUILD_ROOT} cd ../32bit export OBJECT_MODE=32 gmake install DESTDIR=${RPM_BUILD_ROOT} ( 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}/lib%{name}.a ${RPM_BUILD_ROOT}%{_libdir64}/lib%{name}.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/AUTHORS 32bit/ChangeLog 32bit/COPYING 32bit/NEWS %doc 32bit/README 32bit/README.html %{_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 %{_libdir}/pkgconfig/*.pc %{_libdir64}/pkgconfig/*.pc /usr/include/* /usr/lib/*.la /usr/lib64/*.la %files doc %defattr(-,root,system,-) %doc 32bit/doc/html/* %changelog * Fri Dec 15 2017 Michael Perzl - 0.13-1 - updated to version 0.13 * Fri Dec 15 2017 Michael Perzl - 0.12.1-1 - updated to version 0.12.1 * Wed May 28 2014 Michael Perzl - 0.12-1 - updated to version 0.12 * Thu Oct 04 2012 Michael Perzl - 0.10-1 - updated to version 0.10 * Sun Jan 29 2011 Michael Perzl - 0.9-1 - first version for AIX V5.1 and higher