--- dhis-dns-engine-5.3.orig/nsupdate.c
+++ dhis-dns-engine-5.3/nsupdate.c
@@ -41,10 +41,10 @@
 
 #define	NSUPDATE_CMD "/usr/bin/nsupdate"
 
-int dns_update(unsigned char *r_dname,int r_opcode,short int r_type,
-                unsigned int r_ttl,int r_size,unsigned char *r_data) {
+int dns_update(char *r_dname,int r_opcode,short int r_type,
+                unsigned int r_ttl,int r_size,char *r_data) {
 
-        unsigned char str[1024];
+        char str[1024];
 
 
         if(r_opcode==ADD) 
--- dhis-dns-engine-5.3.orig/dhis-dns-engine.c
+++ dhis-dns-engine-5.3/dhis-dns-engine.c
@@ -63,7 +63,7 @@
 #       endif
 #  endif
 #else
-#  if !defined BIND821
+#  if !defined BIND821 && 0
 #	include<res_update.h>
 #  endif
 #endif
@@ -71,8 +71,8 @@
 #define	DYN_TTL		60
 #define	OFFLINE_IP	"192.168.255.0"
 
-#define	DHISD_DB	"/etc/dhis/db/dhis.db"
-#define	DHISE_LOG	"/etc/dhis/log/dhis-dns-engine.log"
+#define	DHISD_DB	"/etc/dhis-server/dhis.db"
+#define	DHISE_LOG	"/var/log/dhis-dns-engine.log"
 
 #define	MAX_HOSTNAME	64
 #define	MAX_PASS	16
@@ -80,7 +80,7 @@
 
 typedef struct db_t {
 			int id;
-			unsigned char fqdn[MAX_HOSTNAME];
+			char fqdn[MAX_HOSTNAME];
 			struct db_t *next;
 		    } db_t;
 
@@ -89,25 +89,25 @@
 int db_reload(void);
 int db_free(void);
 int db_add(db_t *);
-unsigned char *db_hostname(int);
-void strtolower(unsigned char *);
-void off_nl(unsigned char *);
-unsigned char *line_entry(int,unsigned char *);
-int msg_log(unsigned char *);
-int dns_update(unsigned char *,int,short int,unsigned int,int,unsigned char *);
-int mark_online(unsigned char *,unsigned char *);
-int mark_offline(unsigned char *);
+char *db_hostname(int);
+void strtolower(char *);
+void off_nl(char *);
+char *line_entry(int,char *);
+int msg_log(char *);
+int dns_update(char *,int,short int,unsigned int,int,char *);
+int mark_online(char *,char *);
+int mark_offline(char *);
 
 /* Global variables */
 db_t *dbase=NULL;
 
 /* Log function */
-int msg_log(unsigned char *msg) {
+int msg_log(char *msg) {
 
 	FILE *fp;
 
 	time_t	tt;
-	unsigned char buff[256];
+	char buff[256];
 
 	fp=fopen(DHISE_LOG,"a");
 	while(fp==NULL) { sleep(1); fp=fopen(DHISE_LOG,"a"); }
@@ -123,17 +123,17 @@
 }
 	
 /* Misc functions */
-void strtolower(unsigned char *s) { while(*s!='\0') { *s=tolower(*s); s++; } }
-void off_nl(unsigned char *s) {
+void strtolower(char *s) { while(*s!='\0') { *s=tolower(*s); s++; } }
+void off_nl(char *s) {
 
 	while(*s!='\0' && *s!='\n' && *s!='\r') s++;
 	*s='\0';
 	return;
 }
 
-unsigned char *line_entry(int idx,unsigned char *buff) {
+char *line_entry(int idx,char *buff) {
 
-	static unsigned char b2[1024],*pb2;
+	static char b2[1024],*pb2;
 	int i;
 
 	idx--;
@@ -164,7 +164,7 @@
 int db_reload(void) {
 
 	FILE *fp;
-	unsigned char str[1024];
+	char str[1024];
 	db_t *rec;
 
 	if(dbase!=NULL) db_free();
@@ -177,7 +177,7 @@
 	 if(strchr(line_entry(1,str),';')==NULL)
 	 if(!strcmp(line_entry(2,str),"{")) {
 
-		unsigned char keyword[256];
+		char keyword[256];
 		char *cp;
 
 		rec=(db_t *)malloc(sizeof(db_t));
@@ -224,10 +224,10 @@
 	return(1);
 }
 
-unsigned char *db_hostname(int id) {
+char *db_hostname(int id) {
 
 	db_t *p1;
-	static unsigned char host[MAX_HOSTNAME];
+	static char host[MAX_HOSTNAME];
 	static int lastid=0;
 	
 	if(lastid==id) return(host);
@@ -264,9 +264,9 @@
 
 
 
-int mark_online(unsigned char *host,unsigned char *addr) {
+int mark_online(char *host,char *addr) {
 
-	unsigned char str[128];
+	char str[128];
 
 	if(host==NULL) return(0);
 	if(host[0]=='\0') return(0);
@@ -279,9 +279,9 @@
 	return(0);
 }
 
-int mark_offline(unsigned char *host) {
+int mark_offline(char *host) {
 
-	unsigned char str[128],str2[16];
+	char str[128],str2[16];
 
 	if(host==NULL) return(0);
 	if(host[0]=='\0') return(0);
@@ -296,7 +296,7 @@
 
 int main() {
 
-	unsigned char line[1024];
+	char line[1024];
 
 	db_reload();
 	sprintf(line,"DHIS DNS Engine Starting");
@@ -314,8 +314,8 @@
 		}
 		if(!strcmp(line_entry(1,line),"add")) {
 			int id;
-			unsigned char addr[128];
-			unsigned char logstr[128];
+			char addr[128];
+			char logstr[128];
 			id=atoi(line_entry(3,line));
 			strcpy(addr,line_entry(4,line));
 			mark_online(db_hostname(id),addr); 
@@ -326,8 +326,8 @@
 		}
 		if(!strcmp(line_entry(1,line),"update")) {
 			int id;
-			unsigned char addr[128];
-			unsigned char logstr[128];
+			char addr[128];
+			char logstr[128];
 			id=atoi(line_entry(3,line));
 			strcpy(addr,line_entry(4,line));
 			mark_offline(db_hostname(id));
@@ -339,8 +339,8 @@
 		}
 		if(!strcmp(line_entry(1,line),"delete")) {
 			int id;
-			unsigned char addr[128];
-			unsigned char logstr[128];
+			char addr[128];
+			char logstr[128];
 			id=atoi(line_entry(3,line));
 			strcpy(addr,line_entry(4,line));
 			mark_offline(db_hostname(id));
--- dhis-dns-engine-5.3.orig/Makefile
+++ dhis-dns-engine-5.3/Makefile
@@ -26,12 +26,12 @@
 #      DHIS(c)  Dynamic Host Information System Release 5
 
 CC=gcc
-CFLAGS=-Wall -I/usr/local/include
-LFLAGS=-L/usr/local/lib
+CFLAGS=-Wall -O2 -pipe
+LFLAGS=
 LIBS=
 RM=rm -f
 
-INSTALLDIR=/etc/dhis/bin
+INSTALLDIR=$(DESTDIR)/usr/lib/dhis-server
 MODE=700
 OWNER=root
 MKDIR=mkdir -p
@@ -42,7 +42,7 @@
 
 dhis-dns-engine:dhis-dns-engine.c nsupdate.c
 	$(CC) $(CFLAGS) $(LFLAGS) -o dhis-dns-engine nsupdate.c dhis-dns-engine.c $(LIBS)
-	strip dhis-dns-engine
+	#strip dhis-dns-engine
 
 install: dhis-dns-engine
 	$(MKDIR) $(INSTALLDIR)
--- dhis-dns-engine-5.3.orig/debian/docs
+++ dhis-dns-engine-5.3/debian/docs
@@ -0,0 +1,2 @@
+README
+CONTRIBUTORS
--- dhis-dns-engine-5.3.orig/debian/compat
+++ dhis-dns-engine-5.3/debian/compat
@@ -0,0 +1 @@
+4
--- dhis-dns-engine-5.3.orig/debian/dirs
+++ dhis-dns-engine-5.3/debian/dirs
@@ -0,0 +1 @@
+usr/lib/dhis-server
--- dhis-dns-engine-5.3.orig/debian/copyright
+++ dhis-dns-engine-5.3/debian/copyright
@@ -0,0 +1,34 @@
+This package was debianized by Guus Sliepen <guus@debian.org> on
+Sat, 22 Jun 2002 11:28:45 +0200.
+
+It was downloaded from http://www.dhis.org/dhis/r5/
+
+Upstream Author: Joao Cabral <jcnc@dhis.org>
+
+Copyright:
+
+ Copyright (c) 1998-2001 Joao Cabral (jcnc@dhis.org)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+      DHIS(c)  Dynamic Host Information System Release 5.1
--- dhis-dns-engine-5.3.orig/debian/changelog
+++ dhis-dns-engine-5.3/debian/changelog
@@ -0,0 +1,38 @@
+dhis-dns-engine (5.3-1.4.201403192124) ucs4-0-0-0; urgency=low
+
+  * UCS auto build. No patches were applied to the original source package
+
+ -- Univention builddaemon <buildd@univention.de>  Wed, 19 Mar 2014 21:24:13 +0100
+
+dhis-dns-engine (5.3-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Guus Sliepen <guus@debian.org>  Sat, 05 Jan 2008 22:12:09 +0100
+
+dhis-dns-engine (5.1-2) unstable; urgency=low
+
+  * Remove strip command from Makefile. Closes: #436765
+
+ -- Guus Sliepen <guus@debian.org>  Tue, 14 Aug 2007 13:43:33 +0200
+
+dhis-dns-engine (5.1-1) unstable; urgency=low
+
+  * New upstream release. Closes: #372556
+  * Use libbind-dev instead of bind-dev.
+  * Remove warnings caused by silly use of unsigned char.
+
+ -- Guus Sliepen <guus@debian.org>  Tue, 13 Jun 2006 12:56:16 +0200
+
+dhis-dns-engine (5.0-2) unstable; urgency=low
+
+  * #include <stdarg.h> instead of <varargs.h>.
+
+ -- Guus Sliepen <guus@debian.org>  Tue, 27 May 2003 22:40:05 +0200
+
+dhis-dns-engine (5.0-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Guus Sliepen <guus@debian.org>  Sat, 22 Jun 2002 12:42:24 +0200
+
--- dhis-dns-engine-5.3.orig/debian/control
+++ dhis-dns-engine-5.3/debian/control
@@ -0,0 +1,18 @@
+Source: dhis-dns-engine
+Section: net
+Priority: extra
+Maintainer: Guus Sliepen <guus@debian.org>
+Build-Depends: debhelper (>> 4.0.0), libbind-dev
+Standards-Version: 3.7.3
+Homepage: http://www.dhis.org/
+
+Package: dhis-dns-engine
+Architecture: any
+Depends: ${shlibs:Depends}, dhis-server, bind9 | bind
+Description: Dynamic Host Information System - DNS engine
+ This package contains a dynamic DNS service module to be used
+ with dhisd release 5 or above.
+ .
+ While the DHIS server dhisd retrieves dynamic IP addresses
+ from clients, this module allows the server to update a
+ dynamic DNS zone based on those retrieved IP addresses.
--- dhis-dns-engine-5.3.orig/debian/rules
+++ dhis-dns-engine-5.3/debian/rules
@@ -0,0 +1,90 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+
+	touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+	dh_testdir
+
+	# Add here commands to compile the package.
+	$(MAKE)
+	#/usr/bin/docbook-to-man debian/dhis-dns-engine.sgml > dhis-dns-engine.1
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+
+	# Add here commands to clean up after the build process.
+	$(MAKE) clean
+
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	# Add here commands to install the package into debian/dhis-dns-engine.
+	$(MAKE) install DESTDIR=$(CURDIR)/debian/dhis-dns-engine
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+#	dh_installdebconf	
+	dh_installdocs
+#	dh_installexamples
+#	dh_installmenu
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+#	dh_installinit
+#	dh_installcron
+#	dh_installman
+#	dh_installinfo
+#	dh_undocumented
+	dh_installchangelogs 
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+#	dh_makeshlibs
+	dh_installdeb
+#	dh_perl
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
