From 8a9537498fdbdda01fd43ea78b9e06b0fad4dc59 Mon Sep 17 00:00:00 2001 From: ijliao Date: Tue, 25 Jun 2002 09:32:29 +0000 Subject: add noip 1.6 No-IP.com's dynamic DNS update client PR: 36543 Submitted by: Eyal Soha --- dns/noip/Makefile | 43 +++++++++++++++++++++++++++++++++++++++++++ dns/noip/distinfo | 1 + dns/noip/files/noip.sh | 19 +++++++++++++++++++ dns/noip/files/patch-no-ip.sh | 16 ++++++++++++++++ dns/noip/files/patch-noip.c | 12 ++++++++++++ dns/noip/pkg-comment | 1 + dns/noip/pkg-deinstall | 21 +++++++++++++++++++++ dns/noip/pkg-descr | 10 ++++++++++ dns/noip/pkg-install | 32 ++++++++++++++++++++++++++++++++ dns/noip/pkg-message | 14 ++++++++++++++ dns/noip/pkg-plist | 8 ++++++++ 11 files changed, 177 insertions(+) create mode 100644 dns/noip/Makefile create mode 100644 dns/noip/distinfo create mode 100644 dns/noip/files/noip.sh create mode 100644 dns/noip/files/patch-no-ip.sh create mode 100644 dns/noip/files/patch-noip.c create mode 100644 dns/noip/pkg-comment create mode 100644 dns/noip/pkg-deinstall create mode 100644 dns/noip/pkg-descr create mode 100644 dns/noip/pkg-install create mode 100644 dns/noip/pkg-message create mode 100644 dns/noip/pkg-plist (limited to 'dns/noip') diff --git a/dns/noip/Makefile b/dns/noip/Makefile new file mode 100644 index 00000000000..96f654c9624 --- /dev/null +++ b/dns/noip/Makefile @@ -0,0 +1,43 @@ +# New ports collection makefile for: No-IP Dynamic Update Client +# Date created: 28 March 2002 +# Whom: Eyal Soha +# +# $FreeBSD$ +# + +PORTNAME= noip +PORTVERSION= 1.6 +CATEGORIES= net +MASTER_SITES= http://www.no-ip.com/client/linux/ +DISTNAME= noip_updater_v${PORTVERSION} + +MAINTAINER= esoha@attbi.com + +ALL_TARGET= noip + +post-build: + ${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/noip.sh > ${WRKSRC}/noip.sh + +pre-install: + @${SETENV} PKG_PREFIX=${PREFIX} ${SH} \ + ${PKGINSTALL} ${PKGNAME} PRE-INSTALL + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/noip ${PREFIX}/bin + ${INSTALL_SCRIPT} ${WRKSRC}/noip.sh ${PREFIX}/etc/rc.d +.if !defined(NOPORTDOCS) + ${MKDIR} ${PREFIX}/share/doc/${PORTNAME} + ${INSTALL_MAN} ${WRKSRC}/README.FIRST ${PREFIX}/share/doc/${PORTNAME} + ${INSTALL_MAN} ${WRKSRC}/COPYING ${PREFIX}/share/doc/${PORTNAME} + ${MKDIR} ${PREFIX}/share/examples/${PORTNAME} + ${INSTALL_MAN} ${WRKSRC}/no-ip.conf.sample ${PREFIX}/share/examples/${PORTNAME} + ${INSTALL_SCRIPT} ${WRKSRC}/no-ip.sh ${PREFIX}/share/examples/${PORTNAME} +.endif + @${SED} "s|%%PREFIX%%|${PREFIX}|g" ${PKGMESSAGE} | ${SED} "s|%%WRKSRC%%|${WRKSRC}|g" + +conf: + (cd ${PREFIX}/etc && ${PREFIX}/share/examples/noip/no-ip.sh) + ${CHOWN} noip:noip ${PREFIX}/etc/no-ip.conf + ${CHMOD} 0600 ${PREFIX}/etc/no-ip.conf + +.include diff --git a/dns/noip/distinfo b/dns/noip/distinfo new file mode 100644 index 00000000000..41d0c1e0f8f --- /dev/null +++ b/dns/noip/distinfo @@ -0,0 +1 @@ +MD5 (noip_updater_v1.6.tar.gz) = 6503e2e7d8ea35c304744a318b400a09 diff --git a/dns/noip/files/noip.sh b/dns/noip/files/noip.sh new file mode 100644 index 00000000000..eca1af8323b --- /dev/null +++ b/dns/noip/files/noip.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +case "$1" in + start) + if [ -x %%PREFIX%%/bin/noip -a -f %%PREFIX%%/etc/no-ip.conf ]; then + echo -n ' noip'; + su -m noip -c '%%PREFIX%%/bin/noip' 2> /dev/null > /dev/null + fi + ;; + stop) + echo -n ' noip'; + killall noip + ;; + *) + echo "Usage: `basename $0` {start|stop}" >&2 + exit 1 + ;; +esac +exit 0 diff --git a/dns/noip/files/patch-no-ip.sh b/dns/noip/files/patch-no-ip.sh new file mode 100644 index 00000000000..4d083a0ec7b --- /dev/null +++ b/dns/noip/files/patch-no-ip.sh @@ -0,0 +1,16 @@ +--- no-ip.sh.orig Wed Oct 10 16:35:12 2001 ++++ no-ip.sh Fri Mar 29 01:55:11 2002 +@@ -1,3 +1,4 @@ ++#!/bin/sh + # + # configuration file builder script for no-ip + # +@@ -89,7 +90,7 @@ + # + if [ "$NAT" = "N" ] + then +- devs=`tail +3 /proc/net/dev | awk -F: '{print $1}' | tr -d ' '|tr '\n' ' '` ++ devs=`ifconfig -l inet` + DEV=foo + while [ "$DEV" = "foo" ] + do diff --git a/dns/noip/files/patch-noip.c b/dns/noip/files/patch-noip.c new file mode 100644 index 00000000000..04b51cdfffd --- /dev/null +++ b/dns/noip/files/patch-noip.c @@ -0,0 +1,12 @@ +--- noip.c.bak Sat Mar 30 17:59:58 2002 ++++ noip.c Sat Mar 30 17:59:15 2002 +@@ -452,7 +452,8 @@ + else + getip(IPaddress); + #ifdef DEBUG +- ErrMsg("! LIA = %s, IP = %s",Last_IP_Addr, IPaddress); ++ if (debug) ++ ErrMsg("! LIA = %s, IP = %s",Last_IP_Addr, IPaddress); + #endif + if ((*IPaddress != 0) && + (strcmp(IPaddress, Last_IP_Addr) != 0)) { diff --git a/dns/noip/pkg-comment b/dns/noip/pkg-comment new file mode 100644 index 00000000000..608172d2c32 --- /dev/null +++ b/dns/noip/pkg-comment @@ -0,0 +1 @@ +No-IP.com's dynamic DNS update client diff --git a/dns/noip/pkg-deinstall b/dns/noip/pkg-deinstall new file mode 100644 index 00000000000..93a3036c7d4 --- /dev/null +++ b/dns/noip/pkg-deinstall @@ -0,0 +1,21 @@ +#!/bin/sh + +if [ "$2" != "POST-DEINSTALL" ]; then + exit 0 +fi + +PW=/usr/sbin/pw +ECHO=echo +USER=noip +GROUP=${USER} + +if [ -f ${PKG_PREFIX}/etc/no-ip.conf ]; then + ${ECHO} "To delete noip configuration permanently: rm ${PKG_PREFIX}/etc/no-ip.conf" +fi +if ${PW} usershow "${USER}" 2>/dev/null 1>&2; then + ${ECHO} "To delete noip user permanently: ${PW} userdel ${USER}" +fi +if ${PW} groupshow "${GROUP}" 2>/dev/null 1>&2; then + ${ECHO} "To delete noip group permanently: ${PW} groupdel ${GROUP}" +fi +exit 0 diff --git a/dns/noip/pkg-descr b/dns/noip/pkg-descr new file mode 100644 index 00000000000..6e3b58983d2 --- /dev/null +++ b/dns/noip/pkg-descr @@ -0,0 +1,10 @@ +This is a port of No-IP.com's dynamic DNS update client. When +configured correctly, the client will check the local IP address at a +given time interval for any changes. If the local IP address has +changed it will notify the DNS servers at No-IP.com and update the IP +corresponding to your No-IP/No-IP+ hostname. + +WWW: http://www.No-IP.com/ + +- Eyal Soha +esoha@attbi.com diff --git a/dns/noip/pkg-install b/dns/noip/pkg-install new file mode 100644 index 00000000000..f4efdf4b8f4 --- /dev/null +++ b/dns/noip/pkg-install @@ -0,0 +1,32 @@ +#!/bin/sh + +if [ "$2" != "PRE-INSTALL" ]; then + exit 0 +fi + +PW=/usr/sbin/pw +ECHO=echo +USER=noip +GROUP=${USER} + +if ! ${PW} groupshow "${GROUP}" 2>/dev/null 1>&2; then + if ${PW} groupadd ${GROUP}; then + ${ECHO} "Added group \"${GROUP}\"." + else + ${ECHO} "Adding group \"${GROUP}\" failed..." + exit 1 + fi +fi + +if ! ${PW} usershow "${USER}" 2>/dev/null 1>&2; then + if ${PW} useradd ${USER} -g ${GROUP} -h - \ + -s "/sbin/nologin" -d "/nonexistent" \ + -c "noip_updater pseudo-user"; \ + then + ${ECHO} "Added user \"${USER}\"." + else + ${ECHO} "Adding user \"${USER}\" failed..." + exit 1 + fi +fi +exit 0 diff --git a/dns/noip/pkg-message b/dns/noip/pkg-message new file mode 100644 index 00000000000..a8fd115e237 --- /dev/null +++ b/dns/noip/pkg-message @@ -0,0 +1,14 @@ +################################################################## +You need to generate the noip config file 'no-ip.conf' in +%%PREFIX%%/etc/no-ip.conf. To do this automatically, run: + + make conf + +To do it manually, copy +%%PREFIX%%/share/examples/noip/no-ip.conf.sample to +%%PREFIX%%/etc/no-ip.conf and edit it or use +%%PREFIX%%/share/examples/noip/no-ip.sh to make no-ip.conf. Then +chown to noip:noip and chmod to 0600. + +You need to register with www.no-ip.com to use this port. +################################################################## diff --git a/dns/noip/pkg-plist b/dns/noip/pkg-plist new file mode 100644 index 00000000000..3ac22b4870f --- /dev/null +++ b/dns/noip/pkg-plist @@ -0,0 +1,8 @@ +bin/noip +etc/rc.d/noip.sh +%%PORTDOCS%%share/doc/noip/README.FIRST +%%PORTDOCS%%share/doc/noip/COPYING +%%PORTDOCS%%share/examples/noip/no-ip.conf.sample +%%PORTDOCS%%share/examples/noip/no-ip.sh +%%PORTDOCS%%@dirrm share/doc/noip +%%PORTDOCS%%@dirrm share/examples/noip -- cgit