Summary: An ANSI C library for parsing GNU style command line arguments. Name: argtable2 Version: 13 Release: 1 License: LGPL Group: Development/Libraries Source0: http://prdownloads.sourceforge.net/argtable/%{name}-%{version}.tar.gz URL: http://argtable.sourceforge.net Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root %define _libdir64 %{_prefix}/lib64 %description Argtable is an ANSI C library for parsing GNU style command line arguments. It enables a program's command line syntax to be defined in the source code as an array of argtable structs. The command line is then parsed according to that specification and the resulting values are returned in those same structs where they are accessible to the main program. Both tagged (-v, --verbose, --foo=bar) and untagged arguments are supported, as are multiple instances of each argument. Syntax error handling is automatic and the library also provides the means for displaying the command line syntax directly from the array of argument specifications. The library is available as 32-bit and 64-bit. %package devel Summary: Development files from the %{name} library Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkg-config %description devel Argtable is an ANSI C library for parsing GNU style command line arguments. You will need to install this development package if you intend to build programs 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". %prep %setup -q mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build cd 64bit # first build the 64-bit version export OBJECT_MODE=64 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} \ --docdir=%{_prefix}/doc/%{name} \ --enable-shared --disable-static make %{?_smp_mflags} cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --docdir=%{_prefix}/doc/%{name} \ --enable-shared --disable-static make %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit export OBJECT_MODE=64 make DESTDIR=${RPM_BUILD_ROOT} install cd ../32bit export OBJECT_MODE=32 make DESTDIR=${RPM_BUILD_ROOT} install ( 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 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,-) %{_defaultdocdir} %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* %{_mandir}/man?/* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %{_includedir}/* %{_libdir}/*.la %{_libdir64}/*.la %{_libdir}/pkgconfig/* %{_libdir64}/pkgconfig/* /usr/include/* /usr/lib/*.la /usr/lib64/*.la %changelog * Tue Aug 09 2011 Michael Perzl - 13-1 - first version for AIX V5.1 and higher