%define _prefix /opt/freeware Summary: A C library for parsing command line parameters. Name: popt Version: 1.7 Release: 1 License: MIT/X Consortium Group: Development/Libraries Source: popt-%{version}.tar.bz2 Patch0: popt-1.7-aix.patch Patch1: popt-1.7-autotools.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: gettext Prefix: %{_prefix} %define DEFCC cc %description Popt is a C library for parsing command line parameters. Popt was heavily influenced by the getopt() and getopt_long() functions, but it improves on them by allowing more powerful argument expansion. Popt can parse arbitrary argv[] style arrays and automatically set variables based on command line arguments. Popt allows command line arguments to be aliased via configuration files and includes utility functions for parsing arbitrary strings into argv[] arrays using shell-like rules. %prep %setup -q if test x$PATCH = x ; then PATCH=patch ; fi $PATCH -p2 -s < %{_sourcedir}/popt-1.7-aix.patch $PATCH -p2 -s < %{_sourcedir}/popt-1.7-autotools.patch %build # Use the default compiler for this platform - gcc otherwise if [[ -z "$CC" ]] then if test "X`type %{DEFCC} 2>/dev/null`" != 'X'; then export CC=%{DEFCC} else export CC=gcc fi fi if [[ "$CC" != "gcc" ]] then export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's:-fsigned-char::'` fi export CFLAGS=$RPM_OPT_FLAGS chmod +x ./configure ./configure --prefix=%{_prefix} make %install if test "$RPM_BUILD_ROOT" != "/"; then rm -rf $RPM_BUILD_ROOT fi mkdir -p %{buildroot} make DESTDIR=%{buildroot} install # rpm itself depends on the .so file; # extract it and create the links to match how it was # in popt 1.5 ( cd $RPM_BUILD_ROOT%{prefix}/lib ar -x libpopt.a libpopt.so.0 mv libpopt.so.0 libpopt.so.0.0.0 ln -s libpopt.so.0.0.0 libpopt.so.0 ln -s libpopt.so.0.0.0 libpopt.so cd - ) ( cd $RPM_BUILD_ROOT mkdir -p usr/lib usr/include cd usr/lib ln -sf ../..%{prefix}/lib/* . cd ../../usr/include ln -sf ../..%{prefix}/include/* . cd - ) %files %defattr(-, root, system) %{_prefix}/lib/libpopt.a %{_prefix}/lib/libpopt.so* %{_prefix}/lib/libpopt.la %{_prefix}/include/popt.h %{_prefix}/man/man3/popt.3* /usr/lib/* /usr/include/*.h %lang(cs) %{_prefix}/*/locale/cs/LC_MESSAGES/popt.mo %lang(da) %{_prefix}/*/locale/da/LC_MESSAGES/popt.mo %lang(es) %{_prefix}/*/locale/es/LC_MESSAGES/popt.mo %lang(gl) %{_prefix}/*/locale/gl/LC_MESSAGES/popt.mo %lang(hu) %{_prefix}/*/locale/hu/LC_MESSAGES/popt.mo %lang(is) %{_prefix}/*/locale/is/LC_MESSAGES/popt.mo %lang(ko) %{_prefix}/*/locale/ko/LC_MESSAGES/popt.mo %lang(no) %{_prefix}/*/locale/no/LC_MESSAGES/popt.mo %lang(pt) %{_prefix}/*/locale/pt/LC_MESSAGES/popt.mo %lang(ro) %{_prefix}/*/locale/ro/LC_MESSAGES/popt.mo %lang(ru) %{_prefix}/*/locale/ru/LC_MESSAGES/popt.mo %lang(sk) %{_prefix}/*/locale/sk/LC_MESSAGES/popt.mo %lang(sl) %{_prefix}/*/locale/sl/LC_MESSAGES/popt.mo %lang(sv) %{_prefix}/*/locale/sv/LC_MESSAGES/popt.mo %lang(tr) %{_prefix}/*/locale/tr/LC_MESSAGES/popt.mo %lang(uk) %{_prefix}/*/locale/uk/LC_MESSAGES/popt.mo %lang(wa) %{_prefix}/*/locale/wa/LC_MESSAGES/popt.mo %lang(zh_CN) %{_prefix}/*/locale/zh_CN.GB2312/LC_MESSAGES/popt.mo