Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jun 2014 16:46:31 +0000 (UTC)
From:      "Vanilla I. Shu" <vanilla@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r357509 - in head/www/pglogd: . files
Message-ID:  <201406111646.s5BGkVdk076347@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vanilla
Date: Wed Jun 11 16:46:31 2014
New Revision: 357509
URL: http://svnweb.freebsd.org/changeset/ports/357509
QAT: https://qat.redports.org/buildarchive/r357509/

Log:
  1: Stagify.
  2: switch to USE_RC_SUBR.
  3: add pkg-message to SUB_FILES.

Added:
  head/www/pglogd/files/020.pglogd.sh.in   (contents, props changed)
  head/www/pglogd/files/pkg-message.in   (contents, props changed)
Deleted:
  head/www/pglogd/files/020.pglogd.sh
  head/www/pglogd/pkg-message
Modified:
  head/www/pglogd/Makefile
  head/www/pglogd/files/patch-Makefile
  head/www/pglogd/pkg-plist

Modified: head/www/pglogd/Makefile
==============================================================================
--- head/www/pglogd/Makefile	Wed Jun 11 16:43:17 2014	(r357508)
+++ head/www/pglogd/Makefile	Wed Jun 11 16:46:31 2014	(r357509)
@@ -11,18 +11,7 @@ MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Sends web server log entries to a PostgreSQL database
 
 USE_PGSQL=	yes
-
-NO_STAGE=	yes
-post-extract:
-	@${CP} ${FILESDIR}/020.pglogd.sh ${WRKSRC}/020.pglogd.sh
-	@${REINPLACE_CMD} -e "s=%%PREFIX%%=${PREFIX}=g" ${WRKSRC}/020.pglogd.sh
-
-post-install:
-	${INSTALL_DATA} ${WRKSRC}/020.pglogd.sh ${PREFIX}/etc/rc.d/020.pglogd.sh
-	@if [ ! -f ${PREFIX}/etc/rc.d/020.pglogd.sh ]; then \
-		${ECHO} "Installing ${PREFIX}/etc/rc.d/020.pglogd.sh startup file."; \
-		${INSTALL_SCRIPT} ${WRKSRC}/020.pglogd.sh ${PREFIX}/etc/rc.d/020.pglogd.sh; \
-	fi
-	@${CAT} ${PKGMESSAGE}
+USE_RC_SUBR= 	020.pglogd.sh
+SUB_FILES=	pkg-message
 
 .include <bsd.port.mk>

Added: head/www/pglogd/files/020.pglogd.sh.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/pglogd/files/020.pglogd.sh.in	Wed Jun 11 16:46:31 2014	(r357509)
@@ -0,0 +1,17 @@
+#!/bin/sh
+CONFIG=%%PREFIX%%/etc/pglogd.conf
+PID=/var/run/pglogd.pid
+
+case "$1" in
+start)
+	[ -r ${CONFIG} ] && [ -x %%PREFIX%%/bin/pglogd ] && %%PREFIX%%/bin/pglogd -s -c ${CONFIG}  > /dev/null && echo -n ' pglogd'
+	;;
+stop)
+	[ -r ${PID} ] && kill `cat ${PID}` > /dev/null && echo -n ' pglogd'
+	;;
+*)
+	echo "Usage: `basename $0` {start|stop}" >&2
+	;;
+esac
+
+exit 0

Modified: head/www/pglogd/files/patch-Makefile
==============================================================================
--- head/www/pglogd/files/patch-Makefile	Wed Jun 11 16:43:17 2014	(r357508)
+++ head/www/pglogd/files/patch-Makefile	Wed Jun 11 16:46:31 2014	(r357509)
@@ -1,5 +1,5 @@
---- Makefile.orig	Wed Nov  5 18:41:01 2003
-+++ Makefile	Sun Feb 22 21:15:50 2004
+--- Makefile.orig	2003-11-06 02:41:01.000000000 +0800
++++ Makefile	2014-06-12 00:33:45.474374245 +0800
 @@ -31,16 +31,15 @@
  #
  
@@ -10,8 +10,9 @@
  
  ### NO NEED TO EDIT BELOW THIS LINE ###
  
- CC = gcc
+-CC = gcc
 -COPTS = -O -Wall
++#CC = gcc
  LIBS = -lpq
 -CFLAGS = -I${PGDIR}/include
 -LDFLAGS = -L${PGDIR}/lib
@@ -20,7 +21,7 @@
  
  
  SRCS_LOG = pglogd.c
-@@ -51,7 +50,19 @@
+@@ -51,7 +50,19 @@ SRCS_LOGCTL = pglogctl.c
  all : pglogd pglogctl
  
  pglogd : ${SRCS_LOG} ${HDRS_LOG}
@@ -33,12 +34,12 @@
 +
 +PGLOGD_SHARE=	${PREFIX}/share/pglogd
 +install :
-+	install -m 750 -s -c pglogd ${PREFIX}/bin
-+	install -m 750 -s -c pglogctl ${PREFIX}/bin
-+	install -m 755 -d ${PREFIX}/share/pglogd
-+	install -m 644 -c pglogd_tables.sql ${PGLOGD_SHARE}
-+	install -m 644 -c README ${PGLOGD_SHARE}
-+	install -m 644 -c CHANGELOG ${PGLOGD_SHARE}
-+	install -m 644 -c weblog_daily.sql ${PGLOGD_SHARE}
-+	install -m 644 -c queries.txt ${PGLOGD_SHARE}
-+	install -m 644 -c pglogd.conf ${PGLOGD_SHARE}
++	install -m 750 -s -c pglogd $(DESTDIR)${PREFIX}/bin
++	install -m 750 -s -c pglogctl $(DESTDIR)${PREFIX}/bin
++	install -m 755 -d $(DESTDIR)${PREFIX}/share/pglogd
++	install -m 644 -c pglogd_tables.sql $(DESTDIR)${PGLOGD_SHARE}
++	install -m 644 -c README $(DESTDIR)${PGLOGD_SHARE}
++	install -m 644 -c CHANGELOG $(DESTDIR)${PGLOGD_SHARE}
++	install -m 644 -c weblog_daily.sql $(DESTDIR)${PGLOGD_SHARE}
++	install -m 644 -c queries.txt $(DESTDIR)${PGLOGD_SHARE}
++	install -m 644 -c pglogd.conf $(DESTDIR)${PGLOGD_SHARE}

Added: head/www/pglogd/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/pglogd/files/pkg-message.in	Wed Jun 11 16:46:31 2014	(r357509)
@@ -0,0 +1,18 @@
+=========================================================
+You need to create a PostgreSQL database for your logs:
+
+  # su - postgres
+  $ createdb pglogd
+  $ psql pglogd < %%PREFIX%%/share/pglogd/pglogd_tables.sql
+  $ exit
+
+and copy %%PREFIX%%/share/pglogd/pglogd.conf
+to %%PREFIX%%/etc/pglogd.conf
+
+pglogd can then be started with:
+
+  # %%PREFIX%%/etc/rc.d/020.pglogd.sh start
+
+Read the complete documentation on configuring pglogd
+and apache at http://www.digitalstratum.com/pglogd/
+=========================================================

Modified: head/www/pglogd/pkg-plist
==============================================================================
--- head/www/pglogd/pkg-plist	Wed Jun 11 16:43:17 2014	(r357508)
+++ head/www/pglogd/pkg-plist	Wed Jun 11 16:46:31 2014	(r357509)
@@ -6,7 +6,4 @@ share/pglogd/queries.txt
 share/pglogd/weblog_daily.sql
 share/pglogd/README
 share/pglogd/CHANGELOG
-etc/rc.d/020.pglogd.sh
 @dirrm share/pglogd
-@unexec if cmp -s %D/etc/rc.d/020.pglogd.sh %D/etc/rc.d/020.pglogd.sh-dist; then rm -f %D/etc/rc.d/020.pglogd.sh; fi
-@exec [ -f %B/020.pglogd.sh ] || ( cp %B/%f %B/020.pglogd.sh; chmod 755 %B/020.pglogd.sh )



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