rpms/lighttpd/devel lighttpd-empty.png, NONE, 1.1 lighttpd-mod_geoip.txt, 1.1, 1.2 lighttpd.spec, 1.51, 1.52

Matthias Saou thias at fedoraproject.org
Wed Dec 24 17:53:19 UTC 2008


Author: thias

Update of /cvs/extras/rpms/lighttpd/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv30798

Modified Files:
	lighttpd-mod_geoip.txt lighttpd.spec 
Added Files:
	lighttpd-empty.png 
Log Message:
Split out spawn-fcgi, merge back changes from EL branches.



Index: lighttpd-mod_geoip.txt
===================================================================
RCS file: /cvs/extras/rpms/lighttpd/devel/lighttpd-mod_geoip.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- lighttpd-mod_geoip.txt	22 Oct 2007 12:13:49 -0000	1.1
+++ lighttpd-mod_geoip.txt	24 Dec 2008 17:52:48 -0000	1.2
@@ -1,174 +1,174 @@
-==============================
-ip based geographic lookups...
-==============================
-
------------------
-Module: mod_geoip
------------------
-
-
-
-.. contents:: Table of Contents
-
-Requirements
-============
-
-:Packages: GeoIP C API & Library (http://www.maxmind.com/download/geoip/api/c/)
-
-
-
-
-Overview
-============
-
-mod_geoip is a module for fast ip/location lookups. It uses MaxMind GeoIP / GeoCity databases.
-If the ip was found in the database the module sets the appropriate environments variables to the request, thus making other modules/fcgi be informed.
-
-.. note:: 
-
-  Currently only country/city databases are supported because they have a free version that i can test. 
-
-(http://www.maxmind.com/download/geoip/database/ - GeoIP.dat.gz for Countries, GeoLiteCity.dat.gz for Countries & Cities)
-
-
-Installation
-============
-
-NOTE: As of 1.4.14 the lighttpd distribution does not include the compile file required to perform a automake in the source directory. Use "automake -a" instead. 
-
-1) Download mod_geoip.c (http://trac.lighttpd.net/trac/attachment/wiki/Docs/ModGeoip/mod_geoip.c)
-   - (for lighttpd 1.5 use http://trac.lighttpd.net/trac/attachment/wiki/Docs/ModGeoip/mod_geoip.4.c and rename it to mod_geoip.c)
-2) Copy mod_geoip.c into lighttpd src directory.
-3) Edit your src/Makefile.am and add this after the last module: 
-
-::
-
-        lib_LTLIBRARIES += mod_geoip.la
-        mod_geoip_la_SOURCES = mod_geoip.c
-        mod_geoip_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
-        mod_geoip_la_LIBADD = $(common_libadd) -lGeoIP
-
-4) Go back to lighttpd root directory and first do: aclocal && automake -a && autoconf, after that do: make clean; ./configure --enable-maintainer-mode; make; make install
-   Note: the command of 'make clean' gives error on Fedora 4 and may not be necessary to compile properly. [j lightstone//GlobalAdSales.company]
-
-5) Make sure /usr/local/lib is in your ld.so.conf file and rebuld the ld database (using: ldconfig). 
-
-6) Add to the config file    server.modules  = ("mod_geoip")        [j lightstone//GlobalAdSales.company]
-
-Configuration Options
-========================
-
-NOTE: in lighttpd 1.5.x add the config vars only to the global config - adding into a vhost crashes lighty!
-
-mod_geoip uses two configuration options.
-
-1) geoip.db-filename = <path to the geoip or geocity database>
-2) geoip.memory-cache = <enable|disable> : default disabled
-
-if enabled, mod_geoip will load the database binary file to
-memory for very fast lookups. the only penalty is memory usage.
-
-.. note:: 
-
- mod_geoip will determine the database type automatically so if you enter GeoCity databse path it will load GeoCity Env.
-
-Environment
-===========
-
-Every database sets it's own ENV:
-
-GeoIP (Country):
-----------------
-
-::
-
- GEOIP_COUNTRY_CODE
- GEOIP_COUNTRY_CODE3
- GEOIP_COUNTRY_NAME
-
-GeoCity:
---------
-
-::
-
- GEOIP_COUNTRY_CODE
- GEOIP_COUNTRY_CODE3
- GEOIP_COUNTRY_NAME
- GEOIP_CITY_NAME
- GEOIP_CITY_POSTAL_CODE
- GEOIP_CITY_LATITUDE
- GEOIP_CITY_LONG_LATITUDE
- GEOIP_CITY_DMA_CODE
- GEOIP_CITY_AREA_CODE
-
-Examples
-========
-
-mod_geoip + php
----------------
-
-NOTE: in lighttpd 1.5.x add the config vars only to the global config - adding into a vhost crashes lighty!
-
-when using fastcgi (not only php) you can access mod_geoip env and do as you please. this example just prints all mod_geoip envs to the client, html.
-
-Config-file ::
-
- geoip.db-filename = "/your-geoip-db-path/GeoLiteCity.dat"
- geoip.memory-cache = "enable"
-
-index.php ::
-
- <?php
-         $country_code = $_SERVER['GEOIP_COUNTRY_CODE'];
-         $country_code3 = $_SERVER['GEOIP_COUNTRY_CODE3'];
-         $country_name = $_SERVER['GEOIP_COUNTRY_NAME'];
-
-         $city_region = $_SERVER['GEOIP_CITY_REGION'];
-         $city_name = $_SERVER['GEOIP_CITY_NAME'];
-         $city_postal_code = $_SERVER['GEOIP_CITY_POSTAL_CODE'];
-         $city_latitude = $_SERVER['GEOIP_CITY_LATITUDE'];
-         $city_long_latitude = $_SERVER['GEOIP_CITY_LONG_LATITUDE'];
-         $city_dma_code = $_SERVER['GEOIP_CITY_DMA_CODE'];
-         $city_area_code = $_SERVER['GEOIP_CITY_AREA_CODE'];
-
-         echo "<html>\n<body>\n\t<br>\n";
-         echo 'Country Code: ' . $country_code . '<br>';
-         echo 'Country Code 3: ' . $country_code3 . '<br>';
-         echo 'Country Name: ' . $country_name . '<br>';
-         echo '<br>';
-         echo 'City Region: ' . $city_region . '<br>';
-         echo 'City Name: ' . $city_name . '<br>';
-         echo 'City Postal Code: ' . $city_postal_code . '<br>';
-         echo 'City Latitude: ' . $city_latitude . '<br>';
-         echo 'City Long Latitude: ' . $city_long_latitude . '<br>';
-         echo 'City DMA Code: ' . $city_dma_code . '<br>';
-         echo 'City Area Code: ' . $city_area_code . '<br>';
-         echo "</body>\n</html>";
- ?>
-
-country based redirect
-----------------------
-
-Config-file ::
-
- $HTTP["host"] =~ "www.domain.com" {
-     url.rewrite = ( "" => "/redirect.php")
- }
-
-redirect.php ::
-
- <?php
-        $country_code = $_SERVER['GEOIP_COUNTRY_CODE'];
-        header ('Location: http://' . $country_code . '.domain.com/');
- ?>
-
-.. note::
-
- Currently it is not possible to redirect based on mod_geoip directly in lighttpd config file. But i believe with the     relase of lighttpd mod_magnet it would be. (mod_magnet will be available in lighttpd 1.4.12+)
-
-Downloads
-=========
-mod_geoip.c (http://trac.lighttpd.net/trac/attachment/wiki/Docs/ModGeoip/mod_geoip.c)
-
-mod_geoip.c for lighttpd 1.5.x (http://trac.lighttpd.net/trac/attachment/wiki/Docs/ModGeoip/mod_geoip.4.c)
+==============================
+ip based geographic lookups...
+==============================
+
+-----------------
+Module: mod_geoip
+-----------------
+
+
+
+.. contents:: Table of Contents
+
+Requirements
+============
+
+:Packages: GeoIP C API & Library (http://www.maxmind.com/download/geoip/api/c/)
+
+
+
+
+Overview
+============
+
+mod_geoip is a module for fast ip/location lookups. It uses MaxMind GeoIP / GeoCity databases.
+If the ip was found in the database the module sets the appropriate environments variables to the request, thus making other modules/fcgi be informed.
+
+.. note:: 
+
+  Currently only country/city databases are supported because they have a free version that i can test. 
+
+(http://www.maxmind.com/download/geoip/database/ - GeoIP.dat.gz for Countries, GeoLiteCity.dat.gz for Countries & Cities)
+
+
+Installation
+============
+
+NOTE: As of 1.4.14 the lighttpd distribution does not include the compile file required to perform a automake in the source directory. Use "automake -a" instead. 
+
+1) Download mod_geoip.c (http://trac.lighttpd.net/trac/attachment/wiki/Docs/ModGeoip/mod_geoip.c)
+   - (for lighttpd 1.5 use http://trac.lighttpd.net/trac/attachment/wiki/Docs/ModGeoip/mod_geoip.4.c and rename it to mod_geoip.c)
+2) Copy mod_geoip.c into lighttpd src directory.
+3) Edit your src/Makefile.am and add this after the last module: 
+
+::
+
+        lib_LTLIBRARIES += mod_geoip.la
+        mod_geoip_la_SOURCES = mod_geoip.c
+        mod_geoip_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
+        mod_geoip_la_LIBADD = $(common_libadd) -lGeoIP
+
+4) Go back to lighttpd root directory and first do: aclocal && automake -a && autoconf, after that do: make clean; ./configure --enable-maintainer-mode; make; make install
+   Note: the command of 'make clean' gives error on Fedora 4 and may not be necessary to compile properly. [j lightstone//GlobalAdSales.company]
+
+5) Make sure /usr/local/lib is in your ld.so.conf file and rebuld the ld database (using: ldconfig). 
+
+6) Add to the config file    server.modules  = ("mod_geoip")        [j lightstone//GlobalAdSales.company]
+
+Configuration Options
+========================
+
+NOTE: in lighttpd 1.5.x add the config vars only to the global config - adding into a vhost crashes lighty!
+
+mod_geoip uses two configuration options.
+
+1) geoip.db-filename = <path to the geoip or geocity database>
+2) geoip.memory-cache = <enable|disable> : default disabled
+
+if enabled, mod_geoip will load the database binary file to
+memory for very fast lookups. the only penalty is memory usage.
+
+.. note:: 
+
+ mod_geoip will determine the database type automatically so if you enter GeoCity databse path it will load GeoCity Env.
+
+Environment
+===========
+
+Every database sets it's own ENV:
+
+GeoIP (Country):
+----------------
+
+::
+
+ GEOIP_COUNTRY_CODE
+ GEOIP_COUNTRY_CODE3
+ GEOIP_COUNTRY_NAME
+
+GeoCity:
+--------
+
+::
+
+ GEOIP_COUNTRY_CODE
+ GEOIP_COUNTRY_CODE3
+ GEOIP_COUNTRY_NAME
+ GEOIP_CITY_NAME
+ GEOIP_CITY_POSTAL_CODE
+ GEOIP_CITY_LATITUDE
+ GEOIP_CITY_LONG_LATITUDE
+ GEOIP_CITY_DMA_CODE
+ GEOIP_CITY_AREA_CODE
+
+Examples
+========
+
+mod_geoip + php
+---------------
+
+NOTE: in lighttpd 1.5.x add the config vars only to the global config - adding into a vhost crashes lighty!
+
+when using fastcgi (not only php) you can access mod_geoip env and do as you please. this example just prints all mod_geoip envs to the client, html.
+
+Config-file ::
+
+ geoip.db-filename = "/your-geoip-db-path/GeoLiteCity.dat"
+ geoip.memory-cache = "enable"
+
+index.php ::
+
+ <?php
+         $country_code = $_SERVER['GEOIP_COUNTRY_CODE'];
+         $country_code3 = $_SERVER['GEOIP_COUNTRY_CODE3'];
+         $country_name = $_SERVER['GEOIP_COUNTRY_NAME'];
+
+         $city_region = $_SERVER['GEOIP_CITY_REGION'];
+         $city_name = $_SERVER['GEOIP_CITY_NAME'];
+         $city_postal_code = $_SERVER['GEOIP_CITY_POSTAL_CODE'];
+         $city_latitude = $_SERVER['GEOIP_CITY_LATITUDE'];
+         $city_long_latitude = $_SERVER['GEOIP_CITY_LONG_LATITUDE'];
+         $city_dma_code = $_SERVER['GEOIP_CITY_DMA_CODE'];
+         $city_area_code = $_SERVER['GEOIP_CITY_AREA_CODE'];
+
+         echo "<html>\n<body>\n\t<br>\n";
+         echo 'Country Code: ' . $country_code . '<br>';
+         echo 'Country Code 3: ' . $country_code3 . '<br>';
+         echo 'Country Name: ' . $country_name . '<br>';
+         echo '<br>';
+         echo 'City Region: ' . $city_region . '<br>';
+         echo 'City Name: ' . $city_name . '<br>';
+         echo 'City Postal Code: ' . $city_postal_code . '<br>';
+         echo 'City Latitude: ' . $city_latitude . '<br>';
+         echo 'City Long Latitude: ' . $city_long_latitude . '<br>';
+         echo 'City DMA Code: ' . $city_dma_code . '<br>';
+         echo 'City Area Code: ' . $city_area_code . '<br>';
+         echo "</body>\n</html>";
+ ?>
+
+country based redirect
+----------------------
+
+Config-file ::
+
+ $HTTP["host"] =~ "www.domain.com" {
+     url.rewrite = ( "" => "/redirect.php")
+ }
+
+redirect.php ::
+
+ <?php
+        $country_code = $_SERVER['GEOIP_COUNTRY_CODE'];
+        header ('Location: http://' . $country_code . '.domain.com/');
+ ?>
+
+.. note::
+
+ Currently it is not possible to redirect based on mod_geoip directly in lighttpd config file. But i believe with the     relase of lighttpd mod_magnet it would be. (mod_magnet will be available in lighttpd 1.4.12+)
+
+Downloads
+=========
+mod_geoip.c (http://trac.lighttpd.net/trac/attachment/wiki/Docs/ModGeoip/mod_geoip.c)
+
+mod_geoip.c for lighttpd 1.5.x (http://trac.lighttpd.net/trac/attachment/wiki/Docs/ModGeoip/mod_geoip.4.c)
 


Index: lighttpd.spec
===================================================================
RCS file: /cvs/extras/rpms/lighttpd/devel/lighttpd.spec,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- lighttpd.spec	24 Dec 2008 16:45:39 -0000	1.51
+++ lighttpd.spec	24 Dec 2008 17:52:48 -0000	1.52
@@ -1,9 +1,12 @@
 %define webroot /var/www/lighttpd
 
+# LUA support requires >= 5.1 but EPEL4 provides only 5.0, so disable
+%{?el4: %define _without_lua 1}
+
 Summary: Lightning fast webserver with light system requirements
 Name: lighttpd
 Version: 1.4.20
-Release: 4%{?dist}
+Release: 6%{?dist}
 License: BSD
 Group: System Environment/Daemons
 URL: http://www.lighttpd.net/
@@ -14,13 +17,17 @@
 Source11: http://www.lighttpd.net/favicon.ico
 Source12: http://www.lighttpd.net/light_button.png
 Source13: http://www.lighttpd.net/light_logo.png
+Source14: lighttpd-empty.png
 Source100: lighttpd-mod_geoip.c
 Source101: lighttpd-mod_geoip.txt
 Patch0: lighttpd-1.4.20-defaultconf.patch
 Patch1: lighttpd-1.4.18-mod_geoip.patch
 Patch2: lighttpd-1.4.20-initinfo.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+# For the target poweredby.png image (skip requirement + provide image on RHEL)
+%if 0%{!?rhel:1}
 Requires: system-logos >= 7.92.1
+%endif
 Requires(pre): /usr/sbin/useradd
 Requires(post): /sbin/chkconfig
 Requires(preun): /sbin/service, /sbin/chkconfig
@@ -36,7 +43,7 @@
 %if %{!?fedora:0}%{?fedora} <= 6
 BuildRequires: readline-devel
 %endif
-%if 0%{?el} <= 6
+%if 0%{?rhel} <= 6
 BuildRequires: readline-devel
 %endif
 
@@ -57,6 +64,8 @@
 Summary: FastCGI module and spawning helper for lighttpd and PHP configuration
 Group: System Environment/Daemons
 Requires: %{name} = %{version}-%{release}
+# Not really a requirement, but it used to be included (until 1.4.20-5)
+Requires: spawn-fcgi
 
 %description fastcgi
 This package contains the spawn-fcgi helper for lighttpd's automatic spawning
@@ -84,10 +93,20 @@
 Virtual host module for lighttpd that uses a MySQL database.
 
 
+%package -n spawn-fcgi
+Summary: Simple program for spawning FastCGI processes
+Group: System Environment/Daemons
+
+%description -n spawn-fcgi
+This package contains the spawn-fcgi program used for spawning FastCGI
+processes, which can be local or remote.
+
+
 %prep
 %setup -q
 %patch0 -p1 -b .defaultconf
 %patch1 -p1 -b .mod_geoip
+%patch2 -p1 -b .initinfo
 %{__install} -p -m 0644 %{SOURCE100} src/mod_geoip.c
 %{__install} -p -m 0644 %{SOURCE101} mod_geoip.txt
 
@@ -135,8 +154,12 @@
 %{__install} -p -m 0644 %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \
     %{buildroot}%{webroot}/
 
-# Symlink for the powered-by-$DISTRO image
+# Symlink for the powered-by-$DISTRO image (install empty image on RHEL)
+%if 0%{!?rhel:1}
 %{__ln_s} %{_datadir}/pixmaps/poweredby.png \
+%else
+%{__install} -p -m 0644 %{SOURCE14} \
+%endif
     %{buildroot}%{webroot}/poweredby.png
 
 # Install empty log directory to include
@@ -145,14 +168,6 @@
 # Install empty run directory to include (for the example fastcgi socket)
 %{__mkdir_p} %{buildroot}%{_var}/run/lighttpd
 
-# Rename spawn-fastcgi, prefix to avoid clash with other packages
-%{__mv} %{buildroot}%{_bindir}/spawn-fcgi \
-        %{buildroot}%{_bindir}/lighttpd-spawn-fcgi
-%{__mv} %{buildroot}%{_mandir}/man1/spawn-fcgi.1 \
-        %{buildroot}%{_mandir}/man1/lighttpd-spawn-fcgi.1
-# But still provide a compatibility symlink for now
-%{__ln_s} lighttpd-spawn-fcgi %{buildroot}%{_bindir}/spawn-fcgi
-
 
 %clean
 %{__rm} -rf %{buildroot}
@@ -207,11 +222,8 @@
 %defattr(-,root,root,-)
 %doc doc/fastcgi*.txt
 %config(noreplace) %{_sysconfdir}/php.d/lighttpd.ini
-%{_bindir}/lighttpd-spawn-fcgi
-%{_bindir}/spawn-fcgi
 %dir %{_libdir}/lighttpd/
 %{_libdir}/lighttpd/mod_fastcgi.so
-%{_mandir}/man1/lighttpd-spawn-fcgi.1*
 
 %files mod_geoip
 %defattr(-,root,root,-)
@@ -225,11 +237,17 @@
 %dir %{_libdir}/lighttpd/
 %{_libdir}/lighttpd/mod_mysql_vhost.so
 
+%files -n spawn-fcgi
+%{_bindir}/spawn-fcgi
+%{_mandir}/man1/spawn-fcgi.1*
 
 %changelog
-* Wed Dec 24 2008 Matthias Saou <http://freshrpms.net/> 1.4.20-4
+* Wed Dec 24 2008 Matthias Saou <http://freshrpms.net/> 1.4.20-6
 - Partially revert last change by creating a "spawn-fastcgi" symlink, so that
   nothing breaks currently (especially for EL).
+- Install empty poweredby image on RHEL since the symlink's target is missing.
+- Split spawn-fcgi off in its own sub-package, have fastcgi package require it
+  to provide backwards compatibility.
 
 * Mon Dec 22 2008 Matthias Saou <http://freshrpms.net/> 1.4.20-3
 - Rename spawn-fastcgi to lighttpd-spawn-fastcgi to avoid clash with other




More information about the fedora-extras-commits mailing list