%define _libdir64 %{_prefix}/lib64 Name: augeas Version: 1.4.0 Release: 1 Summary: A library for changing configuration files Group: System Environment/Libraries License: LGPLv2+ URL: http://augeas.net/ Source0: http://augeas.net/download/%{name}-%{version}.tar.gz Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: make BuildRequires: libxml2-devel >= 2.9.2-1 BuildRequires: readline-devel >= 6.3-5 Requires: %{name}-libs = %{version}-%{release} Requires: readline >= 6.3-5 %description A library for programmatically editing configuration files. Augeas parses configuration files into a tree structure, which it exposes through its public API. Changes made through the API are written back to the initially read files. The transformation works very hard to preserve comments and formatting details. It is controlled by ``lens'' definitions that describe the file format and the transformation into a tree. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name}-libs = %{version}-%{release} Requires: pkg-config %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{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 -q64" or "gcc -maix64". %package libs Summary: Libraries for %{name} Group: System Environment/Libraries Requires: libgcc >= 4.5.4-1 Requires: libxml2 >= 2.9.2-1 %description libs The libraries for %{name}. The library is available as 32-bit and 64-bit. %prep %setup -q #%patch0 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CFLAGS="-DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include -D_LARGE_FILES" export PATH=/opt/freeware/bin:$PATH cd 64bit # first build the 64-bit version export OBJECT_MODE=64 export CC="gcc -maix64" 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} cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 export CC="gcc -maix32" export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --enable-shared --disable-static make %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} export PATH=/opt/freeware/bin:$PATH cd 64bit export OBJECT_MODE=64 make DESTDIR=${RPM_BUILD_ROOT} install ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in * ; do mv -f ${f} ${f}_64 done ) cd ../32bit export OBJECT_MODE=32 make DESTDIR=${RPM_BUILD_ROOT} install /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : ( 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* # The tests/ subdirectory contains lenses used only for testing, and # so it shouldn't be packaged. rm -r ${RPM_BUILD_ROOT}%{_datadir}/augeas/lenses/dist/tests ( cd ${RPM_BUILD_ROOT} for dir in bin 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,-) %{_bindir}/augtool* %{_bindir}/augparse* %{_bindir}/fadot* %{_mandir}/man1/* %{_datadir}/vim/vimfiles/syntax/augeas.vim %{_datadir}/vim/vimfiles/ftdetect/augeas.vim /usr/bin/augtool* /usr/bin/augparse* /usr/bin/fadot* %files libs %defattr(-,root,system,-) %doc 32bit/AUTHORS 32bit/COPYING 32bit/NEWS %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* %{_datadir}/%{name} %files devel %defattr(-,root,system,-) %doc 32bit/AUTHORS 32bit/COPYING 32bit/NEWS %{_includedir}/* %{_libdir}/*.la %{_libdir64}/*.la %{_libdir}/pkgconfig/augeas.pc %{_libdir64}/pkgconfig/augeas.pc %changelog * Wed Aug 26 2015 Michael Perzl - 1.4.0-1 - updated to version 1.4.0 * Wed Aug 26 2015 Michael Perzl - 1.3.0-1 - updated to version 1.3.0 * Thu Mar 27 2014 Michael Perzl - 1.2.0-1 - updated to version 1.2.0 * Tue Dec 10 2013 Michael Perzl - 1.1.0-1 - first version for AIX V5.1 and higher