From 3e05a4d231f1abb905b0d053ea6375f274fd63f7 Mon Sep 17 00:00:00 2001
From: Ying-Chieh Liao <ijliao@FreeBSD.org>
Date: Sun, 23 Jun 2002 12:01:25 +0000
Subject: add nic 0.0.2.011230 Nic is a set of small web-based network
 applications

PR:		33359
Submitted by:	Thierry Thomas <thierry@thomas.as>
---
 net/nic/Makefile             | 66 +++++++++++++++++++++++++++++++++++++++
 net/nic/distinfo             |  1 +
 net/nic/files/httpd.conf.nic | 19 ++++++++++++
 net/nic/files/patch-icq.php  | 36 ++++++++++++++++++++++
 net/nic/files/patch-ping.php | 11 +++++++
 net/nic/pkg-comment          |  1 +
 net/nic/pkg-descr            | 14 +++++++++
 net/nic/pkg-message          | 10 ++++++
 net/nic/pkg-plist            | 73 ++++++++++++++++++++++++++++++++++++++++++++
 9 files changed, 231 insertions(+)
 create mode 100644 net/nic/Makefile
 create mode 100644 net/nic/distinfo
 create mode 100644 net/nic/files/httpd.conf.nic
 create mode 100644 net/nic/files/patch-icq.php
 create mode 100644 net/nic/files/patch-ping.php
 create mode 100644 net/nic/pkg-comment
 create mode 100644 net/nic/pkg-descr
 create mode 100644 net/nic/pkg-message
 create mode 100644 net/nic/pkg-plist

(limited to 'net/nic')

diff --git a/net/nic/Makefile b/net/nic/Makefile
new file mode 100644
index 000000000000..a5ae92240210
--- /dev/null
+++ b/net/nic/Makefile
@@ -0,0 +1,66 @@
+# Ports collection makefile for:  Nic
+# Date created:			  Sun Dec 30, 2001
+# Whom:				  Thierry Thomas (<thierry@pompo.net>)
+#
+# $FreeBSD$
+#
+
+PORTNAME=	nic
+PORTVERSION=	0.0.2.011230
+CATEGORIES=	net www
+MASTER_SITES=	http://pompo.net/horde/nic/
+
+MAINTAINER=	thierry@pompo.net
+
+RUN_DEPENDS=	${LOCALBASE}/www/horde/index.php:${PORTSDIR}/www/horde2
+
+NO_BUILD=	yes
+
+USE_REINPLACE=	yes
+
+DOCS=		LICENSE README docs/CHANGES docs/CREDITS docs/INSTALL
+CONFFILE=	conf.php html.php menu.php
+
+LHORDEDIR?=	www/horde
+LNICDIR?=	${LHORDEDIR}/nic
+
+PLIST_SUB=	HORDEDIR=${LHORDEDIR} NICDIR=${LNICDIR}
+
+HORDEDIR=	${PREFIX}/${LHORDEDIR}
+NICDIR=		${PREFIX}/${LNICDIR}
+CONFDIR=	${NICDIR}/config
+
+HORDE_INC=	${LOCALBASE}/etc/horde
+
+do-install:
+	@${MKDIR}  ${NICDIR}
+	@${CP} -Rp ${WRKSRC}/config ${WRKSRC}/graphics ${WRKSRC}/lib ${NICDIR}
+	@${CP} -Rp ${WRKSRC}/templates ${NICDIR}
+	@${CP} -p  ${WRKSRC}/*.php ${NICDIR}
+.for FILE in ${CONFFILE}
+	@if [ ! -f ${CONFDIR}/${FILE} ]; then \
+	  ${CP} ${CONFDIR}/${FILE}.dist ${CONFDIR}/${FILE} ; \
+	fi
+.endfor
+	@${CHOWN} -R www:www ${NICDIR}
+	@${CHMOD} -R o-rwx ${CONFDIR}
+	@${CP} -p ${FILESDIR}/httpd.conf.nic ${HORDE_INC}
+	@${REINPLACE_CMD} -e "s:/home/httpd/html/horde/nic:${NICDIR}:g" \
+		${HORDE_INC}/httpd.conf.nic
+	@${REINPLACE_CMD} -e "s://UNCOMMENTWHENINSTNIC::" \
+		${HORDEDIR}/config/registry.php
+.if !defined(NOPORTDOCS)
+	@${MKDIR} ${DOCSDIR}
+.for FILE in ${DOCS}
+	@${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR}
+.endfor
+	@${ECHO_MSG} "===> Documentation installed in ${DOCSDIR}."
+.endif
+
+post-install:
+	@${ECHO_MSG}
+	@${CAT} ${PKGMESSAGE} | \
+		${SED} -e "s:%%NICDIR%%:${NICDIR}:g;s:%%CONFDIR%%:${CONFDIR}:g"
+	@${ECHO_MSG}
+
+.include <bsd.port.mk>
diff --git a/net/nic/distinfo b/net/nic/distinfo
new file mode 100644
index 000000000000..7471826f4a1d
--- /dev/null
+++ b/net/nic/distinfo
@@ -0,0 +1 @@
+MD5 (nic-0.0.2.011230.tar.gz) = ce4fa57fedf482dc020308d0730952f6
diff --git a/net/nic/files/httpd.conf.nic b/net/nic/files/httpd.conf.nic
new file mode 100644
index 000000000000..a02fbcf3889b
--- /dev/null
+++ b/net/nic/files/httpd.conf.nic
@@ -0,0 +1,19 @@
+# This is included in Apache's httpd.conf for Nic
+#
+# For security, don't serve pages from the Nic configuration and
+# library directories.
+#
+<Directory "/home/httpd/html/horde/nic/config">
+    order deny,allow
+    deny from all
+</Directory>
+<Directory "/home/httpd/html/horde/nic/lib">
+    order deny,allow
+    deny from all
+</Directory>
+<Directory "/home/httpd/html/horde/nic/templates">
+    order deny,allow
+    deny from all
+</Directory>
+# End of Nic configuration ================
+
diff --git a/net/nic/files/patch-icq.php b/net/nic/files/patch-icq.php
new file mode 100644
index 000000000000..e5c0455d8a45
--- /dev/null
+++ b/net/nic/files/patch-icq.php
@@ -0,0 +1,36 @@
+--- icq.php.orig	Mon Oct 15 23:12:21 2001
++++ icq.php	Mon Dec 31 00:37:35 2001
+@@ -17,10 +17,10 @@
+ 
+ $uin = Horde::getFormData('uin');
+ $results="";
++$email_next=false;
+ if (!empty($uin)) {
+-	$fd = fopen("http://wwp.icq.com/$uin", 'r');
++	$fd = fopen("http://web.icq.com/wwp?Uin=" . $uin, 'r');
+ 	while ($buffer = fgetss($fd, 4096)) {
+-		
+ 		if (ereg('Handle/Nickname:', $buffer)) {
+ 		//	echo ereg_replace('Handle/Nickname:', 'NickName: ', $buffer);
+ 		//	echo "<br>";
+@@ -34,6 +34,20 @@
+ 			$results .= ereg_replace('E-Mail', 'Email: ', $buffer);
+ 			$results .="<br>";
+ 		}
++		
++		if (ereg('Hello my name is', $buffer)) {
++			$results .= ereg_replace('Hello my name is', 'Name:', $buffer);
++			$results .="<br>";
++		}
++		
++		if ($email_next) {
++			$results .= 'Email: ' . $buffer;
++			$email_next = false;
++		}
++		if (ereg('Send me an Email message', $buffer)) {
++			$email_next = true;
++		}
++
+ 	}
+ 	fclose($fd);
+ 	
diff --git a/net/nic/files/patch-ping.php b/net/nic/files/patch-ping.php
new file mode 100644
index 000000000000..a6b1c2b65c5a
--- /dev/null
+++ b/net/nic/files/patch-ping.php
@@ -0,0 +1,11 @@
+--- ping.php.orig	Wed Nov 21 23:17:27 2001
++++ ping.php	Sun Dec 30 22:05:49 2001
+@@ -26,7 +26,7 @@
+         $results .= "<br />$ping[$i]\n";
+     } 
+ } else {
+-    exec("/bin/ping -c 5 \"$addr\"", $ping);
++    exec("/sbin/ping -c 5 \"$addr\"", $ping);
+     
+     for ($i = 0; $i < count($ping); $i++) {
+         $results .= "<br />$ping[$i]\n";
diff --git a/net/nic/pkg-comment b/net/nic/pkg-comment
new file mode 100644
index 000000000000..f92d1cea8fe2
--- /dev/null
+++ b/net/nic/pkg-comment
@@ -0,0 +1 @@
+Nic is a set of small web-based network applications
diff --git a/net/nic/pkg-descr b/net/nic/pkg-descr
new file mode 100644
index 000000000000..74e1ca2a99f9
--- /dev/null
+++ b/net/nic/pkg-descr
@@ -0,0 +1,14 @@
+NIC is the Horde's suite of simple network utilities.
+The list of tools includes:
+
+ . Finger
+ . ICQ lookup
+ . DNS lookup
+ . Email address verification
+ . Ping
+ . SMTP open relay checking
+ . Service status
+ . Traceroute
+ . Whois
+
+WWW: http://horde.org/nic/
diff --git a/net/nic/pkg-message b/net/nic/pkg-message
new file mode 100644
index 000000000000..dc3b141f3692
--- /dev/null
+++ b/net/nic/pkg-message
@@ -0,0 +1,10 @@
+************************************************************************
+Nic has been installed in %%NICDIR%% with your blank
+configuration files. It should be available from
+<URL:http://localhost/horde/>.
+
+You may tune the configuration files located in
+%%CONFDIR%%/, specially the files conf.php.
+
+To protect your configuration files, you have to restart Apache.
+************************************************************************
diff --git a/net/nic/pkg-plist b/net/nic/pkg-plist
new file mode 100644
index 000000000000..2bdf1fef5509
--- /dev/null
+++ b/net/nic/pkg-plist
@@ -0,0 +1,73 @@
+%%PORTDOCS%%share/doc/nic/CHANGES
+%%PORTDOCS%%share/doc/nic/CREDITS
+%%PORTDOCS%%share/doc/nic/INSTALL
+%%PORTDOCS%%share/doc/nic/LICENSE
+%%PORTDOCS%%share/doc/nic/README
+%%NICDIR%%/config/conf.php
+%%NICDIR%%/config/conf.php.dist
+%%NICDIR%%/config/html.php
+%%NICDIR%%/config/html.php.dist
+%%NICDIR%%/config/menu.php
+%%NICDIR%%/config/menu.php.dist
+%%NICDIR%%/finger.php
+%%NICDIR%%/graphics/finger.gif
+%%NICDIR%%/graphics/icq_disabled.gif
+%%NICDIR%%/graphics/icq_offline.gif
+%%NICDIR%%/graphics/icq_online.gif
+%%NICDIR%%/graphics/mailaddrcheck.gif
+%%NICDIR%%/graphics/nic.gif
+%%NICDIR%%/graphics/ping.gif
+%%NICDIR%%/graphics/relay.gif
+%%NICDIR%%/graphics/services.gif
+%%NICDIR%%/graphics/whois.gif
+%%NICDIR%%/icq.php
+%%NICDIR%%/index.php
+%%NICDIR%%/lib/Finger.php
+%%NICDIR%%/lib/NIC.php
+%%NICDIR%%/lib/base.php
+%%NICDIR%%/lib/version.php
+%%NICDIR%%/lookup.php
+%%NICDIR%%/mailaddrcheck.php
+%%NICDIR%%/menu.php
+%%NICDIR%%/nic.php
+%%NICDIR%%/ping.php
+%%NICDIR%%/relay.php
+%%NICDIR%%/services.php
+%%NICDIR%%/status.php
+%%NICDIR%%/templates/common-footer.inc
+%%NICDIR%%/templates/common-header.inc
+%%NICDIR%%/templates/finger/finger.inc
+%%NICDIR%%/templates/footer.inc
+%%NICDIR%%/templates/icq/icq.inc
+%%NICDIR%%/templates/index/css.inc
+%%NICDIR%%/templates/index/notconfigured.inc
+%%NICDIR%%/templates/lookup/lookup.inc
+%%NICDIR%%/templates/mailaddrcheck/mailaddrcheck.inc
+%%NICDIR%%/templates/menu/menu.inc
+%%NICDIR%%/templates/nic_footer.html
+%%NICDIR%%/templates/nic_frame.html
+%%NICDIR%%/templates/ping/ping.inc
+%%NICDIR%%/templates/relay/relay.inc
+%%NICDIR%%/templates/services/services.inc
+%%NICDIR%%/templates/traceroute/traceroute.inc
+%%NICDIR%%/templates/whois/whois.inc
+%%NICDIR%%/traceroute.php
+%%NICDIR%%/whois.php
+etc/horde/httpd.conf.nic
+@dirrm %%NICDIR%%/config
+@dirrm %%NICDIR%%/graphics
+@dirrm %%NICDIR%%/lib
+@dirrm %%NICDIR%%/templates/finger
+@dirrm %%NICDIR%%/templates/icq
+@dirrm %%NICDIR%%/templates/index
+@dirrm %%NICDIR%%/templates/lookup
+@dirrm %%NICDIR%%/templates/mailaddrcheck
+@dirrm %%NICDIR%%/templates/menu
+@dirrm %%NICDIR%%/templates/ping
+@dirrm %%NICDIR%%/templates/relay
+@dirrm %%NICDIR%%/templates/services
+@dirrm %%NICDIR%%/templates/traceroute
+@dirrm %%NICDIR%%/templates/whois
+@dirrm %%NICDIR%%/templates
+@dirrm %%NICDIR%%
+%%PORTDOCS%%@dirrm share/doc/nic
-- 
cgit debian/1.2.3+git2.25.1-1-2-gaceb0