File GeoIP.spec of Package GeoIP

#
# spec file for package GeoIP (Version 1.4.6)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           GeoIP
Version:        1.4.6
Release:        3
#
License:        GPL v2 or later ; LGPL v2.1 or later ; libGeoIPUpdate is GPLv2 or later and GeoIP is LGPLv2.1 or later
Summary:        Library to find the country that any IP address originates from
Group:          Development/Libraries/C and C++
#
Url:            http://www.maxmind.com/
Source:         http://www.maxmind.com/download/geoip/api/c/%{name}-%{version}.tar.bz2
Source1:        LICENSE.txt
Source2:        GPL-2.0.txt
Source3:        README.SUSE
Source4:        geoip-fetch
#
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  zlib-devel
%if 0%{?suse_version}
Recommends:     curl
%endif

%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.
 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.

MaxMind offers a service where you can have your database updated
automically each month.



Authors:
--------
    T.J. Mather <tjmather@maxmind.com>

%package -n libGeoIP1
License:        LGPL v2.1 or later
Summary:        Shared libraries of the GeoIP C API
Group:          Development/Libraries/C and C++
# for the data file
%if 0%{?suse_version}
Recommends:     GeoIP
%endif

%description -n libGeoIP1
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.
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.

MaxMind offers a service where you can have your database updated
automically each month.

This package holds the shared libraries for GeoIP.



Authors:
--------
    T.J. Mather <tjmather@maxmind.com>

%package -n libGeoIP-devel
License:        LGPL v2.1 or later
Summary:        Development Files for GeoIP
Group:          Development/Libraries/C and C++
#
Requires:       libGeoIP1 = %{version}
Provides:       %{name}-devel = %{version}-%{release}
Obsoletes:      %{name}-devel < %{version}

%description -n libGeoIP-devel
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.
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.

MaxMind offers a service where you can have your database updated
automically each month.

This package holds the development files for GeoIP.



Authors:
--------
    T.J. Mather <tjmather@maxmind.com>

%prep
%setup -q
cp %{SOURCE1} .
cp %{SOURCE2} .
cp %{SOURCE3} .

%build
%configure --disable-static --with-pic
sed -i -e '/-DGEOIPDATADIR/s,\$(pkgdatadir),/var/lib/GeoIP,' libGeoIP/Makefile{.am,.in,}
sed -i -e 's,\$(pkgdatadir),/var/lib/GeoIP,' man/Makefile{.am,.in,}
%{__make} %{?jobs:-j%jobs}

%install
%makeinstall
install -d %{buildroot}/var/lib
mv %{buildroot}%{_datadir}/GeoIP %{buildroot}/var/lib
for i in GeoIPASNum.dat GeoIPCity.dat GeoIPv6.dat; do
	touch %buildroot/var/lib/GeoIP/$i
done
# we don't need that, we use %config(noreplace) instead
%{__rm} %{buildroot}%{_sysconfdir}/GeoIP.conf.default
# no need for that
%{__rm} %{buildroot}%{_libdir}/*.la
# install fetcher
install -D -m 0755 %{SOURCE4} %{buildroot}%{_sbindir}/geoip-fetch

%clean
%{__rm} -rf %{buildroot}

%post   -n libGeoIP1 -p /sbin/ldconfig

%postun -n libGeoIP1 -p /sbin/ldconfig

%files
%defattr(-, root, root, -)
%doc AUTHORS ChangeLog COPYING README TODO LICENSE.txt GPL-2.0.txt README.SUSE
%config(noreplace) %{_sysconfdir}/GeoIP.conf
%{_bindir}/geoiplookup
%{_bindir}/geoiplookup6
%{_bindir}/geoipupdate
%{_mandir}/man1/geoiplookup6.1*
%{_mandir}/man1/geoiplookup.1*
%{_mandir}/man1/geoipupdate.1*
%{_sbindir}/geoip-fetch
%dir /var/lib/GeoIP
%verify(not md5 size mtime) /var/lib/GeoIP/GeoIP.dat
%ghost %verify(not md5 size mtime) /var/lib/GeoIP/GeoIPASNum.dat
%ghost %verify(not md5 size mtime) /var/lib/GeoIP/GeoIPCity.dat
%ghost %verify(not md5 size mtime) /var/lib/GeoIP/GeoIPv6.dat

%files -n libGeoIP1
%defattr(-, root, root, -)
%{_libdir}/libGeoIP.so.1
%{_libdir}/libGeoIP.so.1.4.6
%{_libdir}/libGeoIPUpdate.so.0
%{_libdir}/libGeoIPUpdate.so.0.0.0

%files -n libGeoIP-devel
%defattr(-, root, root, -)
%{_includedir}/GeoIP.h
%{_includedir}/GeoIPCity.h
%{_includedir}/GeoIPUpdate.h
%{_libdir}/libGeoIP.so
%{_libdir}/libGeoIPUpdate.so

%changelog
* Thu Jun 18 2009 lnussel@novell.com
- move database files to /var/lib/GeoIP
* Wed Jun 17 2009 prusnak@suse.cz
- added tool which fetches the current GeoIP data (geoip-fetch)
* Thu May 28 2009 lnussel@suse.de
- new version 1.4.6 (bugfix release)
* Thu Dec 04 2008 lnussel@suse.de
- add GPL file (bnc#449068)
* Wed Sep 17 2008 lnussel@suse.de
- new version 1.4.5
  * new functions GeoIP_range_by_ip_delete, GeoIP_range_by_ip, array access functions
  * ipv6 support
  * http proxy support
  * more time zones
* Sun Sep 14 2008 lnussel@suse.de
- recommends main package due to data file
* Tue Jan 22 2008 lnussel@suse.de
- new version 1.4.4, breaks ABI wrt GeoIP_country_code!
  * Updated original geoipupdate to return "Invalid product ID or
  subscription expired"
  * Added BL/Saint Barthelemy, MF/Saint Martin (ISO-3166-1
  additions)
  * Check for illegal IP strings, return 0 if IP is not well formed
  IPv4 e.g. 1.2.3.4.5 and 1.2.3
  * Clarified that while core GeoIP library is LGPL, libGeoIPUpdate
  depends on md5.c and types.h which are GPL.
  * speedup the conversion from ipstring to ipnum in
  _GeoIP_addr_to_num. Doubles the speed of GEOIP_MEMORY_CACHE and
  GEOIP_MMAP_CACHE
  * Added new mmap shared memory caching option, GEOIP_MMAP_CACHE
* Tue Oct 09 2007 mrueckert@suse.de
- move the ldconfig calls to the correct package
* Sun Oct 07 2007 mrueckert@suse.de
- new version 1.4.3
  ! CHANGE with geoiplookup facility: -v flag now returns database
  info for all databases, not just GeoIP Country
  * Added ability to get netmask of network block from last lookup
  using GeoIP_last_netmask
  * Fixed GeoIP_database_info bug with GeoLite City
  * Replaced 4 with sizeof(char*) to fix issues with geoipupdate on
  64 Bit machines
  * Added GeoIP_set_charset function - enables UTF8 output of city
  name if GEOIP_CHARSET_UTF8 flag is passed to GeoIP_set_charset
  * Fixed segfault issue if calling GeoIP_db_avail before opening
  a database
  * Added continent_code to GeoIP City's record struct
  (Frank Mather)
- changes to the package layout:
  - splitted out library package (libGeoIP1)
  - renamed devel package GeoIP-devel to libGeoIP-devel
* Wed Aug 29 2007 mrueckert@suse.de
- we dont need zlib-devel to link against libGeoIP
* Wed Aug 29 2007 mrueckert@suse.de
- spec file cleanup
- fix rpmlint warnings
* Wed Aug 29 2007 crrodriguez@suse.de
- run ldconfig
- fix devel package dependencies
* Thu Apr 05 2007 mrueckert@suse.de
- submit the splitted package from the buildservice
* Thu Mar 29 2007 lnussel@suse.de
- new version 1.4.2
  * Replaced CS/Serbia and Montenegro with RS/Serbia, removed
  ZR/Zaire, added ME/Montenegro
  * Added AX/Aland Islands, GG/Guernsey, IM/Isle of Man, JE/Jersey
  (ISO-3166-1 changes)
  * Added GeoIP_time_zone_by_country_and_region(),
  GeoIP_region_name_by_code()
  * Added -d flag to enable custom path for geoipupdate
- don't package *.a and *.la
- add zlib-devel to BuildRequires
* Fri Jan 26 2007 mrueckert@suse.de
- update to version 1.4.1
  * Replaced CS/Serbia and Montenegro with RS/Serbia, removed
  ZR/Zaire, added ME/Montenegro
  * Added AX/Aland Islands, GG/Guernsey, IM/Isle of Man, JE/Jersey
  (ISO-3166-1 changes)
  * Added GeoIP_time_zone_by_country_and_region, to lookup zoneinfo
  timezone by country and region (Frank Mather)
  * Added GeoIP_region_name_by_code, to lookup region name from
  region code (Frank Mather)
  * added -f and -d flags to enable custom paths for geoiplookup
  utility program (Frank Mather)
  * Added benchmarks for GeoIP Region and City in test/benchmark.c
  (Frank Mather)
  * Fixed build issue when using --as-needed flag
  (Diego 'Flameeyes' Pettenò)
  * Add sanity checking for filename returned by MaxMind.com server
  for geoipupdate filename (Dean Gaudet, arctic.org)
  * Fixed memory leaks under error conditions, buffer overflow
  using sprintf, and issue where a corrupted cache file could
  core dump the file (Nick Galbreath, Right Media Inc)
* Fri Dec 08 2006 mrueckert@suse.de
- spec file clean up
- split out the devel files
* Sat Oct 28 2006 lnussel@suse.de
- update to version 1.4.0
  * license change to LGPL
  * various fixes
* Mon May 15 2006 cthiel@suse.de
- update to version 1.3.17
  * Fixed headers for Windows/Netware compliation
  * Updated README documentation
  * Updated geoipupdate so that it writes file as it is uncompressed inst
  of storing entire GeoIP.dat file in memory
  * Updated geoiplookup so that it returns GeoIP Domain Name if available
  * Updated geoipupdate so that it reports whether databases are updated
  in non-verbose mode
  * Fixed compliation error in GeoIPUpdate.c
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Thu Sep 15 2005 lnussel@suse.de
- new version 1.3.14
* Mon Jul 04 2005 lnussel@suse.de
- fix gcc warnings (#95085)
* Thu Nov 25 2004 lnussel@suse.de
- new version 1.3.8
* Thu Nov 18 2004 ro@suse.de
- fixed file list
* Thu Jul 15 2004 lnussel@suse.de
- new version 1.3.5
- fix missing prototype and a memleak
* Fri Apr 16 2004 lnussel@suse.de
- fix missing return value in main() of some test programs
* Mon Nov 24 2003 lnussel@suse.de
- initial package, version 1.3.1
openSUSE Build Service is sponsored by