%define tarballversion 1.4.6 Name: GeoIP Version: 1.4.7 Release: 0.1.20090931cvs Summary: C library for country/city/organization to IP address or hostname mapping Group: Development/Libraries License: LGPLv2+ URL: http://www.maxmind.com/app/c Source0: http://www.maxmind.com/download/geoip/api/c/%{name}-%{tarballversion}.tar.gz Source1: %{name}-LICENSE.txt Source2: fetch-geoipdata-city.pl Source3: fetch-geoipdata.pl Source4: %{name}-README Patch0: geoip-%{tarballversion}-ipv6.patch Patch1: %{name}-%{tarballversion}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Obsoletes: geoip < %{version}-%{release} Provides: geoip = %{version}-%{release} BuildRequires: zlib-devel Requires: zlib %description GeoIP is a C library that enables the user to find the country that any IP address or hostname originates from. It uses a file based database that is accurate as of March 2003. This database simply contains IP blocks as keys, and countries as values. This database should be more complete and accurate than using reverse DNS lookups. %package devel Summary: Development headers and libraries for GeoIP Group: Development/Libraries Requires: %{name} = %{version}-%{release} Provides: geoip-devel = %{version}-%{release} Obsoletes: geoip-devel < %{version}-%{release} %description devel Development headers and static libraries for building GeoIP-based applications %prep %setup -q -n %{name}-%{tarballversion} export PATH=/opt/freeware/bin:$PATH %patch0 -p1 %patch1 cp %{SOURCE1} LICENSE.txt cp %{SOURCE2} . cp %{SOURCE3} . cp %{SOURCE4} README %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="cc -q64 -qcpluscmt -D_LINUX_SOURCE_COMPAT" ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --enable-shared --disable-static make %{?_smp_mflags} cp ./libGeoIP/.libs/libGeoIP.so.1 . cp ./libGeoIP/.libs/libGeoIPUpdate.so.0 . make distclean # now build the 32-bit version export CC="cc -qcpluscmt -D_LINUX_SOURCE_COMPAT" ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --enable-shared --disable-static make %{?_smp_mflags} # add the 64-bit shared objects to the shared library containing already the # 32-bit shared objects ${AR} -q ./libGeoIP/.libs/libGeoIP.a libGeoIP.so.1 ${AR} -q ./libGeoIP/.libs/libGeoIPUpdate.a libGeoIPUpdate.so.0 %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} make install DESTDIR=${RPM_BUILD_ROOT} /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || : ( cd ${RPM_BUILD_ROOT} for dir in bin 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 COPYING ChangeLog README TODO INSTALL LICENSE* fetch-* %config(noreplace) %{_sysconfdir}/%{name}.conf.default %config(noreplace) %{_sysconfdir}/%{name}.conf %{_bindir}/* %{_libdir}/*.a %{_mandir}/man1/*.1* %{_datadir}/%{name} /usr/bin/* /usr/lib/*.a %files devel %defattr(-,root,system,-) %{_includedir}/* %{_libdir}/*.la /usr/include/* /usr/lib/*.la %changelog * Wed May 19 2010 Michael Perzl - 1.4.7-0.1.20090931cvs - first version for AIX V5.1 and higher