Blame SPECS/GeoIP.spec

4bb07d
# Noarch subpackages available from Fedora 10, RHEL 6
4bb07d
%global noarch_subpkgs 0%{?fedora} > 9 || 0%{?rhel} > 5
4bb07d
4bb07d
Name:		GeoIP
4bb07d
Version:	1.5.0
4bb07d
Release:	6%{?dist}
4bb07d
Summary:	Library for country/city/organization to IP address or hostname mapping
4bb07d
Group:		Development/Libraries
4bb07d
License:	LGPLv2+ and GPLv2+
4bb07d
URL:		http://www.maxmind.com/app/c
4bb07d
Source0:	http://www.maxmind.com/download/geoip/api/c/GeoIP-%{version}.tar.gz
4bb07d
Source1:	LICENSE.txt
4bb07d
Source2:	fetch-geoipdata-city.pl
4bb07d
Source3:	fetch-geoipdata.pl
4bb07d
Source5:	geoipupdate.cron
4bb07d
Patch10:	GeoIP-1.5.0-UTF8.patch
4bb07d
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
4bb07d
BuildRequires:	zlib-devel
4bb07d
Obsoletes:	geoip < %{version}-%{release}
4bb07d
Provides:	geoip = %{version}-%{release}
4bb07d
4bb07d
%description
4bb07d
GeoIP is a C library that enables the user to find the country that any IP
4bb07d
address or hostname originates from. It uses a file based database that is
4bb07d
updated at install time if possible, and can optionally be updated on a weekly
4bb07d
basis by installing the GeoIP-update package. This database simply contains IP
4bb07d
blocks as keys, and countries as values. This database should be more complete
4bb07d
and accurate than using reverse DNS lookups.
4bb07d
4bb07d
%package update
4bb07d
Summary:	Crontab entry to facilitate automatic updates of databases
4bb07d
Group:		Applications/Databases
4bb07d
Requires:	crontabs
4bb07d
Requires:	%{name} = %{version}-%{release}
4bb07d
%if %{noarch_subpkgs}
4bb07d
BuildArch:	noarch
4bb07d
%endif
4bb07d
4bb07d
%description update
4bb07d
Crontab entry to provide weekly updates of the GeoIP free databases.
4bb07d
4bb07d
%package devel
4bb07d
Summary:	Development headers and libraries for GeoIP
4bb07d
Group:		Development/Libraries
4bb07d
Requires:	%{name} = %{version}-%{release}
4bb07d
Provides:	geoip-devel = %{version}-%{release}
4bb07d
Obsoletes:	geoip-devel < %{version}-%{release}
4bb07d
4bb07d
%description devel
4bb07d
Development headers and static libraries for building GeoIP-based applications.
4bb07d
4bb07d
%prep
4bb07d
%setup -q
4bb07d
4bb07d
# Recode docs as UTF-8
4bb07d
%patch10 -p1
4bb07d
4bb07d
install -D -m644 %{SOURCE1} LICENSE.txt
4bb07d
install -D -m644 %{SOURCE2} fetch-geoipdata-city.pl
4bb07d
install -D -m644 %{SOURCE3} fetch-geoipdata.pl
4bb07d
install -D -m644 %{SOURCE5} geoipupdate.cron
4bb07d
4bb07d
%build
4bb07d
# Fix timestamp order to avoid trying to re-run autotools and configure,
4bb07d
# thus clobbering our hacked libtool later on
4bb07d
touch aclocal.m4
4bb07d
touch configure
4bb07d
touch config.h.in
4bb07d
touch config.status
4bb07d
find . -name Makefile.in -exec touch {} \;
4bb07d
4bb07d
%configure --disable-static --disable-dependency-tracking
4bb07d
4bb07d
# Kill bogus rpaths
4bb07d
sed -i -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
4bb07d
	-e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
4bb07d
4bb07d
make %{?_smp_mflags}
4bb07d
4bb07d
%install
4bb07d
rm -rf %{buildroot}
4bb07d
make DESTDIR=%{buildroot} DEFAULT_DB_FILE="%{_datadir}/GeoIP/GeoIP-initial.dat" install
4bb07d
4bb07d
# fetch database updates weekly
4bb07d
install -D -m755 geoipupdate.cron %{buildroot}%{_sysconfdir}/cron.weekly/geoipupdate
4bb07d
4bb07d
# nix the stuff we don't need like .la files.
4bb07d
rm -f %{buildroot}%{_libdir}/*.la
4bb07d
4bb07d
# fix up the config file to use the free products by default
4bb07d
sed -i \
4bb07d
	-e 's/YOUR_LICENSE_KEY_HERE$/000000000000/' \
4bb07d
	-e 's/YOUR_USER_ID_HERE$/999999/' \
4bb07d
	-e 's/106$/506 533 517/' \
4bb07d
	%{buildroot}%{_sysconfdir}/GeoIP.conf
4bb07d
4bb07d
# make the default GeoIP.dat a symlink to GeoIP-initial.dat,
4bb07d
# at least until %%post has run
4bb07d
ln -sf GeoIP-initial.dat %{buildroot}%{_datadir}/GeoIP/GeoIP.dat
4bb07d
4bb07d
# create empty files for initial %%ghost databases
4bb07d
touch %{buildroot}%{_datadir}/GeoIP/GeoLite{ASNum,City,Country}.dat
4bb07d
chmod 644 %{buildroot}%{_datadir}/GeoIP/GeoLite{ASNum,City,Country}.dat
4bb07d
4bb07d
%clean
4bb07d
rm -rf %{buildroot}
4bb07d
4bb07d
%post
4bb07d
/sbin/ldconfig
4bb07d
geoipupdate > /dev/null && \
4bb07d
	ln -sf GeoLiteCountry.dat %{_datadir}/GeoIP/GeoIP.dat
4bb07d
4bb07d
%postun -p /sbin/ldconfig
4bb07d
4bb07d
%files
4bb07d
# LGPLv2+
4bb07d
%doc AUTHORS COPYING ChangeLog README TODO LICENSE* fetch-*
4bb07d
%config(noreplace) %{_sysconfdir}/GeoIP.conf
4bb07d
%config(noreplace) %{_sysconfdir}/GeoIP.conf.default
4bb07d
%{_bindir}/geoiplookup
4bb07d
%{_bindir}/geoiplookup6
4bb07d
%dir %{_datadir}/GeoIP/
4bb07d
%{_datadir}/GeoIP/GeoIP-initial.dat
4bb07d
%verify(not md5 size link mtime) %{_datadir}/GeoIP/GeoIP.dat
4bb07d
%ghost %{_datadir}/GeoIP/GeoLiteASNum.dat
4bb07d
%ghost %{_datadir}/GeoIP/GeoLiteCity.dat
4bb07d
%ghost %{_datadir}/GeoIP/GeoLiteCountry.dat
4bb07d
%{_libdir}/libGeoIP.so.1
4bb07d
%{_libdir}/libGeoIP.so.1.*
4bb07d
%{_mandir}/man1/geoiplookup.1*
4bb07d
%{_mandir}/man1/geoiplookup6.1*
4bb07d
# GPLv2+
4bb07d
%{_bindir}/geoipupdate
4bb07d
%{_libdir}/libGeoIPUpdate.so.0
4bb07d
%{_libdir}/libGeoIPUpdate.so.0.*
4bb07d
%{_mandir}/man1/geoipupdate.1*
4bb07d
4bb07d
%files update
4bb07d
%{_sysconfdir}/cron.weekly/geoipupdate
4bb07d
4bb07d
%files devel
4bb07d
# LGPLv2+
4bb07d
%{_includedir}/GeoIP.h
4bb07d
%{_includedir}/GeoIPCity.h
4bb07d
%{_includedir}/GeoIPUpdate.h
4bb07d
%{_libdir}/libGeoIP.so
4bb07d
%{_libdir}/pkgconfig/geoip.pc
4bb07d
# GPLv2+
4bb07d
%{_libdir}/libGeoIPUpdate.so
4bb07d
4bb07d
%changelog
4bb07d
* Mon Jun 10 2013 Paul Howarth <paul@city-fan.org> - 1.5.0-6
4bb07d
- Update sub-package requires main package for geoipupdate script
4bb07d
4bb07d
* Sat Jun  8 2013 Paul Howarth <paul@city-fan.org> - 1.5.0-5
4bb07d
- Make GeoIP.dat -> GeoIP-initial.dat symlink in %%install, not %%post,
4bb07d
  and don't %%ghost it
4bb07d
- Run geoipupdate silently in %%post and cron job
4bb07d
- Create empty database files for %%ghost to work with old rpm versions
4bb07d
- Don't try to use noarch subpackages on old rpm versions
4bb07d
- Update %%description to mention database updates
4bb07d
- Drop outdated README.Fedora
4bb07d
4bb07d
* Sat Jun 08 2013 Philip Prindeville <philipp@fedoraproject.org> - 1.5.0-4
4bb07d
- Revert ability to replace 3rd-party package
4bb07d
4bb07d
* Fri Jun 07 2013 Philip Prindeville <philipp@fedoraproject.org> - 1.5.0-3
4bb07d
- Add attributes for %%ghost files
4bb07d
4bb07d
* Fri Jun 07 2013 Philip Prindeville <philipp@fedoraproject.org> - 1.5.0-2
4bb07d
- Make update subpackage be noarch.
4bb07d
4bb07d
* Fri Jun 07 2013 Philip Prindeville <philipp@fedoraproject.org> - 1.5.0-1
4bb07d
- Version bump to 1.5.0
4bb07d
- Have GeoIP.dat be a symlink to the real data, and install the canned
4bb07d
  GeoIP.dat as GeoIP-initial.dat
4bb07d
- Change config as per Boris' instructions to use 'lite' databases which are
4bb07d
  regularly updated.
4bb07d
- Add pkgconfig (.pc) file into devel subpackage
4bb07d
- Add cron support for refreshing the lite databases and make a separate
4bb07d
  subpackage.
4bb07d
4bb07d
* Sun Mar 24 2013 Paul Howarth <paul@city-fan.org> - 1.4.8-6
4bb07d
- Fix config.guess and config.sub to add aarch64 support (#925403)
4bb07d
4bb07d
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.8-5
4bb07d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
4bb07d
4bb07d
* Mon Oct 22 2012 Paul Howarth <paul@city-fan.org> - 1.4.8-4
4bb07d
- libGeoIPUpdate and geoipupdate (which is linked against it) are GPL-licensed
4bb07d
  rather than LGPL-licensed (#840896)
4bb07d
- Don't package generic INSTALL file (#661625)
4bb07d
- Kill bogus rpaths on x86_64
4bb07d
- Hardcode library sonames in %%files list to avoid nasty surprises in the
4bb07d
  future
4bb07d
- Drop %%defattr, redundant since rpm 4.4
4bb07d
- Recode docs as UTF-8
4bb07d
- Don't use macros for commands
4bb07d
- Use tabs
4bb07d
4bb07d
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.8-3.1
4bb07d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
4bb07d
4bb07d
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.8-2.1
4bb07d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
4bb07d
4bb07d
* Tue Sep 6 2011 Michael Fleming <mfleming+rpm@thatfleminggent.com> - 1.4.8-1.1
4bb07d
- Remove -ipv6 patch
4bb07d
- Bump to 1.4.8 release
4bb07d
4bb07d
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.7-0.2.20090931cvs
4bb07d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
4bb07d
4bb07d
* Mon Aug 31 2009 Matt Domsch <mdomsch@fedoraproject.org> - 1.4.7.0.1.20090931
4bb07d
- apply CVS HEAD 20090931 which includes IPv6 functions
4bb07d
4bb07d
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.6-2
4bb07d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
4bb07d
4bb07d
* Sun Mar 08 2009 Michael Fleming <mfleming+rpm@enlartenment.com> - 1.4.6-1
4bb07d
- Add geoiplookup6 man page
4bb07d
- Update to 1.4.6
4bb07d
4bb07d
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.5-3
4bb07d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
4bb07d
4bb07d
* Sat Nov 29 2008 Michael Fleming <mfleming+rpm@enlartenment.com> 1.4.5-2
4bb07d
- Update to 1.4.5
4bb07d
- Fix database URL locations in Perl helper scripts
4bb07d
4bb07d
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.4.4-2
4bb07d
- Autorebuild for GCC 4.3
4bb07d
4bb07d
* Mon Jan 28 2008 Michael Fleming <mfleming+rpm@enlartenment.com> 1.4.4-1
4bb07d
- New upstream release.
4bb07d
4bb07d
* Wed Sep 5 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 1.4.3-1
4bb07d
- New upstream release.
4bb07d
- Fix GeoIPCity fetcher script
4bb07d
- Update License tag
4bb07d
4bb07d
* Mon Feb 12 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 1.4.2-1
4bb07d
- New upstream release.
4bb07d
4bb07d
* Mon Jan 8 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 1.4.1-2
4bb07d
- License is actually LGPL now.
4bb07d
4bb07d
* Sun Jan 7 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 1.4.1-1
4bb07d
- New upstream release
4bb07d
- Add fetch-geoipdata* scripts to pull free databases automatically if
4bb07d
  desired (bz #198137)
4bb07d
- README.fedora added to briefly explain above.
4bb07d
4bb07d
* Mon Nov 27 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.4.0-4
4bb07d
- Fix %%install scripts to satisfy newer mock builds
4bb07d
4bb07d
* Sun Sep 3 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.4.0-3
4bb07d
- Upstream upgrade
4bb07d
- Added LICENSE.txt file to %%doc, covering GeoIP country/city data license
4bb07d
  (bz #198137)
4bb07d
4bb07d
* Mon May 15 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.3.17-1
4bb07d
- New upstream release (minor fixes)
4bb07d
4bb07d
* Mon May 1 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.3.16-1
4bb07d
- New upstream release 
4bb07d
- Add INSTALL document to package.
4bb07d
4bb07d
* Sat Feb 18 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.3.14-3
4bb07d
- Fix Obsoletes/Provides for old "geoip"-convention packages
4bb07d
- Move .so symlinks to -devel where they should be
4bb07d
4bb07d
* Fri Feb 10 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.3.14-2
4bb07d
- Remamed to match upstream tarball name
4bb07d
- Removed static libraries
4bb07d
- Added symlinks to packages
4bb07d
- Mark config file noreplace
4bb07d
4bb07d
* Sun Feb 5 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.3.14-1
4bb07d
- Initial review package for Extras