Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jul 2002 07:33:11 +0200 (CEST)
From:      Cyrille Lefevre <cyrille.lefevre@laposte.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        robert@castley.com
Subject:   ports/40966: Update: net/ddup (3.0.1)
Message-ID:  <200207250533.g6P5XBKF060889@gits.gits.dyndns.org>

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

>Number:         40966
>Category:       ports
>Synopsis:       Update: net/ddup (3.0.1)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 24 22:40:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Cyrille Lefevre
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
ACME
>Environment:
System: FreeBSD gits 4.6-STABLE FreeBSD 4.6-STABLE #17: Tue Jul 23 08:29:49 CEST 2002 root@gits:/disk2/freebsd/stable/src/sys/compile/CUSTOM i386

>Description:
	this patch set updates ddup to make it conformant w/
		http://clients.dyndns.org/devel/query.php

	major changes where done by robert@castley.com, so,
	don't forget to give him credits in the CVS logs.

	I review them and made some changes such as :
	- usage reworked in ddup.c
	- version 3.1 beta -> 3.0.1.1 in ddup.h
	- --static, --dynamic and --custom are mutually exclusive
	  in parse_option.c
	- remove &action=edit in update.c

	Makefile
		PORTREVISION added
		${PERL} -> ${REINPLACE_CMD}
		etc.
	pkg-descr
		ex-maintainer address deleted
	pkg-plist
		$FreeBSD$ added
	files/Makefile
		LOCALBASE -> PREFIX
	files/patch-ddupcron.sh
		IFCHECK simplified
		IPFILE moved from /tmp to /var/db
		FILECHECK added
	files/patch-ddup.c
		new file -- usage updated
	files/patch-ddup.h
		new file -- version bumped
	files/patch-parse_option.c
		new file -- --dynamic and --custom options added
			    also, mutual exclusive options check added
	files/patch-update.c
		new files -- HTTP GET Request updated
>How-To-Repeat:
	n/a
>Fix:

	take care, this patch set is in two parts. the first one is
	a diff against /dev/null and the second one is a cvs diff.

--- /dev/null	Thu Jul 25 07:25:20 2002
+++ files/patch-ddup.c	Thu Jul 25 07:25:59 2002
@@ -0,0 +1,48 @@
+--- ddup.c.orig	Tue Oct 31 01:13:23 2000
++++ ddup.c	Thu Jul 25 07:25:54 2002
+@@ -26,25 +26,29 @@
+ void usage(void)
+ {
+   printf("DD-UP version %s by Thomas Gandy and Tom Groves (ddupwww@ddup.org)\n", AGENT_VER);
+-  printf("Usage:  ddup --host host.domain.ext (multiple hosts separated by ,)\n");
+-  printf("        (host.domain.ext,host2.domain.ext) [--ip address] [--wildcard]\n");
+-  printf("        [--proxyserv server] [--proxyport port] [--help] [--debug] [--mx mxhost]\n");
+-  printf("        [--backmx] [--static]\n");
+-  printf("        --host host.domain.ext : REQUIRED to update.\n"); 
+-  printf("                                 Where host.domain.ext is your domain.\n"); 
+-  printf("                                 eg. gandy.dyndns.org, gandy.ath.cx\n");
+-  printf("        --ip address : Forces manual ip specification\n");
+-  printf("                       Where address is your IP address.\n");
+-  printf("        --wildcard : Enables wildcards.\n");
++  printf("Usage:  ddup --host host.domain.ext [--ip address] [--wildcard]\n");
++  printf("	     [--mx mxhost] [--backmx] [--static | --dynamic | --custom]\n");
++  printf("	     [--proxyserv server] [--proxyport port] [--debug]\n");
++  printf("	ddup [--help | --makeconf]\n");
++  printf("\n");
++  printf("	--host host.domain.ext : REQUIRED to update.\n"); 
++  printf("		Where host.domain.ext is your domain.\n"); 
++  printf("		Multiple hosts separated by a `,' (comma) may be specified.\n");
++  printf("		e.g. gandy.dyndns.org,gandy.ath.cx\n");
++  printf("	--ip address : Forces manual ip specification\n");
++  printf("		Where address is your IP address.\n");
++  printf("	--wildcard : Enables wildcards.\n");
+   printf("	--mx mxhost : Sets your MX to mxhost.\n");
+   printf("	--backmx : Needs --mx and sets mxhost to be a backup MX.\n");
+-  printf("        --proxyserv server : Uses server as proxy.\n");
+-  printf("        --proxyport port : connects to proxy with port.\n");
+-  printf("        --help : Prints this message.\n");
+-  printf("	--debug : Prints debug output of what is sent to server.\n");
+   printf("	--static : Use the Static DNS service. (Added by Patrick D.)\n");
+-  printf("\n");
+-  printf("	--makeconf : Creates the config file for you. (Base64 Encodes your password)\n");
++  printf("	--dynamic : Use the Dyanmic DNS service. (Added by rwc.)\n");
++  printf("	--custom : Use the Custom DNS service. (Added by rwc.)\n");
++  printf("	--proxyserv server : Uses server as proxy.\n");
++  printf("	--proxyport port : connects to proxy with port.\n");
++  printf("	--debug : Prints debug output of what is sent to server.\n");
++  printf("	--help : Prints this message.\n");
++  printf("	--makeconf : Creates the config file for you.\n");
++  printf("		Base64 Encodes your password.\n");
+   exit(0);
+ }
+ 
--- /dev/null	Thu Jul 25 06:45:33 2002
+++ files/patch-ddup.h	Thu Jul 25 06:08:16 2002
@@ -0,0 +1,12 @@
+diff -u -x CVS -x work -x core -x *.core -x #* -x *~ -x *.orig -x *.rej -I $Id.*$ -I $.+BSD.*$ ddup.h.orig ddup.h
+--- ddup.h.orig	Tue Oct 31 01:09:48 2000
++++ ddup.h	Mon Jul 22 21:51:52 2002
+@@ -5,7 +5,7 @@
+ #include "options.h"
+ 
+ #define AGENT_NAME "ddup"
+-#define AGENT_VER "3.0.1"
++#define AGENT_VER "3.0.1.1"
+ #define MEMBERS_HOST "members.dyndns.org"
+ 
+ /* ddup_functions.c */
--- /dev/null	Thu Jul 25 06:45:33 2002
+++ files/patch-parse_option.c	Thu Jul 25 06:47:01 2002
@@ -0,0 +1,31 @@
+--- parse_option.c.orig	Sat Sep 30 21:06:27 2000
++++ parse_option.c	Thu Jul 25 06:46:57 2002
+@@ -30,6 +30,8 @@
+ int backmx_flag = 0;
+ /* Flag set by '--static' (Added by Patrick D.) */
+ int static_flag = 0;
++int dynamic_flag = 0;
++int custom_flag = 0;
+ /* Vars for other options */
+ char *ip_address;
+ char *host_id;
+@@ -51,6 +53,8 @@
+     {"version", 0, &ver_flag, 1},
+     /* Added by Patrick D. */
+     {"static", 0, &static_flag, 1},
++    {"dynamic", 0, &dynamic_flag, 1},
++    {"custom", 0, &custom_flag, 1},
+     /* These options don't set a flag.
+        We distinguish them by their indices. */
+     {"ip", 1, 0, 0},
+@@ -98,6 +102,10 @@
+     }
+   }
+ 
++  if (static_flag+dynamic_flag+custom_flag > 1) {
++    fprintf(stderr, "ddup: --static, --dynamic and --custom options are mutually exclusive.\n");
++    help_flag = 1;
++  }
+   if (help_flag) {
+     usage();
+   }
--- /dev/null	Thu Jul 25 06:45:33 2002
+++ files/patch-update.c	Thu Jul 25 06:47:49 2002
@@ -0,0 +1,30 @@
+--- update.c.orig	Tue Oct 31 01:10:02 2000
++++ update.c	Thu Jul 25 06:47:36 2002
+@@ -26,6 +26,8 @@
+ extern int backmx_flag;
+ /* Flag set by '--static' (Added by Patrick D.) */
+ extern int static_flag;
++extern int dynamic_flag;
++extern int custom_flag;
+ /* Vars for other options */
+ extern char *ip_address;
+ extern char *host_id;
+@@ -125,11 +127,14 @@
+   strcat(buf_out, "/nic/update?system=");
+ 
+   if (static_flag)
+-    strcat(buf_out, "stat");
+-  else
+-    strcat(buf_out, "dyn");
++    strcat(buf_out, "statdns");
++  else if (dynamic_flag)
++    strcat(buf_out, "dyndns");
++  else if (custom_flag)
++    strcat(buf_out, "custom");
+ 
+-  strcat(buf_out, "dns&hostname=");
++
++  strcat(buf_out, "&hostname=");
+   strcat(buf_out, host_id);
+ 
+   if (ip_address)

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net/ddup/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- Makefile	22 Jul 2002 03:43:46 -0000	1.11
+++ Makefile	25 Jul 2002 04:26:26 -0000
@@ -7,12 +7,17 @@
 
 PORTNAME=	ddup
 PORTVERSION=	3.0.1
+PORTREVISION=	1
 CATEGORIES=	net
 MASTER_SITES=	${MASTER_SITES_LOCAL}
 DISTNAME=	${PORTNAME}-${PORTVERSION}-unix
 
 MAINTAINER=	ports@FreeBSD.Org
 
+USE_REINPLACE=	1
+
+.include <bsd.port.pre.mk>
+
 MAN1=		ddup.1
 MANCOMPRESSED=	maybe
 
@@ -24,22 +29,23 @@
 MAKE_ARGS=	DEBUG="${DEBUG}"
 
 post-extract:
-	cd ${WRKSRC}; ${GUNZIP_CMD} ddup.1.gz
+	@${GUNZIP_CMD} ${WRKSRC}/ddup.1.gz
 
 post-patch:
-	${PERL} -i -pe 's,!!PREFIX!!,${PREFIX},' ${WRKSRC}/ddupcron.sh
-	${PERL} -i -pe 's,/etc\b,${PREFIX}$$&,' ${WRKSRC}/ddup.1
+	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/ddupcron.sh
+	@${REINPLACE_CMD} -e 's|/etc/|${PREFIX}&|' ${WRKSRC}/ddup.1
 
 pre-build:
-	${CP} ${FILESDIR}/Makefile ${WRKSRC}/
-	${ECHO_CMD} "#define file_name \"${PREFIX}/etc/ddup.conf\"" > ${WRKSRC}/options.h
+	@${CP} ${FILESDIR}/Makefile ${WRKSRC}
+	@${ECHO_CMD} "#define file_name \"${PREFIX}/etc/ddup.conf\"" \
+		> ${WRKSRC}/options.h
 
 post-install:
-	${INSTALL_SCRIPT} ${WRKSRC}/ddupcron.sh ${PREFIX}/sbin/
+	${INSTALL_SCRIPT} ${WRKSRC}/ddupcron.sh ${PREFIX}/sbin
 .if !defined(NOPORTSDOC)
-	${MKDIR} ${PREFIX}/share/doc/ddup
-	${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/ddup/
+	@${MKDIR} ${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
 .endif
 	@${CAT} ${PKGMESSAGE}
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: pkg-descr
===================================================================
RCS file: /home/ncvs/ports/net/ddup/pkg-descr,v
retrieving revision 1.4
diff -u -r1.4 pkg-descr
--- pkg-descr	3 Nov 2000 16:21:52 -0000	1.4
+++ pkg-descr	25 Jul 2002 03:45:15 -0000
@@ -15,5 +15,3 @@
 
 Author:	Thomas Gandy <tegandy@enid.com>
 WWW:	http://www.ddup.org/
-
-EMAIL: cjm2@altavista.net
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/net/ddup/pkg-plist,v
retrieving revision 1.4
diff -u -r1.4 pkg-plist
--- pkg-plist	3 Nov 2000 16:21:52 -0000	1.4
+++ pkg-plist	25 Jul 2002 04:39:40 -0000
@@ -1,3 +1,4 @@
+@comment $FreeBSD$
 sbin/ddup
 sbin/ddupcron.sh
 share/doc/ddup/README
Index: files/Makefile
===================================================================
RCS file: /home/ncvs/ports/net/ddup/files/Makefile,v
retrieving revision 1.1
diff -u -r1.1 Makefile
--- files/Makefile	3 Nov 2000 16:21:54 -0000	1.1
+++ files/Makefile	25 Jul 2002 04:25:19 -0000
@@ -10,8 +10,8 @@
 		update.c
 CFLAGS+=	${DEBUG}
 MAN1=		ddup.1
-BINDIR=		${LOCALBASE}/sbin
-MANDIR=		${LOCALBASE}/man/man
+BINDIR=		${PREFIX}/sbin
+MANDIR=		${MAN1PREFIX}/man/man
 
 .include <bsd.prog.mk>
 
Index: files/patch-ddupcron.sh
===================================================================
RCS file: /home/ncvs/ports/net/ddup/files/patch-ddupcron.sh,v
retrieving revision 1.1
diff -u -r1.1 patch-ddupcron.sh
--- files/patch-ddupcron.sh	3 Nov 2000 16:21:54 -0000	1.1
+++ files/patch-ddupcron.sh	25 Jul 2002 04:22:55 -0000
@@ -1,6 +1,6 @@
---- ddupcron.sh.orig	Mon Oct 23 02:11:48 2000
-+++ ddupcron.sh	Thu Nov  2 14:16:39 2000
-@@ -2,19 +2,23 @@
+--- ddupcron.sh.orig	Sun Oct 22 19:11:48 2000
++++ ddupcron.sh	Thu Jul 25 06:21:51 2002
+@@ -2,26 +2,30 @@
  
  # Define the host to be updated as 1st arguement to script
  if [ -z $1 ]; then
@@ -12,18 +12,30 @@
  fi
  # Define interface to grep address from
 -IFACE="eth0"
+-IFCHECK=$(/sbin/ifconfig $IFACE|grep ask|awk '{print $2}'|cut -d ':' -f2)
 +if [ -z $2 ]; then
 +	IFACE=fxp0
 +else
 +	IFACE=$2
 +fi
- IFCHECK=$(/sbin/ifconfig $IFACE|grep ask|awk '{print $2}'|cut -d ':' -f2)
++IFCHECK=$(/sbin/ifconfig $IFACE|awk '/netmask/{print $2; exit}')
  # Define where we should store last IP
- IPFILE="/tmp/ddupip"
+-IPFILE="/tmp/ddupip"
++IPFILE="/var/db/ddup.ip"
  IPCHECK=$(cat $IPFILE)
++FILECHECK=$(find $IPFILE -mtime -25)
++
  # Define path to ddup and ddup arguments (except --host)
 -DDUP_PATH="/home/ddup/ddup"
-+DDUP_PATH="!!PREFIX!!/sbin/ddup"
++DDUP_PATH="%%PREFIX%%/sbin/ddup"
  DDUP_ARGS="--debug"
  
- 
+-
+-if [ "$IFCHECK" = "$IPCHECK" ]; then
++if [ "$IFCHECK" = "$IPCHECK" ] && [ "x$FILECHECK" != x ]; then
+ 	echo "looks like we are still the same ip"
+ else
+ 	$DDUP_PATH --host $HOST $DDUP_ARGS
+ 	echo "$IFCHECK" > $IPFILE
+ fi
+-
>Release-Note:
>Audit-Trail:
>Unformatted:

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?200207250533.g6P5XBKF060889>