SF.net SVN: gar:[22942] csw/mgar/pkg/mod_geoip/trunk

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Tue Feb 4 12:36:07 CET 2014


Revision: 22942
          http://sourceforge.net/p/gar/code/22942
Author:   dmichelsen
Date:     2014-02-04 11:36:06 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
mod_geoip/trunk: Added pre-/post-install, example conf

Modified Paths:
--------------
    csw/mgar/pkg/mod_geoip/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/mod_geoip/trunk/files/
    csw/mgar/pkg/mod_geoip/trunk/files/CSWap2-mod-geoip.postinstall
    csw/mgar/pkg/mod_geoip/trunk/files/CSWap2-mod-geoip.preremove
    csw/mgar/pkg/mod_geoip/trunk/files/httpd-geoip.conf.CSW

Modified: csw/mgar/pkg/mod_geoip/trunk/Makefile
===================================================================
--- csw/mgar/pkg/mod_geoip/trunk/Makefile	2014-02-04 10:02:14 UTC (rev 22941)
+++ csw/mgar/pkg/mod_geoip/trunk/Makefile	2014-02-04 11:36:06 UTC (rev 22942)
@@ -1,3 +1,7 @@
+# TBD:
+# - Test, test, test!! Especially mirrorbrain
+# - Make sure httpd-geoip.conf is installed and added to httpd.conf
+
 NAME = mod_geoip2
 VERSION = 1.2.8
 GARTYPE = v2
@@ -9,13 +13,18 @@
   as opposed to looking up arbitrary addresses.
 endef
 
-PACKAGES = CSWap2modgeoip2
-
 MASTER_SITES = http://www.maxmind.com/download/geoip/api/mod_geoip2/
 DISTFILES  = mod_geoip2-latest.tar.gz
+DISTFILES += CSWap2-mod-geoip.postinstall
+DISTFILES += CSWap2-mod-geoip.preremove
+DISTFILES += httpd-geoip.conf.CSW
+
 WORKSRC = $(WORKDIR)/mod_geoip2_$(VERSION)
 #PATCHDIR = $(WORKDIR)/$(DISTNAME)-src
 
+BUILD_DEP_PKGS += CSWapache2-dev
+BUILD_DEP_PKGS += CSWgeoip-dev
+
 # Apache paths
 AP2_ROOT      = $(prefix)/apache2
 AP2_LIBEXEC   = $(DESTDIR)$(AP2_ROOT)/libexec
@@ -27,12 +36,11 @@
 CONFIGURE_ARGS += --libexecdir=$(AP2_ROOT)/libexec
 CONFIGURE_ARGS += --with-apxs=$(AP2_ROOT)/sbin/apxs
 
-BUILD_DEP_PKGS_CSWap2modgeoip2 += CSWapache2-dev
-BUILD_DEP_PKGS_CSWap2modgeoip2 += CSWgeoip-dev
+PACKAGES = CSWap2modgeoip2
 RUNTIME_DEP_PKGS_CSWap2modgeoip2 += CSWapache2
 RUNTIME_DEP_PKGS_CSWap2modgeoip2 += CSWgeolitedb
 RUNTIME_DEP_PKGS_CSWap2modgeoip2 += CSWlibgeoip1
-#PKGFILES_CSWap2modgeoip2 += $(AP2_LIBEXEC)/mod_geoip2.so
+OBSOLETED_BY_CSWap2-mod-geoip += CSWap2modgeoip2
 
 # This dependency should be in place.
 CHECKPKG_OVERRIDES_CSWap2modgeoip2 += surplus-dependency|CSWgeolitedb

Copied: csw/mgar/pkg/mod_geoip/trunk/files/CSWap2-mod-geoip.postinstall (from rev 22420, csw/mgar/pkg/mod_asn/trunk/files/CSWap2-mod-asn.postinstall)
===================================================================
--- csw/mgar/pkg/mod_geoip/trunk/files/CSWap2-mod-geoip.postinstall	                        (rev 0)
+++ csw/mgar/pkg/mod_geoip/trunk/files/CSWap2-mod-geoip.postinstall	2014-02-04 11:36:06 UTC (rev 22942)
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+CSW_PREFIX=${PKG_INSTALL_ROOT}/opt/csw
+AP2_PREFIX=$CSW_PREFIX/apache2
+AP2_BINDIR=$AP2_PREFIX/sbin
+AP2_LIBEXEC=$AP2_PREFIX/libexec
+AP2_CONFDIR=$AP2_PREFIX/etc
+AP2_EXTRADIR=$AP2_CONFDIR/extra
+AP2_CONFIG=$AP2_CONFDIR/httpd.conf
+
+# Enable the geoip module
+PKG_INSTALL_ROOT=${PKG_INSTALL_ROOT:-'/'}
+chroot $PKG_INSTALL_ROOT \
+    $AP2_BINDIR/apxs -S LIBEXECDIR=$AP2_LIBEXEC -e -a -n \
+    geoip mod_geoip.so
+
+# Finito
+cat <<END
+
+NOTICE: mod_geoip is enabled in httpd.conf but the server was not restarted.
+        Please check your configuration and restart apache.
+
+END
+
+exit 0

Copied: csw/mgar/pkg/mod_geoip/trunk/files/CSWap2-mod-geoip.preremove (from rev 22420, csw/mgar/pkg/mod_asn/trunk/files/CSWap2-mod-asn.preremove)
===================================================================
--- csw/mgar/pkg/mod_geoip/trunk/files/CSWap2-mod-geoip.preremove	                        (rev 0)
+++ csw/mgar/pkg/mod_geoip/trunk/files/CSWap2-mod-geoip.preremove	2014-02-04 11:36:06 UTC (rev 22942)
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+CSW_PREFIX=${PKG_INSTALL_ROOT}/opt/csw
+AP2_PREFIX=$CSW_PREFIX/apache2
+AP2_BINDIR=$AP2_PREFIX/sbin
+AP2_LIBEXEC=$AP2_PREFIX/libexec
+AP2_CONFDIR=$AP2_PREFIX/etc
+AP2_EXTRADIR=$AP2_CONFDIR/extra
+AP2_CONFIG=$AP2_CONFDIR/httpd.conf
+
+# Disable the geoip module
+PKG_INSTALL_ROOT=${PKG_INSTALL_ROOT:-'/'}
+chroot $PKG_INSTALL_ROOT \
+    $AP2_BINDIR/apxs -S LIBEXECDIR=$AP2_LIBEXEC -e -A -n \
+    geoip mod_geoip.so
+
+cat <<END
+
+NOTICE: mod_geoip is disabled in httpd.conf but the server was not restarted.
+        Please check your configuration and restart apache.
+
+END
+
+exit 0

Added: csw/mgar/pkg/mod_geoip/trunk/files/httpd-geoip.conf.CSW
===================================================================
--- csw/mgar/pkg/mod_geoip/trunk/files/httpd-geoip.conf.CSW	                        (rev 0)
+++ csw/mgar/pkg/mod_geoip/trunk/files/httpd-geoip.conf.CSW	2014-02-04 11:36:06 UTC (rev 22942)
@@ -0,0 +1,5 @@
+<IfModule mod_geoip.c>
+   GeoIPEnable On
+   GeoIPDBFile /opt/csw/share/GeoIP/GeoIPCity.dat MMapCache
+   GeoIPOutput Env
+</IfModule>

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list