Name: libconfuse Version: 3.0 Release: 1 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 Source2: %{name}.so.0-aix32 Source3: %{name}.so.0-aix64 Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: pkg-config, flex, patch %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 %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 export CC="xlc_r -q64" ./configure \ --prefix=%{_prefix} \ --enable-shared --enable-static \ --disable-nls make %{?_smp_mflags} cp src/.libs/libconfuse.so.1 . make clean # now build the 32-bit version export CC=xlc_r ./configure \ --prefix=%{_prefix} \ --enable-shared --enable-static \ --disable-nls make %{?_smp_mflags} # add the 64-bit shared objects to the shared library containing already the # 32-bit shared objects ${AR} -q src/.libs/libconfuse.a ./libconfuse.so.1 %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} 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') cp %{SOURCE2} libconfuse.so.0 /usr/bin/strip -X32 -e libconfuse.so.0 /usr/bin/ar -X32 -q ${RPM_BUILD_ROOT}%{_libdir}/libconfuse.a libconfuse.so.0 cp %{SOURCE3} libconfuse.so.0 /usr/bin/strip -X64 -e libconfuse.so.0 /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/libconfuse.a libconfuse.so.0 # 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/* ( cd ${RPM_BUILD_ROOT} for dir in include lib 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 AUTHORS LICENSE README.md %doc doc/html %{_libdir}/*.a %{_mandir}/man?/*.* /usr/lib/*.a %files devel %defattr(-,root,system,-) %doc examples/ftpconf.c examples/ftp.conf %doc examples/simple.c examples/simple.conf %doc examples/reread.c examples/reread.conf %{_includedir}/* %{_libdir}/*.la %{_libdir}/pkgconfig/libconfuse.pc /usr/include/* /usr/lib/*.la %changelog * 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