%define dotests 1 Name: libconfuse Version: 3.2.2 Release: 2 Summary: A configuration file parser library Group: System Environment/Libraries License: LGPL URL: https://github.com/martinh/libconfuse/releases Source0: https://github.com/martinh/libconfuse/releases/download/v%{version}/confuse-%{version}.tar.gz Source1: https://github.com/martinh/libconfuse/releases/download/v%{version}/confuse-%{version}.tar.gz.md5 Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %define _libdir64 %{_libdir}64 BuildRequires: pkg-config, flex, patch BuildRequires: libgcc >= 6.3.0-1 Requires: libgcc >= 6.3.0-1 %description libConfuse is a configuration file parser library, licensed under the terms of the LGPL, and written in C. It supports sections and (lists of) values (strings, integers, floats, booleans or other sections), as well as some other features (such as single/double-quoted strings, environment variable expansion, functions and nested include statements). It makes it very easy to add configuration file capability to a program using a simple API. The goal of libConfuse is not to be the configuration file parser library with a gazillion of features. Instead, it aims to be easy to use and quick to integrate with your code. The library is available as 32-bit and 64-bit. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkg-config %description devel Development files 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 "xlc_r -q64" or "gcc -maix64". %prep export PATH=/opt/freeware/bin:$PATH %setup -q -n confuse-%{version} %patch0 rm -rf /tmp/%{name}-%{version}-32bit cp -pr . /tmp/%{name}-%{version}-32bit rm -fr * mv /tmp/%{name}-%{version}-32bit 32bit cp -pr 32bit 64bit %build # setup environment for 32-bit and 64-bit builds export AR="ar -X32_64" export NM="nm -X32_64" # first build the 64-bit version cd 64bit export OBJECT_MODE=64 export CC="/opt/freeware/bin/gcc -maix64 -O2" export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --enable-shared --disable-static \ --disable-nls make %{?_smp_mflags} if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi # now build the 32-bit version cd ../32bit export OBJECT_MODE=32 export CC="/opt/freeware/bin/gcc -maix32 -O2 -D_LARGE_FILES" export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --enable-shared --disable-static \ --disable-nls make %{?_smp_mflags} # add the 64-bit shared objects to the shared library containing already the # 32-bit shared objects ${AR} -X64 -q src/.libs/libconfuse.a ../64bit/src/.libs/libconfuse.so.2 if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} # install on 64bit mode cd 64bit export OBJECT_MODE=64 make install DESTDIR=${RPM_BUILD_ROOT} # install on 32bit mode cd ../32bit export OBJECT_MODE=32 make install DESTDIR=${RPM_BUILD_ROOT} # Add the older (v2.8 and lower) version shared members for compatibility with older apps # (make sure they're set for LOADONLY with 'strip -e') # Install man pages mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man3/ cp -p doc/man/man3/*.3 ${RPM_BUILD_ROOT}%{_mandir}/man3/ chmod 644 ${RPM_BUILD_ROOT}%{_mandir}/man3/* %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/AUTHORS 32bit/LICENSE 32bit/README.md %doc 32bit/doc/html %{_libdir64}/*.a %{_libdir}/*.a %{_mandir}/man?/*.* %files devel %defattr(-,root,system,-) %doc 32bit/examples/ftpconf.c 32bit/examples/ftp.conf %doc 32bit/examples/simple.c 32bit/examples/simple.conf %doc 32bit/examples/reread.c 32bit/examples/reread.conf %{_includedir}/* %{_libdir}/pkgconfig/libconfuse.pc %{_libdir64}/pkgconfig/libconfuse.pc %changelog * Thu May 02 2019 Reshma V Kumar - 3.2.2-2 - Rebuild to add 64bit libconfuse.so.2 to libconfuse.a * Wed Nov 7 2018 Reshma V Kumar - 3.2.2-1 - Initial port for AIX toolbox * Mon Sep 19 2016 Michael Perzl - 3.0-1 - updated to version 3.0 * Mon Sep 19 2016 Michael Perzl - 2.8-1 - updated to version 2.8 * Mon Apr 19 2010 Michael Perzl - 2.7-1 - updated to version 2.7 * Mon Apr 19 2010 Michael Perzl - 2.6-2 - removed dependency on GNU gettext to keep the package slim * Mon Jan 14 2008 Michael Perzl - 2.6-1 - updated to version 2.6 * Mon Jan 07 2008 Michael Perzl - 2.5-2 - included both 32-bit and 64-bit shared objects * Tue Dec 18 2007 Michael Perzl 2.5-1 - First version for AIX5L v5.1 and higher