Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Mar 2014 20:07:11 +0000 (UTC)
From:      Ryan Steinmetz <zi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r348718 - in head/net: . pwhois pwhois/files
Message-ID:  <201403202007.s2KK7Bwx000301@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: zi
Date: Thu Mar 20 20:07:10 2014
New Revision: 348718
URL: http://svnweb.freebsd.org/changeset/ports/348718
QAT: https://qat.redports.org/buildarchive/r348718/

Log:
  New port: net/pwhois:
  
  The Prefix WhoIs Project provides a whois-compatible client and server
  framework for disclosing various up-to-date routing information.
  Instead of using registrar-originated network information (which is often
  unspecific or inaccurate), Prefix WhoIs uses the Internet's global routing
  table as gleaned from a number of routing peers around the world. Other
  sources of information, such as imported data from ARIN are also supported
  (a separate agreement with ARIN is required).
  
  WWW: http://pwhois.org/

Added:
  head/net/pwhois/
  head/net/pwhois/Makefile   (contents, props changed)
  head/net/pwhois/distinfo   (contents, props changed)
  head/net/pwhois/files/
  head/net/pwhois/files/512.pwhois-updatedb.in   (contents, props changed)
  head/net/pwhois/files/pkg-message.in   (contents, props changed)
  head/net/pwhois/files/pwhoisd.in   (contents, props changed)
  head/net/pwhois/pkg-descr   (contents, props changed)
  head/net/pwhois/pkg-plist   (contents, props changed)
Modified:
  head/net/Makefile

Modified: head/net/Makefile
==============================================================================
--- head/net/Makefile	Thu Mar 20 19:01:36 2014	(r348717)
+++ head/net/Makefile	Thu Mar 20 20:07:10 2014	(r348718)
@@ -889,6 +889,7 @@
     SUBDIR += pure-sockets
     SUBDIR += pvm
     SUBDIR += pvm++
+    SUBDIR += pwhois
     SUBDIR += pxe
     SUBDIR += pxe-pdhcp
     SUBDIR += py-GeoIP

Added: head/net/pwhois/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/pwhois/Makefile	Thu Mar 20 20:07:10 2014	(r348718)
@@ -0,0 +1,59 @@
+# Created by: Ryan Steinmetz <zi@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME=	pwhois
+PORTVERSION=	2.2.0.1
+CATEGORIES=	net
+MASTER_SITES=	http://pwhois.org/get/ \
+    		http://mirrors.rit.edu/zi/
+EXTRACT_SUFX=	.tgz
+
+MAINTAINER=	zi@FreeBSD.org
+COMMENT=	Whois-compatible framework for disclosing routing data
+
+RUN_DEPENDS=	p5-DBI>0:${PORTSDIR}/databases/p5-DBI \
+    		p5-Time-Format>0:${PORTSDIR}/devel/p5-Time-Format \
+		p5-Log-Dispatch>0:${PORTSDIR}/devel/p5-Log-Dispatch \
+		p5-Net-DNS>0:${PORTSDIR}/dns/p5-Net-DNS \
+		p5-Net-Telnet>0:${PORTSDIR}/net/p5-Net-Telnet \
+		p5-Net-CIDR>0:${PORTSDIR}/net-mgmt/p5-Net-CIDR \
+		p5-RPSL-Parser>0:${PORTSDIR}/devel/p5-RPSL-Parser \
+    		p5-DBD-mysql>=0:${PORTSDIR}/databases/p5-DBD-mysql
+
+FETCH_ARGS=	-p
+
+USERS=		${PORTNAME}
+GROUPS=		${PORTNAME}
+
+USE_MYSQL=	client
+USE_RC_SUBR=	${PORTNAME}d
+SUB_FILES=	pkg-message 512.pwhois-updatedb
+SUB_LIST=	TOUCH="${TOUCH}" RM="${RM}" CHOWN="${CHOWN}" \
+		USER="${USERS}" GROUP="${GROUPS}" INSTALL="${INSTALL}"
+
+post-patch:
+	${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' ${WRKSRC}/Makefile
+	@${REINPLACE_CMD} -e 's|/etc/pwhois/|${ETCDIR}/|g' \
+	    	-e 's|/var/pwhois/|/var/db/pwhois/|g' \
+	    	-e 's|/var/log/|/var/log/pwhois/|g' \
+	    	-e 's|/var/db/log/|/var/log/pwhois/|g' \
+	    	${WRKSRC}/main.c ${WRKSRC}/pwhois-updatedb \
+		${WRKSRC}/pwhois_pwdump.c ${WRKSRC}/pwhoisd.conf
+
+do-install:
+	@${MKDIR} ${STAGEDIR}${DATADIR} ${STAGEDIR}${ETCDIR} \
+		${STAGEDIR}${PREFIX}/etc/periodic/daily
+	@${INSTALL_SCRIPT} ${WRKDIR}/512.pwhois-updatedb \
+		${STAGEDIR}${PREFIX}/etc/periodic/daily/
+	@${INSTALL_PROGRAM} ${WRKSRC}/pwhoisd ${STAGEDIR}${PREFIX}/sbin/
+	@${INSTALL_SCRIPT} ${WRKSRC}/pwhois-updatedb ${STAGEDIR}${PREFIX}/sbin/
+	@${INSTALL_DATA} ${WRKSRC}/pwhoisd.conf \
+	    	${STAGEDIR}${ETCDIR}/pwhoisd.conf.sample
+	@${INSTALL_DATA} ${WRKSRC}/mysql/createdb.sql ${STAGEDIR}${DATADIR}/
+
+post-install:
+	@${MKDIR} ${STAGEDIR}/var/db/pwhois ${STAGEDIR}/var/log/pwhois
+	@${CHOWN} 512:512 ${STAGEDIR}/var/db/pwhois ${STAGEDIR}/var/log/pwhois
+	#@${CHOWN} ${USERS}:${GROUPS} ${STAGEDIR}/var/db/pwhois ${STAGEDIR}/var/log/pwhois
+
+.include <bsd.port.mk>

Added: head/net/pwhois/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/pwhois/distinfo	Thu Mar 20 20:07:10 2014	(r348718)
@@ -0,0 +1,2 @@
+SHA256 (pwhois-2.2.0.1.tgz) = 973470746d9a942e7391fe748dfd7b8a661e66a1f742f26a1061b6e11cb2e56c
+SIZE (pwhois-2.2.0.1.tgz) = 105401

Added: head/net/pwhois/files/512.pwhois-updatedb.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/pwhois/files/512.pwhois-updatedb.in	Thu Mar 20 20:07:10 2014	(r348718)
@@ -0,0 +1,21 @@
+#!/bin/sh -
+#
+# $FreeBSD$
+#
+
+if [ -r /etc/defaults/periodic.conf ]; then
+	. /etc/defaults/periodic.conf
+	source_periodic_confs
+fi
+
+rc=0
+
+case "${daily_pwhois-updatedb_enable:-YES}" in
+	[Nn][Oo])
+	;;
+	*)
+	[ -x %%PREFIX%%/sbin/pwhois-updatedb ] && %%PREFIX%%/sbin/pwhois-updatedb 1>/dev/null
+	;;
+esac
+
+exit $rc

Added: head/net/pwhois/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/pwhois/files/pkg-message.in	Thu Mar 20 20:07:10 2014	(r348718)
@@ -0,0 +1,24 @@
+This port requires additional tasks before it will function properly.
+
+1.  Create and initialize the database:
+mysql> create database pwhois;
+mysql> create user 'pwhois'@'localhost' identified by 'secret-password';
+mysql> grant all privileges on pwhois.* to 'pwhois'@'localhost';
+mysql> use pwhois;
+mysql> \. %%DATADIR%%/createdb.sql
+
+2.  Edit %%ETCDIR%%/pwhoisd.conf and update:
+ * Database connection information
+ * RouteView servers (some may be slower than others)
+
+3.  Populate the database with data for the first time by running:
+%%PREFIX%%/sbin/pwhois-updatedb
+
+4.  Add the following to /etc/rc.conf:
+pwhoisd_enable="YES"
+
+5.  Start pwhoisd for the first time by running:
+service pwhoisd start
+
+6.  To enable daily updates, edit /etc/periodic.conf and add:
+daily_pwhois-updatedb_enable="YES"

Added: head/net/pwhois/files/pwhoisd.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/pwhois/files/pwhoisd.in	Thu Mar 20 20:07:10 2014	(r348718)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: pwhoisd
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following line(s) to /etc/rc.conf to enable pwhoisd:
+#
+#  pwhoisd_enable="YES"
+#
+
+. /etc/rc.subr
+
+name=pwhoisd
+rcvar=pwhoisd_enable
+load_rc_config $name
+
+# Set defaults
+pwhoisd_enable=${pwhoisd_enable:-"NO"}
+
+_logdir=/var/log/pwhois
+_dbdir=/var/db/pwhois
+pidfile=/var/run/pwhoisd.pid
+command=%%PREFIX%%/sbin/pwhoisd
+command_args="-d -u 512 -g 512"
+required_files=%%PREFIX%%/etc/pwhois/pwhoisd.conf
+
+start_precmd=pwhoisd_precmd
+stop_postcmd=pwhoisd_cleanup
+
+pwhoisd_precmd()
+{
+    [ ! -f $pidfile ] && %%TOUCH%% $pidfile && %%CHOWN%% %%USER%%:%%GROUP%% $pidfile
+    [ ! -d $_dbdir ] && %%INSTALL%% -d -o %%USER%% -g %%GROUP%% $_dbdir
+    [ ! -d $_logdir ] && %%INSTALL%% -d -o %%USER%% -g %%GROUP%% $_logdir
+    return 0
+}
+
+pwhoisd_cleanup() {
+    [ -f ${pidfile} ] && %%RM%% ${pidfile}
+}
+
+run_rc_command "$1"

Added: head/net/pwhois/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/pwhois/pkg-descr	Thu Mar 20 20:07:10 2014	(r348718)
@@ -0,0 +1,9 @@
+The Prefix WhoIs Project provides a whois-compatible client and server
+framework for disclosing various up-to-date routing information.
+Instead of using registrar-originated network information (which is often
+unspecific or inaccurate), Prefix WhoIs uses the Internet's global routing
+table as gleaned from a number of routing peers around the world. Other
+sources of information, such as imported data from ARIN are also supported
+(a separate agreement with ARIN is required).
+
+WWW: http://pwhois.org/

Added: head/net/pwhois/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/pwhois/pkg-plist	Thu Mar 20 20:07:10 2014	(r348718)
@@ -0,0 +1,21 @@
+@comment $FreeBSD$
+etc/periodic/daily/512.pwhois-updatedb
+sbin/pwhois-updatedb
+sbin/pwhoisd
+@group pwhois
+@mode 640
+@unexec if cmp -s %D/etc/pwhois/pwhoisd.conf %D/etc/pwhois/pwhoisd.conf.sample ; then rm -f %D/etc/pwhois/pwhoisd.conf ; fi
+%%ETCDIR%%/pwhoisd.conf.sample
+@exec if [ ! -f %D/etc/pwhois/pwhoisd.conf ]; then cp -p %D/%F %B/pwhoisd.conf; fi
+@group wheel
+@mode
+%%DATADIR%%/createdb.sql
+@dirrm %%DATADIR%%
+@dirrmtry %%ETCDIR%%
+@dirrmtry etc/periodic/daily
+@dirrmtry etc/periodic
+@cwd /
+@dirrmtry var/db/pwhois
+@dirrmtry var/log/pwhois
+@unexec if [ -d var/db/pwhois ]; then echo "You should remove /var/db/pwhois if you don't need it any more."; fi
+@unexec if [ -d var/log/pwhois ]; then echo "You should remove /var/log/pwhois if you don't need it any more."; fi



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