Summary: X.Org X11 libXpm runtime library Name: libXpm Version: 3.5.7 Release: 1 License: MIT/X11 Group: System Environment/Libraries URL: http://www.x.org BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Source0: ftp://ftp.x.org/pub/individual/lib/%{name}-%{version}.tar.bz2 Source1: libXpm-x11.pc Source2: libXpm-xproto.pc BuildRequires: pkg-config, gettext %description X.Org X11 libXpm runtime library. The library is available as 32-bit and 64-bit. %package devel Summary: X.Org X11 libXpm development package Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: gettext %description devel X.Org X11 libXpm development package. 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 -q64" or "gcc -maix64". %prep %setup -q cp %{SOURCE1} /opt/freeware/lib/pkgconfig/x11.pc cp %{SOURCE2} /opt/freeware/lib/pkgconfig/xproto.pc chmod 644 /opt/freeware/lib/pkgconfig/x11.pc chmod 644 /opt/freeware/lib/pkgconfig/xproto.pc %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 -q64" ./configure \ --prefix=%{_prefix} \ --mandir=%{_prefix}/man \ --enable-shared --enable-static make %{?_smp_mflags} cp src/.libs/libXpm.so.4 . make distclean # now build the 32-bit version export CC="xlc" ./configure \ --prefix=%{_prefix} \ --mandir=%{_prefix}/man \ --enable-shared --enable-static make %{?_smp_mflags} # add the 64-bit shared objects to the shared library containing already the # 32-bit shared objects ${AR} -q src/.libs/libXpm.a ./libXpm.so.4 # add compatibility member for older libXpm version cp src/.libs/libXpm.so.4 shr.o ${AR} -q src/.libs/libXpm.a ./shr.o # correct the xpm.pc file cat xpm.pc | \ grep -v "Requires.private: x11" | \ sed -e "s|Requires: x11|Requires:|" > tmp_xpm.pc mv -f tmp_xpm.pc xpm.pc # build sxpm cd sxpm ${CC} -c -I../include sxpm.c /opt/freeware/bin/bash ../libtool --tag=CC --mode=link xlc sxpm.o -o sxpm -L/opt/freeware/lib -lintl -L../src -lXpm -lXt -lXext %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install cp sxpm/sxpm $RPM_BUILD_ROOT%{_bindir} chmod 755 $RPM_BUILD_ROOT%{_bindir}/sxpm cp sxpm/sxpm.man $RPM_BUILD_ROOT%{_mandir}/man1/sxpm.1 chmod 644 $RPM_BUILD_ROOT%{_mandir}/man1/sxpm* %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT rm -f /opt/freeware/lib/pkgconfig/x11.pc rm -f /opt/freeware/lib/pkgconfig/xproto.pc %files %defattr(-,root,system,-) %doc AUTHORS COPYING README.html INSTALL ChangeLog %{_libdir}/libXpm.a %files devel %defattr(-,root,system,-) %{_bindir}/?xpm %dir %{_includedir}/X11 %{_includedir}/X11/xpm.h %{_libdir}/libXpm.la %{_libdir}/pkgconfig/xpm.pc %{_mandir}/man1/*.1 %changelog * Thu Jan 03 2008 Michael Perzl - 3.5.7-1 - first version for AIX V5.1 and higher