Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Feb 2001 02:22:01 +0100 (CET)
From:      baskruit@bsltwr.dnsalias.org
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/25368: New port: Server for DHIS dynamic DNS protocol
Message-ID:  <200102260122.f1Q1M1J08889@gate.bsltwr.dnsalias.org>

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

>Number:         25368
>Category:       ports
>Synopsis:       New port: Server for DHIS dynamic DNS protocol
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 25 17:30:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     S. Kruit
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
>Environment:
Tested and build under 4.2-STABLE FreeBSD 4.2-STABLE i386
with named 8.2.3-REL

>Description:
Server for DHIS dynamic DNS protocol
Allows dynamic updating of a DNS server running BIND 8.1.2 or higher 
through a client. (See net/dhid port for client)

>How-To-Repeat:
>Fix:
# 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:
#
#	dhis
#	dhis/pkg-plist
#	dhis/pkg-descr
#	dhis/pkg-comment
#	dhis/distinfo
#	dhis/Makefile
#	dhis/files
#	dhis/files/dhis.db
#	dhis/files/dhisd.sh
#	dhis/files/patch-aa
#	dhis/files/patch-ab
#	dhis/files/patch-ac
#	dhis/files/patch-ad
#
echo c - dhis
mkdir -p dhis > /dev/null 2>&1
echo x - dhis/pkg-plist
sed 's/^X//' >dhis/pkg-plist << 'END-of-dhis/pkg-plist'
X
END-of-dhis/pkg-plist
echo x - dhis/pkg-descr
sed 's/^X//' >dhis/pkg-descr << 'END-of-dhis/pkg-descr'
XDHIS Daemon release 4.0
X==============================
X
Xdhisd is the DHIS daemon. The deamon is used to update DNS tables on a 
Xrunning unix based DNS server, running BIND 8.1.2 or higher. It's clients
Xshould run the dhis-client 3 or 4 software to send updates.
X
XYou need a full DNS domain to run this server. You should at least have a 
Xdomain hosted for you with a primary and backup dns server and 1 
Xbackup mail-exchanger
X.
XIf you don't know what this previous few lines where about, 
Xyou probably shouldn't try and run this software.
X
XFor more information on the services of DHIS, you should look at the
Xofficial DHIS site: 
X	http://www.dhis.org/dhis/services/
X
XFor more info on the FreeBSD port, see 
X	http://bsltwr.dhis.org/dhis
X
XWWW: http://bsltwr.dhis.org/dhis/
END-of-dhis/pkg-descr
echo x - dhis/pkg-comment
sed 's/^X//' >dhis/pkg-comment << 'END-of-dhis/pkg-comment'
XDHIS server for updating dynamic DNS entries in DNS tables
END-of-dhis/pkg-comment
echo x - dhis/distinfo
sed 's/^X//' >dhis/distinfo << 'END-of-dhis/distinfo'
XMD5 (dhisd-4.0.tar.gz) = 9757deffda1b4a261f4313a4bd1b5ed1
END-of-dhis/distinfo
echo x - dhis/Makefile
sed 's/^X//' >dhis/Makefile << 'END-of-dhis/Makefile'
X# New ports collection makefile for:	dhisd
X# Date created:		Sun 25 21:13:59 CET 2001
X# Whom:			Bas Kruit <baskruit@bsltwr.dhis.org>
X#
X# $FreeBSD$
X#
X
XPORTNAME=		dhisd
XPORTVERSION=		4.0
XCATEGORIES=		net
XMASTER_SITES=		http://bsltwr.dhis.org/ftp/pub/dhis/ \
X			ftp://ftp.dhis.org/pub/dhis/
X
XMAINTAINER=		baskruit@bsltwr.dhis.org
X
XDHISBASE=		${PREFIX}/dhis
XDIRS=			dhis dhis/bin dhis/pid dhis/db dhis/log dhis/script
XRDIRS=			dhis/bin dhis/pid dhis/db dhis/log dhis/script dhis
X
Xpost-patch:
X	@${ECHO} "===>   Patching Makefile"
X	${PERL} -i -p -e "s^__PREFIX__^${DHISBASE}^g" ${WRKSRC}/Makefile
X	@${ECHO} "===>   Patching documentation..."
X	${PERL} -i -p -e "s^__PREFIX__^${DHISBASE}^g" ${WRKSRC}/INSTALL
X	${PERL} -i -p -e "s^__PREFIX__^${DHISBASE}^g" ${WRKSRC}/README
X	@${ECHO} "===>   Patching dhisd.h"
X	${PERL} -i -p -e "s^__PREFIX__^${DHISBASE}^g" ${WRKSRC}/dhisd.h
X	@${ECHO} "===>   Patching dhisd.sh"
X	@${CP} ${FILESDIR}/dhisd.sh ${WRKSRC}
X	${PERL} -i -p -e "s^__PREFIX__^${PREFIX}^g" ${WRKSRC}/dhisd.sh
X
Xdo-install:
X
Xpost-install:
X.for dir in ${DIRS}
X	@${MKDIR} ${PREFIX}/${dir}
X	@${CHMOD} 700 ${PREFIX}/${dir}
X.endfor
X	${INSTALL_PROGRAM} ${WRKSRC}/dhisd ${DHISBASE}/bin
X	@${INSTALL_DATA} ${FILESDIR}/dhis.db ${DHISBASE}/db/dhis.db.sample
X	@${ECHO} "dhis/bin/dhisd" >> ${TMPPLIST}
X	@${ECHO} "dhis/db/dhis.db.sample" >> ${TMPPLIST}
X	@${CHMOD} 600 ${PREFIX}/dhis/db/*
X	@if [ ! -f ${PREFIX}/etc/rc.d/dhisd.sh ]; then \
X		${ECHO} "===>   Installing ${PREFIX}/etc/rc.d/dhid.sh startup file."; \
X		${INSTALL_SCRIPT} -m 751 ${FILESDIR}/dhisd.sh ${PREFIX}/etc/rc.d/dhisd.sh; \
X		@${ECHO} "etc/rc.d/dhisd.sh" >> ${TMPPLIST}; \
X	fi;
X.if !defined(NOPORTDOCS)
X	@${MKDIR} ${DHISBASE}/doc
X	@${INSTALL_DATA} ${WRKSRC}/README ${DHISBASE}/doc
X	@${INSTALL_DATA} ${WRKSRC}/INSTALL ${DHISBASE}/doc
X	@${CHMOD} 755 ${DHISBASE}/doc
X	@${ECHO} "dhis/doc/README" >> ${TMPPLIST}
X	@${ECHO} "dhis/doc/INSTALL" >> ${TMPPLIST}
X	@${ECHO} "@dirrm dhis/doc" >> ${TMPPLIST}
X.endif
X.for dir in ${RDIRS}
X	@${ECHO} "@dirrm ${dir}" >> ${TMPPLIST}
X.endfor
X	@${ECHO} "--------------------------------------------------------------------------"
X	@${ECHO} "Before dhisd can run, you will need configure BIND."
X	@${ECHO} ""
X	@${ECHO} "For more information, see the following site:"
X	@${ECHO} "http://www.dhis.org/dhis/r4/server.html"
X.if !defined(NOPORTDOCS)
X	@${ECHO} "or ${DHISBASE}/doc/"
X.endif
X	@${ECHO} ""
X	@${ECHO} "For information on this port, check the following site:"
X	@${ECHO} "http://bsltwr.dhis.org/dhis/"
X	@${ECHO} "--------------------------------------------------------------------------"
X
X.include <bsd.port.mk>
END-of-dhis/Makefile
echo c - dhis/files
mkdir -p dhis/files > /dev/null 2>&1
echo x - dhis/files/dhis.db
sed 's/^X//' >dhis/files/dhis.db << 'END-of-dhis/files/dhis.db'
X1001 { 
X        hostname        dyn1.example.com
X        hostpass        password
X     }
X
X1002 { 
X        hostname        dyn2.example.com
X        authn           32934593845689467748967498674789585769453
X        authn           56456894768497649867849769487659847684977
X        authn           22389472897348957348957389457894375849573
X        authn           23459435734957398753489573495743985743985
X      }
X
END-of-dhis/files/dhis.db
echo x - dhis/files/dhisd.sh
sed 's/^X//' >dhis/files/dhisd.sh << 'END-of-dhis/files/dhisd.sh'
X#!/bin/sh
X
Xcase "$1" in
Xstart)
X	[ -x "__PREFIX__/dhis/bin/dhisd" ] && __PREFIX__/dhis/bin/dhisd > /dev/null && echo -n ' dhisd'
X	;;
Xstop)
X	killall dhisd && echo -n ' dhisd'
X	;;
X*)
X	echo "Usage: `basename $0` {start|stop}" >&2
X	;;
Xesac
X
Xexit 0
END-of-dhis/files/dhisd.sh
echo x - dhis/files/patch-aa
sed 's/^X//' >dhis/files/patch-aa << 'END-of-dhis/files/patch-aa'
X--- dhisd.h.orig	Mon Mar 13 18:08:04 2000
X+++ dhisd.h	Mon Feb 26 01:03:00 2001
X@@ -62,9 +62,9 @@
X 
X #define	MX_PORT		58801
X #define	DHISD_PORT	58800
X-#define	DHISD_PID	"/etc/dhis/pid/dhisd.pid"
X-#define	DHISD_DB	"/etc/dhis/db/dhis.db"
X-#define	DHISD_LOG	"/etc/dhis/log/dhisd.log"
X+#define	DHISD_PID	"__PREFIX__/pid/dhisd.pid"
X+#define	DHISD_DB	"__PREFIX__/db/dhis.db"
X+#define	DHISD_LOG	"__PREFIX__/log/dhisd.log"
X 
X #define	MAX_HOSTNAME	64
X #define	MAX_PASS	16
END-of-dhis/files/patch-aa
echo x - dhis/files/patch-ab
sed 's/^X//' >dhis/files/patch-ab << 'END-of-dhis/files/patch-ab'
X--- Makefile.orig	Sat Feb 24 02:59:57 2001
X+++ Makefile	Sat Feb 24 03:01:42 2001
X@@ -28,9 +28,11 @@
X CC=gcc
X CFLAGS=-I/usr/local/include
X LFLAGS=-L/usr/local/lib
X-LIBS=-lbind -lgmp 
X+LIBS=-lgmp 
X OBJS=log.o network.o misc.o db.o online.o nsupdate.o main.o
X RM=rm -f
X+
X+all:	dhisd
X 
X dhisd:	$(OBJS)
X 	$(CC) $(LFLAGS) -o dhisd $(OBJS) $(LIBS)
END-of-dhis/files/patch-ab
echo x - dhis/files/patch-ac
sed 's/^X//' >dhis/files/patch-ac << 'END-of-dhis/files/patch-ac'
X--- INSTALL.orig	Sun May  7 19:35:19 2000
X+++ INSTALL	Mon Feb 26 01:00:37 2001
X@@ -87,17 +87,17 @@
X 
X 	Create the directories:
X 
X-	/etc/dhis
X-	/etc/dhis/bin
X-	/etc/dhis/pid
X-	/etc/dhis/db
X-	/etc/dhis/log
X-	/etc/dhis/script
X+	__PREFIX__
X+	__PREFIX__/bin
X+	__PREFIX__/pid
X+	__PREFIX__/db
X+	__PREFIX__/log
X+	__PREFIX__/script
X 	
X-	You may wish to create /etc/dhis/src and put dhisd-4.0 under
X+	You may wish to create __PREFIX__/src and put dhisd-4.0 under
X 	this directory.
X 
X-	Copy dhisd to /etc/dhis/bin . This is the server binary.
X+	Copy dhisd to __PREFIX__/bin . This is the server binary.
X 
X 	Create the database file which will hold information for
X 	current dynamic hosts. For this installation let us assume
X@@ -105,7 +105,7 @@
X 	example.com, and that we wish to create 3 dynamic hosts
X 	named dyn1.example.com, dyn2.example.com and dyn3.example.com
X 
X-	Change directory to /etc/dhis/db
X+	Change directory to __PREFIX__/db
X 	
X 	Create a text file named dhis.db with a text editor.
X 	The file should have three lines, one for each dynamic host.
X@@ -179,20 +179,20 @@
X 	Change the permissions as you wish. In particular dhis.db
X 	should not be readable by anyone. Suggested example:
X 
X-	chmod 700 /etc/dhis /etc/dhis/*
X-	chmod 600 /etc/dhis/db/dhis.db
X+	chmod 700 __PREFIX__ __PREFIX__/*
X+	chmod 600 __PREFIX__/db/dhis.db
X 
X 	Add dhisd to your system's startup script 
X 	(rc.local for BSD systems, SXXdhis under /etc/rc2.d
X 	for System V). A simple line such as 
X 
X-		/etc/dhis/bin/dhisd
X+		__PREFIX__/bin/dhisd
X 
X 	will do. However, if your service will provide mail 
X 	relaying as well you must specify the relay's IP address,
X 	in which case the line should look like:
X 
X-		/etc/dhis/bin/dhisd -m y.y.y.y
X+		__PREFIX__/bin/dhisd -m y.y.y.y
X 
X 	where y.y.y.y is the IP address of the mail relay (may be
X 	the same host). Check the relay-4.0.tar.gz distribution
X@@ -209,7 +209,7 @@
X 	present, the relay machine is identified by relay.example.com.
X 	Again, these may point to the same machine.
X 
X-	Edit /etc/named.conf and add a section such as:
X+	Edit /etc/named/named.conf and add a section such as:
X 
X 	zone "example.com" in {
X 
X@@ -277,8 +277,8 @@
X 
X 	DNS is now running and accepting dynamic updates.
X 
X-	You may also run /etc/dhis/bin/dhisd or 
X-	/etc/dhis/bin/dhisd -m y.y.y.y manually by now if
X+	You may also run __PREFIX__/bin/dhisd or 
X+	__PREFIX__/bin/dhisd -m y.y.y.y manually by now if
X 	you wish to run DHIS at once.
X 
X 4. Adding Records
X@@ -301,7 +301,7 @@
X 
X 	run 
X 
X-	kill -HUP `cat /etc/dhis/pid/dhisd.pid`
X+	kill -HUP `cat __PREFIX__/pid/dhisd.pid`
X 
X 	to reload the DHIS database.
X 
END-of-dhis/files/patch-ac
echo x - dhis/files/patch-ad
sed 's/^X//' >dhis/files/patch-ad << 'END-of-dhis/files/patch-ad'
X--- README.orig	Sun Apr 30 18:51:47 2000
X+++ README	Mon Feb 26 00:55:38 2001
X@@ -29,7 +29,8 @@
X 	would result in non-existent host. Thus, the presence of 
X 	an IP address, even while offline, is essencial. 
X 
X-	The DHIS server dhisd runs a database file (/etc/dhis/db/dhis.db)
X+	The DHIS server dhisd runs a database file 
X+        (__PREFIX__/db/dhis.db)
X 	and loads the current list of dynamic hosts into memory. 
X 	Furthermore it expects datagram packets to be received on
X 	port 58800 from the connecting clients running dhid.
X@@ -91,7 +92,7 @@
X 	dhisd accepts HUP and TERM signals. A kill -HUP will
X 	make it reload the hosts database and kill -TERM
X 	will terminate it. Its pid number is recorded on the
X-	text file /etc/dhis/pid/dhisd.pid.
X+	text file __PREFIX__/pid/dhisd.pid.
X 
X 	The current DHIS server is expected to perform well
X 	on a 100Mhz machine with up to 5000 dynamic hosts.
X@@ -99,7 +100,7 @@
X 	users.
X 
X 	dhisd logs online and offline transitions at
X-	/etc/dhis/log/dhisd.log
X+	__PREFIX__/log/dhisd.log
X 
X 
X 	Firewall considerations:
END-of-dhis/files/patch-ad
exit


>Release-Note:
>Audit-Trail:
>Unformatted:
 Synopsis: New port: Server for DHIS dynamic DNS protocol
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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