[GeoIP] Fix %post steps; add cron.weekly support.

Philip Prindeville philipp at fedoraproject.org
Tue Apr 2 22:39:30 UTC 2013


commit 4a22bd9797a82417e2443b7dbbd9a7c8a91e9d70
Author: Philip Prindeville <philipp at fedoraproject.org>
Date:   Tue Apr 2 16:34:25 2013 -0600

    Fix %post steps; add cron.weekly support.

 GeoIP.spec       |   10 ++++++++--
 geoipupdate.cron |    3 +++
 2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/GeoIP.spec b/GeoIP.spec
index 25fe7ac..6f7f407 100644
--- a/GeoIP.spec
+++ b/GeoIP.spec
@@ -10,6 +10,7 @@ Source1:	LICENSE.txt
 Source2:	fetch-geoipdata-city.pl
 Source3:	fetch-geoipdata.pl
 Source4:	README.Fedora
+Source5:	geoipupdate.cron
 Patch10:	GeoIP-1.5.0-UTF8.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
 BuildRequires:	zlib-devel
@@ -65,6 +66,9 @@ make %{?_smp_mflags}
 rm -rf %{buildroot}
 make DESTDIR=%{buildroot} install
 
+# fetch database updates weekly
+install -D -m755 %{SOURCE5} %{buildroot}%{_sysconfdir}/cron.weekly/geoipupdate
+
 # nix the stuff we don't need like .la files.
 rm -f %{buildroot}%{_libdir}/*.la
 
@@ -79,7 +83,8 @@ ln -sf GeoLiteCountry.dat %{buildroot}%{_datadir}/GeoIP/GeoIP.dat
 %clean
 rm -rf %{buildroot}
 
-%post -p /sbin/ldconfig
+%post
+/sbin/ldconfig
 geoipupdate 
 
 %postun -p /sbin/ldconfig
@@ -89,6 +94,7 @@ geoipupdate
 %doc AUTHORS COPYING ChangeLog README TODO LICENSE* fetch-*
 %config(noreplace) %{_sysconfdir}/GeoIP.conf.default
 %config(noreplace) %{_sysconfdir}/GeoIP.conf
+%{_sysconfdir}/cron.weekly/geoipupdate
 %{_bindir}/geoiplookup6
 %{_bindir}/geoiplookup
 %{_datadir}/GeoIP/
@@ -108,9 +114,9 @@ geoipupdate
 %{_includedir}/GeoIPCity.h
 %{_includedir}/GeoIPUpdate.h
 %{_libdir}/libGeoIP.so
+%{_libdir}/pkgconfig/geoip.pc
 # GPLv2+
 %{_libdir}/libGeoIPUpdate.so
-%{_libdir}/pkgconfig/geoip.pc
 
 %changelog
 * Mon Apr 02 2013 Philip Prindeville <philipp at fedoraproject.org> - 1.5.0-1
diff --git a/geoipupdate.cron b/geoipupdate.cron
new file mode 100644
index 0000000..383d82f
--- /dev/null
+++ b/geoipupdate.cron
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+geoipupdate


More information about the scm-commits mailing list