Date: Tue, 11 Aug 2009 13:33:23 +0200 (CEST) From: Piotr Florczyk <p.florczyk@adminworkshop.pl> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/137664: [PATCH] www/lighttpd adds mod_geoip (shar) Message-ID: <20090811113323.6B43C4F1027@wenus.adminworkshop.pl> Resent-Message-ID: <200908111140.n7BBe2if014926@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 137664 >Category: ports >Synopsis: [PATCH] www/lighttpd adds mod_geoip (shar) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Aug 11 11:40:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Piotr Florczyk >Release: FreeBSD 7.2-RELEASE amd64 >Organization: >Environment: System: FreeBSD wenus.adminworkshop.pl 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Tue Jun 2 20:00:14 CEST 2009 root@wenus.adminworkshop.pl:/usr/obj/usr/src/sys/GENERIC amd64 >Description: mod_geoip is not part of main lighttpd source tree. It doesn't work under FreeBSD amd64 without simple patch. I have modified Makefile so it now can fetch mod_geoip (conditionaly) and added 2 patches (for src/Makefile.am and src/mod_geoip.c). I didn't fix pkg-plist (sorry). Files that should be added to pkg-plist conditionaly: lib/lighttpd/mod_geoip.a lib/lighttpd/mod_geoip.la lib/lighttpd/mod_geoip.so Tested on amd64. >How-To-Repeat: >Fix: Run diff against original port and extracted shar to see what has been modified. --- lighttpd.shar begins here --- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # lighttpd/ # lighttpd/files # lighttpd/files/lighttpd.sh.in # lighttpd/files/opt-patch-src:mod_geoip.c # lighttpd/files/opt-patch-src:Makefile.am # lighttpd/Makefile # lighttpd/distinfo # lighttpd/pkg-descr # lighttpd/pkg-plist # echo c - lighttpd/ mkdir -p lighttpd/ > /dev/null 2>&1 echo c - lighttpd/files mkdir -p lighttpd/files > /dev/null 2>&1 echo x - lighttpd/files/lighttpd.sh.in sed 's/^X//' >lighttpd/files/lighttpd.sh.in << 'd018db8c4effa4759c0fbcbcdecae2c1' X#!/bin/sh X# X# $FreeBSD: ports/www/lighttpd/files/lighttpd.sh.in,v 1.5 2008/09/07 14:48:53 mnag Exp $ X# X# PROVIDE: lighttpd X# REQUIRE: %%REQUIRE%% X# KEYWORD: shutdown X# X# Add the following lines to /etc/rc.conf to enable lighttpd: X# X# lighttpd_enable (bool): Set it to "YES" to enable lighttpd X# Default is "NO". X# lighttpd_conf (path): Set full path to config file. X# Default is "%%PREFIX%%/etc/lighttpd.conf". X# lighttpd_pidfile (path): Set full path to pid file. X# Default is "/var/run/lighttpd.pid". X# X X. %%RC_SUBR%% X Xname="lighttpd" Xrcvar=`set_rcvar` X Xload_rc_config $name X X: ${lighttpd_enable="NO"} X: ${lighttpd_conf="%%PREFIX%%/etc/lighttpd.conf"} X: ${lighttpd_pidfile="/var/run/${name}.pid"} X Xcommand=%%PREFIX%%/sbin/lighttpd Xcommand_args="-f ${lighttpd_conf}" Xpidfile=${lighttpd_pidfile} Xrequired_files=${lighttpd_conf} Xstop_postcmd=stop_postcmd Xrestart_precmd="checkconfig" Xreload_precmd=reload_precmd Xreload_postcmd=reload_postcmd Xsig_reload="-INT" Xcheck_cmd="checkconfig" Xextra_commands="reload check" X Xcheckconfig() X{ X echo "Performing sanity check on ${name} configuration:" X eval "${command} ${command_args} -t" X} X Xstop_postcmd() X{ X rm -f ${pidfile} X} X Xreload_precmd() X{ X echo "Stoping ${name} and start gracefully." X} X Xreload_postcmd() X{ X rm -f ${pidfile} X run_rc_command start X} X Xrun_rc_command "$1" d018db8c4effa4759c0fbcbcdecae2c1 echo x - lighttpd/files/opt-patch-src:mod_geoip.c sed 's/^X//' >lighttpd/files/opt-patch-src:mod_geoip.c << '5bbc2866e3e8632f60e8f4222322da09' X--- src/mod_geoip.c-orig 2009-08-10 19:19:18.000000000 +0000 X+++ src/mod_geoip.c 2009-08-10 19:21:20.000000000 +0000 X@@ -225,7 +225,7 @@ X data_string *ds; X const char *returnedCountry; X X- remote_ip = inet_ntop_cache_get_ip(srv, &(con->dst_addr)); X+ remote_ip = con->dst_addr_buf->ptr; X X if (p->conf.gi->databaseType == GEOIP_COUNTRY_EDITION) { X /* get the country code 2 chars */ 5bbc2866e3e8632f60e8f4222322da09 echo x - lighttpd/files/opt-patch-src:Makefile.am sed 's/^X//' >lighttpd/files/opt-patch-src:Makefile.am << 'f4821845d5cfe9bb1c677c02a5806634' X--- src/Makefile.am 2009-08-10 12:05:55.000000000 +0000 X+++ src/Makefile.am 2009-08-10 12:06:36.000000000 +0000 X@@ -264,6 +264,10 @@ X mod_accesslog_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined X mod_accesslog_la_LIBADD = $(common_libadd) X X+lib_LTLIBRARIES += mod_geoip.la X+mod_geoip_la_SOURCES = mod_geoip.c X+mod_geoip_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined X+mod_geoip_la_LIBADD = $(common_libadd) -lGeoIP X X hdr = server.h buffer.h network.h log.h keyvalue.h \ X response.h request.h fastcgi.h chunk.h \ f4821845d5cfe9bb1c677c02a5806634 echo x - lighttpd/Makefile sed 's/^X//' >lighttpd/Makefile << '4355f6684b54846925e0e9501af875dd' X# New ports collection makefile for: lighttpd X# Date created: 20 May 2004 X# Whom: k@123.org X# X# $FreeBSD: ports/www/lighttpd/Makefile,v 1.74 2009/08/02 19:36:01 mezz Exp $ X# X XPORTNAME= lighttpd XPORTVERSION= 1.4.23 XCATEGORIES= www XMASTER_SITES= http://www.lighttpd.net/download/ \ X http://mirrors.cat.pdx.edu/lighttpd/ \ X http://redmine.lighttpd.net/attachments/download/716/:geoip XDISTFILES= ${DISTNAME}${EXTRACT_SUFX} XEXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} X XMAINTAINER= mnag@FreeBSD.org XCOMMENT= A secure, fast, compliant, and very flexible Web Server X XLIB_DEPENDS= pcre.0:${PORTSDIR}/devel/pcre X XDIST_SUBDIR= ${PORTNAME} X XUSE_BZIP2= yes XUSE_AUTOTOOLS= aclocal:110 autoconf:262 autoheader:262 automake:110 libtool:22 XACLOCAL_ARGS= --force XGNU_CONFIGURE= yes XUSE_GNOME= lthack pkgconfig XUSE_RC_SUBR= lighttpd.sh XCONFIGURE_ARGS= --libdir=${PREFIX}/lib/lighttpd X XCFLAGS+= -I${LOCALBASE}/include XLDFLAGS+= -L${LOCALBASE}/lib X XMAN8= lighttpd.8 X XOPTIONS= BZIP2 "Enable Bzip2 support" off \ X CML "Enable Cache Meta Language support" off \ X FAM "Enable fam/gamin support" off \ X GDBM "Enable gdbm storage support" off \ X IPV6 "Enable IPV6 support" on \ X MAGNET "Enable magnet support" off \ X MEMCACHE "Enable memory caching support" off \ X MYSQL "Enable MYSQL support" off \ X OPENLDAP "Enable LDAP support" off \ X OPENSSL "Enable SSL support" on \ X SPAWNFCGI "Enable spawn-fcgi utility" on \ X VALGRIND "Enable valgrind support" off \ X WEBDAV "Enable WebDAV support" off\ X GEOIP "Enable GeoIP support (UNOFFICIAL)" off X X.include <bsd.port.pre.mk> X X# Default REQUIRE to rc.d script X_REQUIRE= DAEMON X X.if !defined(WITHOUT_OPENSSL) X.include "${PORTSDIR}/Mk/bsd.openssl.mk" XCONFIGURE_ARGS+= --with-openssl \ X --with-openssl-includes=${OPENSSLINC} \ X --with-openssl-libs=${OPENSSLLIB} X.endif X X.if defined(WITH_BZIP2) XCONFIGURE_ARGS+= --with-bzip2 X.endif X X.if defined(WITH_CML) XUSE_LUA= yes XCONFIGURE_ARGS+= --with-lua XCONFIGURE_ENV+= LUA_CFLAGS="-I${LUA_INCDIR}" LUA_LIBS="-L${LUA_LIBDIR} -llua" X.endif X X.if defined(WITH_FAM) XUSE_FAM= yes XCONFIGURE_ARGS+= --with-fam XCONFIGURE_ENV+= FAM_CFLAGS="-I${LOCALBASE}/include" FAM_LIBS="-L${LOCALBASE}/lib" X.endif X X.if defined(WITH_GDBM) XLIB_DEPENDS+= gdbm:${PORTSDIR}/databases/gdbm XCONFIGURE_ARGS+= --with-gdbm X.endif X X.if defined(WITHOUT_IPV6) XCONFIGURE_ARGS+= --disable-ipv6 X.endif X X.if defined(WITH_MAGNET) XUSE_LUA= 5.1+ XCONFIGURE_ARGS+= --with-lua XCONFIGURE_ENV+= LUA_CFLAGS="-I${LUA_INCDIR}" LUA_LIBS="-L${LUA_LIBDIR} -llua" X.endif X X.if defined(WITH_MEMCACHE) XLIB_DEPENDS+= memcache.4:${PORTSDIR}/databases/libmemcache XCONFIGURE_ARGS+= --with-memcache X.endif X X.if defined(WITH_MYSQL) XUSE_MYSQL= yes XCONFIGURE_ARGS+= --with-mysql X_REQUIRE+= mysql X.endif X X.if defined(WITH_OPENLDAP) XUSE_OPENLDAP= yes XCONFIGURE_ARGS+= --with-ldap X_REQUIRE+= slapd X.endif X X.if defined(WITH_SPAWNFCGI) XRUN_DEPENDS+= spawn-fcgi:${PORTSDIR}/www/spawn-fcgi X.endif X X.if defined(WITH_VALGRIND) XBUILD_DEPENDS+= valgrind:${PORTSDIR}/devel/valgrind XRUN_DEPENDS+= valgrind:${PORTSDIR}/devel/valgrind XCONFIGURE_ARGS+= --with-valgrind X.endif X X.if defined(WITH_WEBDAV) XUSE_GNOME+= libxml2 XLIB_DEPENDS+= uuid.1:${PORTSDIR}/misc/e2fsprogs-libuuid \ X sqlite3.8:${PORTSDIR}/databases/sqlite3 XCONFIGURE_ARGS+= --with-webdav-props --with-webdav-locks X.endif X X.if defined(WITH_GEOIP) XCONFIGURE_ARGS+= --enable-maintainer-mode XAUTOMAKE_ARGS+= -a XDISTFILES+= mod_geoip_for_1.4.c:geoip XBUILD_DEPENDS+= GeoIP>=1.4.4:${PORTSDIR}/net/GeoIP XRUN_DEPENDS+= GeoIP>=1.4.4:${PORTSDIR}/net/GeoIP XEXTRA_PATCHES+= ${FILESDIR}/opt-patch-src:Makefile.am ${FILESDIR}/opt-patch-src:mod_geoip.c X.endif X XSUB_LIST+= REQUIRE="${_REQUIRE}" X Xpre-patch: X.if defined(WITH_GEOIP) X @${CP} ${DISTDIR}/${DIST_SUBDIR}/mod_geoip_for_1.4.c ${WRKSRC}/src/mod_geoip.c X.endif X Xpost-patch: X @${REINPLACE_CMD} -e 's|-std=gnu99||' ${WRKSRC}/configure ${WRKSRC}/configure.ac X @${REINPLACE_CMD} -E -e 's|(server.document-root.*=).*|\1 "${PREFIX}/www/data/"|' \ X -e 's|(server.errorlog.*=).*|\1 "/var/log/lighttpd.error.log"|' \ X -e 's|# server.event-handler|server.event-handler|' \ X -e 's|(accesslog.filename.*=).*|\1 "/var/log/lighttpd.access.log"|' \ X -e 's|#server.pid-file|server.pid-file|' \ X -e 's|#server.username.*|server.username = "www"|' \ X -e 's|#server.groupname.*|server.groupname = "www"|' \ X -e 's|/usr/local/bin/php|${PREFIX}/bin/php-cgi|' \ X ${WRKSRC}/doc/lighttpd.conf X.if !defined(WITHOUT_IPV6) X @${ECHO} "" >> ${WRKSRC}/doc/lighttpd.conf X @${ECHO} "# Enable IPV6 and IPV4 together" >> ${WRKSRC}/doc/lighttpd.conf X @${ECHO} "server.use-ipv6 = \"enable\"" >> ${WRKSRC}/doc/lighttpd.conf X @${ECHO} "\$$SERVER[\"socket\"] == \"0.0.0.0:80\" { }" >> ${WRKSRC}/doc/lighttpd.conf X.endif X Xpost-install: X @${INSTALL_DATA} ${WRKSRC}/doc/lighttpd.conf ${PREFIX}/etc/lighttpd.conf.sample X.if !exists(${PREFIX}/etc/lighttpd.conf) X @${INSTALL_DATA} ${WRKSRC}/doc/lighttpd.conf ${PREFIX}/etc/lighttpd.conf X.endif X @${LIBTOOL} --finish ${PREFIX}/lib X X.include <bsd.port.post.mk> 4355f6684b54846925e0e9501af875dd echo x - lighttpd/distinfo sed 's/^X//' >lighttpd/distinfo << '6bc339735d3209ac5ad86388bdea1627' XMD5 (lighttpd/lighttpd-1.4.23.tar.bz2) = 0ab6bb7b17bf0f515ce7dce68e5e215a XSHA256 (lighttpd/lighttpd-1.4.23.tar.bz2) = 72896e6677b12aee2371c12e6d3f8299cfbdb2f89ad4b519a96b3ba80852a5fa XSIZE (lighttpd/lighttpd-1.4.23.tar.bz2) = 641621 XMD5 (lighttpd/mod_geoip_for_1.4.c) = a60d4091280b95296c2e5e1a7a8c22d4 XSHA256 (lighttpd/mod_geoip_for_1.4.c) = 0847f26150bc205819666016ecd7085fad51261992f5ed566455d8e997c84c40 XSIZE (lighttpd/mod_geoip_for_1.4.c) = 14193 6bc339735d3209ac5ad86388bdea1627 echo x - lighttpd/pkg-descr sed 's/^X//' >lighttpd/pkg-descr << '33c1b4db5571578e5a90787b6255dad3' Xlighttpd a secure, fast, compliant and very flexible web-server which Xhas been optimized for high-performance environments. It has a very Xlow memory footprint compared to other webservers and takes care of Xcpu-load. Its advanced feature-set (FastCGI, CGI, Auth, Output-Compression, XURL-Rewriting and many more) make lighttpd the perfect webserver-software Xfor every server that is suffering load problems. X XWWW: http://www.lighttpd.net/ 33c1b4db5571578e5a90787b6255dad3 echo x - lighttpd/pkg-plist sed 's/^X//' >lighttpd/pkg-plist << 'bd5a57b2005018213f7ff314a01cab41' X@comment $FreeBSD: ports/www/lighttpd/pkg-plist,v 1.17 2009/04/25 04:17:03 mnag Exp $ X@unexec if cmp -s %D/etc/lighttpd.conf %D/etc/lighttpd.conf.sample; then rm -f %D/etc/lighttpd.conf; fi Xetc/lighttpd.conf.sample X@exec [ -f %B/lighttpd.conf ] || cp %B/%f %B/lighttpd.conf Xlib/lighttpd/mod_access.a Xlib/lighttpd/mod_access.la Xlib/lighttpd/mod_access.so Xlib/lighttpd/mod_accesslog.a Xlib/lighttpd/mod_accesslog.la Xlib/lighttpd/mod_accesslog.so Xlib/lighttpd/mod_alias.a Xlib/lighttpd/mod_alias.la Xlib/lighttpd/mod_alias.so Xlib/lighttpd/mod_auth.a Xlib/lighttpd/mod_auth.la Xlib/lighttpd/mod_auth.so Xlib/lighttpd/mod_cgi.a Xlib/lighttpd/mod_cgi.la Xlib/lighttpd/mod_cgi.so Xlib/lighttpd/mod_cml.a Xlib/lighttpd/mod_cml.la Xlib/lighttpd/mod_cml.so Xlib/lighttpd/mod_compress.a Xlib/lighttpd/mod_compress.la Xlib/lighttpd/mod_compress.so Xlib/lighttpd/mod_dirlisting.a Xlib/lighttpd/mod_dirlisting.la Xlib/lighttpd/mod_dirlisting.so Xlib/lighttpd/mod_evasive.a Xlib/lighttpd/mod_evasive.la Xlib/lighttpd/mod_evasive.so Xlib/lighttpd/mod_evhost.a Xlib/lighttpd/mod_evhost.la Xlib/lighttpd/mod_evhost.so Xlib/lighttpd/mod_expire.a Xlib/lighttpd/mod_expire.la Xlib/lighttpd/mod_expire.so Xlib/lighttpd/mod_extforward.a Xlib/lighttpd/mod_extforward.la Xlib/lighttpd/mod_extforward.so Xlib/lighttpd/mod_fastcgi.a Xlib/lighttpd/mod_fastcgi.la Xlib/lighttpd/mod_fastcgi.so Xlib/lighttpd/mod_flv_streaming.a Xlib/lighttpd/mod_flv_streaming.la Xlib/lighttpd/mod_flv_streaming.so Xlib/lighttpd/mod_indexfile.a Xlib/lighttpd/mod_indexfile.la Xlib/lighttpd/mod_indexfile.so Xlib/lighttpd/mod_magnet.a Xlib/lighttpd/mod_magnet.la Xlib/lighttpd/mod_magnet.so Xlib/lighttpd/mod_mysql_vhost.a Xlib/lighttpd/mod_mysql_vhost.la Xlib/lighttpd/mod_mysql_vhost.so Xlib/lighttpd/mod_proxy.a Xlib/lighttpd/mod_proxy.la Xlib/lighttpd/mod_proxy.so Xlib/lighttpd/mod_redirect.a Xlib/lighttpd/mod_redirect.la Xlib/lighttpd/mod_redirect.so Xlib/lighttpd/mod_rewrite.a Xlib/lighttpd/mod_rewrite.la Xlib/lighttpd/mod_rewrite.so Xlib/lighttpd/mod_rrdtool.a Xlib/lighttpd/mod_rrdtool.la Xlib/lighttpd/mod_rrdtool.so Xlib/lighttpd/mod_scgi.a Xlib/lighttpd/mod_scgi.la Xlib/lighttpd/mod_scgi.so Xlib/lighttpd/mod_secdownload.a Xlib/lighttpd/mod_secdownload.la Xlib/lighttpd/mod_secdownload.so Xlib/lighttpd/mod_setenv.a Xlib/lighttpd/mod_setenv.la Xlib/lighttpd/mod_setenv.so Xlib/lighttpd/mod_simple_vhost.a Xlib/lighttpd/mod_simple_vhost.la Xlib/lighttpd/mod_simple_vhost.so Xlib/lighttpd/mod_ssi.a Xlib/lighttpd/mod_ssi.la Xlib/lighttpd/mod_ssi.so Xlib/lighttpd/mod_staticfile.a Xlib/lighttpd/mod_staticfile.la Xlib/lighttpd/mod_staticfile.so Xlib/lighttpd/mod_status.a Xlib/lighttpd/mod_status.la Xlib/lighttpd/mod_status.so Xlib/lighttpd/mod_trigger_b4_dl.a Xlib/lighttpd/mod_trigger_b4_dl.la Xlib/lighttpd/mod_trigger_b4_dl.so Xlib/lighttpd/mod_userdir.a Xlib/lighttpd/mod_userdir.la Xlib/lighttpd/mod_userdir.so Xlib/lighttpd/mod_usertrack.a Xlib/lighttpd/mod_usertrack.la Xlib/lighttpd/mod_usertrack.so Xlib/lighttpd/mod_webdav.a Xlib/lighttpd/mod_webdav.la Xlib/lighttpd/mod_webdav.so Xsbin/lighttpd Xsbin/lighttpd-angel X@dirrm lib/lighttpd bd5a57b2005018213f7ff314a01cab41 exit --- lighttpd.shar ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090811113323.6B43C4F1027>