Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Feb 2012 19:12:24 +0900
From:      Takefu <takefu@airport.fm>
To:        freebsd-gnats-submit@FreeBSD.org
Cc:        garga@FreeBSD.org
Subject:   ports/164706: [PATCH] www/sarg: add PHP script install switch
Message-ID:  <4F2A6188.3030304@airport.fm>
Resent-Message-ID: <201202021020.q12AK7q1050652@freefall.freebsd.org>
In-Reply-To: <201202020954.q129shHG052990@localhost.local.ae-osaka.co.jp>
References:  <201202020954.q129shHG052990@localhost.local.ae-osaka.co.jp>

next in thread | previous in thread | raw e-mail | index | archive | help

>Number:         164706
>Category:       ports
>Synopsis:       [PATCH] www/sarg: add PHP script install switch
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 02 10:20:07 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Takefu
>Release:        FreeBSD 8.2-RELEASE-p5 amd64
>Organization:
FOX Amateur Radio Club
>Environment:
>Description:
- add PHP script install switch
- mod ${PREFIX}/etc/${PORTNAME} -> ${ETCDIR}

Port maintainer (garga@FreeBSD.org) is cc'd.

>How-To-Repeat:
>Fix:
--- sarg.patch begins here ---
diff -ruN /usr/ports/www/sarg/Makefile www/sarg/Makefile
--- /usr/ports/www/sarg/Makefile	2012-01-24 11:32:10.000000000 +0900
+++ www/sarg/Makefile	2012-02-02 19:02:49.000000000 +0900
@@ -17,17 +17,17 @@
 LICENSE=	GPLv2
 LICENSE_FILE=	${WRKSRC}/LICENSE

-OPTIONS=	GD "Enable GD support" on
+OPTIONS=	GD "Enable GD support" on\
+		PHP "Install PHP for reporting generating" on

 USE_AUTOTOOLS=	autoconf aclocal
 USE_GMAKE=	yes
 GNU_CONFIGURE=	yes
 MAKE_JOBS_SAFE=	yes
 LDFLAGS+=	-L${LOCALBASE}/lib
-CONFIGURE_ARGS=	--sysconfdir="${PREFIX}/etc/${PORTNAME}" \
-		--enable-sargphp="${PREFIX}/etc/${PORTNAME}" \
-		--enable-fontdir="${PREFIX}/etc/${PORTNAME}/fonts" \
-		--enable-imagedir="${PREFIX}/etc/${PORTNAME}/images"
+CONFIGURE_ARGS=	--sysconfdir="${ETCDIR}" \
+		--enable-fontdir="${ETCDIR}/fonts" \
+		--enable-imagedir="${ETCDIR}/images"

 MAN1=		sarg.1

@@ -46,8 +46,13 @@
 LIB_DEPENDS+=	gd.4:${PORTSDIR}/graphics/gd
 .endif

-pre-install:
-	${STRIP_CMD} ${WRKSRC}/sarg
+.if !defined(WITHOUT_PHP)
+CONFIGURE_ARGS+=	--enable-sargphp="${ETCDIR}"
+PLIST_SUB+=	PHP=""
+.else
+CONFIGURE_ARGS+=	--disable-sargphp
+PLIST_SUB+=	PHP="@comment "
+.endif

 post-extract:
 	@${FIND} ${WRKSRC} -type d -exec ${CHMOD} 0755 {} \;
diff -ruN /usr/ports/www/sarg/files/patch-Makefile.in www/sarg/files/patch-Makefile.in
--- /usr/ports/www/sarg/files/patch-Makefile.in	2011-12-30 10:49:26.000000000 +0900
+++ www/sarg/files/patch-Makefile.in	2012-02-02 18:06:14.000000000 +0900
@@ -1,11 +1,25 @@
---- Makefile.in.orig	2011-06-19 16:12:39.000000000 -0300
-+++ Makefile.in	2011-12-28 10:50:42.000000000 -0200
-@@ -93,12 +93,11 @@
+--- Makefile.in.orig	2011-06-20 04:12:39.000000000 +0900
++++ Makefile.in	2012-02-02 18:04:28.000000000 +0900
+@@ -27,9 +27,9 @@
+ LIBS        = @LIBS@ -lm
+ SRCDIR      = .
+ VPATH       = .
+-INSTALL     = cp
++INSTALL     = @INSTALL@ -m 644 -S
+
+-INSTALL_PROGRAM = $(INSTALL)
++INSTALL_PROGRAM = @INSTALL@ -m 755 -S -s
+
+ SRCS = util.c log.c report.c topuser.c email.c sort.c html.c \
+        index.c getconf.c usage.c decomp.c ip2name.c \
+@@ -91,14 +91,11 @@
+ 		mkdir -p $(DESTDIR)$(IMAGEDIR); \
+ 	fi
  	$(INSTALL_PROGRAM) sarg $(DESTDIR)$(bindir)/sarg
- 	chmod 755 $(DESTDIR)$(bindir)/sarg
- 	$(INSTALL_PROGRAM) sarg.1 $(DESTDIR)$(man1dir)/sarg.1
+-	chmod 755 $(DESTDIR)$(bindir)/sarg
+-	$(INSTALL_PROGRAM) sarg.1 $(DESTDIR)$(man1dir)/sarg.1
 -	chmod 755 $(DESTDIR)$(man1dir)/sarg.1
-+	chmod 644 $(DESTDIR)$(man1dir)/sarg.1
++	$(INSTALL) sarg.1 $(DESTDIR)$(man1dir)/sarg.1
 +	cp sarg.conf $(DESTDIR)$(sysconfdir)/sarg.conf.default
  	@if test ! -f $(DESTDIR)$(sysconfdir)/sarg.conf; then \
  		echo "cp $(DESTDIR)$(sysconfdir)/sarg.conf"; \
diff -ruN /usr/ports/www/sarg/pkg-plist www/sarg/pkg-plist
--- /usr/ports/www/sarg/pkg-plist	2011-12-30 10:49:26.000000000 +0900
+++ www/sarg/pkg-plist	2012-02-02 17:06:11.000000000 +0900
@@ -12,24 +12,24 @@
 etc/sarg/images/graph.png
 etc/sarg/images/sarg-squidguard-block.png
 etc/sarg/images/sarg.png
-etc/sarg/sarg-php/COPYING
-etc/sarg/sarg-php/INSTALL
-etc/sarg/sarg-php/LANGUAGES
-etc/sarg/sarg-php/language.php
-etc/sarg/sarg-php/locale/en_EN/LC_MESSAGES/messages.mo
-etc/sarg/sarg-php/locale/en_EN/LC_MESSAGES/messages.po
-etc/sarg/sarg-php/locale/fr/LC_MESSAGES/messages.mo
-etc/sarg/sarg-php/locale/fr/LC_MESSAGES/messages.po
-etc/sarg/sarg-php/locale/pt_BR/LC_MESSAGES/messages.mo
-etc/sarg/sarg-php/locale/pt_BR/LC_MESSAGES/messages.po
-etc/sarg/sarg-php/locale/ru/LC_MESSAGES/messages.mo
-etc/sarg/sarg-php/locale/ru/LC_MESSAGES/messages.po
-etc/sarg/sarg-php/sarg-block-it.php
-etc/sarg/sarg-php/sarg-realtime.php
-etc/sarg/sarg-php/sarg-squidguard-block.php
-etc/sarg/sarg-php/sarg-squidguard-block2.php
-etc/sarg/sarg-php/style.php
-etc/sarg/sarg-php/translate.this
+%%PHP%%etc/sarg/sarg-php/COPYING
+%%PHP%%etc/sarg/sarg-php/INSTALL
+%%PHP%%etc/sarg/sarg-php/LANGUAGES
+%%PHP%%etc/sarg/sarg-php/language.php
+%%PHP%%etc/sarg/sarg-php/locale/en_EN/LC_MESSAGES/messages.mo
+%%PHP%%etc/sarg/sarg-php/locale/en_EN/LC_MESSAGES/messages.po
+%%PHP%%etc/sarg/sarg-php/locale/fr/LC_MESSAGES/messages.mo
+%%PHP%%etc/sarg/sarg-php/locale/fr/LC_MESSAGES/messages.po
+%%PHP%%etc/sarg/sarg-php/locale/pt_BR/LC_MESSAGES/messages.mo
+%%PHP%%etc/sarg/sarg-php/locale/pt_BR/LC_MESSAGES/messages.po
+%%PHP%%etc/sarg/sarg-php/locale/ru/LC_MESSAGES/messages.mo
+%%PHP%%etc/sarg/sarg-php/locale/ru/LC_MESSAGES/messages.po
+%%PHP%%etc/sarg/sarg-php/sarg-block-it.php
+%%PHP%%etc/sarg/sarg-php/sarg-realtime.php
+%%PHP%%etc/sarg/sarg-php/sarg-squidguard-block.php
+%%PHP%%etc/sarg/sarg-php/sarg-squidguard-block2.php
+%%PHP%%etc/sarg/sarg-php/style.php
+%%PHP%%etc/sarg/sarg-php/translate.this
 etc/sarg/user_limit_block
 %%NLS%%share/locale/bg/LC_MESSAGES/sarg.mo
 %%NLS%%share/locale/ca/LC_MESSAGES/sarg.mo
@@ -55,16 +55,16 @@
 %%NLS%%share/locale/tr/LC_MESSAGES/sarg.mo
 %%NLS%%share/locale/uk/LC_MESSAGES/sarg.mo
 %%NLS%%share/locale/zh_CN/LC_MESSAGES/sarg.mo
-@dirrm etc/sarg/sarg-php/locale/ru/LC_MESSAGES
-@dirrm etc/sarg/sarg-php/locale/ru
-@dirrm etc/sarg/sarg-php/locale/pt_BR/LC_MESSAGES
-@dirrm etc/sarg/sarg-php/locale/pt_BR
-@dirrm etc/sarg/sarg-php/locale/fr/LC_MESSAGES
-@dirrm etc/sarg/sarg-php/locale/fr
-@dirrm etc/sarg/sarg-php/locale/en_EN/LC_MESSAGES
-@dirrm etc/sarg/sarg-php/locale/en_EN
-@dirrm etc/sarg/sarg-php/locale
-@dirrm etc/sarg/sarg-php
+%%PHP%%@dirrm etc/sarg/sarg-php/locale/ru/LC_MESSAGES
+%%PHP%%@dirrm etc/sarg/sarg-php/locale/ru
+%%PHP%%@dirrm etc/sarg/sarg-php/locale/pt_BR/LC_MESSAGES
+%%PHP%%@dirrm etc/sarg/sarg-php/locale/pt_BR
+%%PHP%%@dirrm etc/sarg/sarg-php/locale/fr/LC_MESSAGES
+%%PHP%%@dirrm etc/sarg/sarg-php/locale/fr
+%%PHP%%@dirrm etc/sarg/sarg-php/locale/en_EN/LC_MESSAGES
+%%PHP%%@dirrm etc/sarg/sarg-php/locale/en_EN
+%%PHP%%@dirrm etc/sarg/sarg-php/locale
+%%PHP%%@dirrm etc/sarg/sarg-php
 @dirrm etc/sarg/images
 @dirrm etc/sarg/fonts
 @dirrmtry etc/sarg
--- sarg.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F2A6188.3030304>