Debianization. master
authorMark Wooding <mdw@distorted.org.uk>
Wed, 15 Feb 2006 18:44:50 +0000 (18:44 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 15 Feb 2006 18:44:50 +0000 (18:44 +0000)
.gitignore [new file with mode: 0644]
debian/.gitignore [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/rules [new file with mode: 0755]
error.h
hier.c
install.c
qmail.c

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..c89323d
--- /dev/null
@@ -0,0 +1,89 @@
+auto-ccld.sh
+make-load
+find-systype
+systype
+load
+make-compile
+compile
+dot-forward.o
+control.o
+fork.h
+qmail.o
+auto-str.o
+make-makelib
+makelib
+substdio.o
+substdi.o
+substdo.o
+subfderr.o
+substdio_copy.o
+substdio.a
+error.o
+error_str.o
+error.a
+str_len.o
+str_diffn.o
+byte_chr.o
+byte_copy.o
+byte_cr.o
+str.a
+auto-str
+auto_qmail.c
+auto_qmail.o
+token822.o
+envread.o
+env.a
+getln.o
+getln2.o
+getln.a
+subgetopt.o
+sgetopt.o
+getopt.a
+strerr_sys.o
+strerr_die.o
+strerr.a
+stralloc_eady.o
+stralloc_pend.o
+stralloc_copy.o
+stralloc_opys.o
+stralloc_opyb.o
+stralloc_cat.o
+stralloc_cats.o
+stralloc_catb.o
+stralloc.a
+alloc.o
+alloc_re.o
+alloc.a
+case_diffb.o
+case.a
+hassgact.h
+sig_catch.o
+sig_pipe.o
+sig.a
+seek_set.o
+seek.a
+open_read.o
+open_trunc.o
+open.a
+haswaitp.h
+wait_pid.o
+wait.a
+fd_copy.o
+fd_move.o
+fd.a
+fmt_ulong.o
+scan_ulong.o
+fs.a
+dot-forward
+prog
+dot-forward.0
+man
+it
+install.o
+hier.o
+install
+setup
+instcheck.o
+instcheck
+check
+build
diff --git a/debian/.gitignore b/debian/.gitignore
new file mode 100644 (file)
index 0000000..8c0f814
--- /dev/null
@@ -0,0 +1,2 @@
+*.substvars
+files
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..6adcdac
--- /dev/null
@@ -0,0 +1,5 @@
+dot-forward (0.71-1) experimental; urgency=low
+
+  * Debianization!
+
+ -- Mark Wooding <mdw@distorted.org.uk>  Thu,  6 Oct 2005 12:41:04 +0100
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..aca933f
--- /dev/null
@@ -0,0 +1,11 @@
+Source: dot-forward
+Section: mail
+Priority: extra
+Maintainer: Mark Wooding <mdw@distorted.org.uk>
+Standards-Version: 3.1.1
+
+Package: dot-forward
+Architecture: any
+Depends: ${shlibs:Depends}, qmail
+Description: .forward support for qmail
+ Nuff said.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..f5f7140
--- /dev/null
@@ -0,0 +1,4 @@
+Copyright 1998
+D. J. Bernstein, djb@pobox.com
+
+You may distribute unmodified copies of the dot-forward package.
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..c9af57a
--- /dev/null
@@ -0,0 +1,55 @@
+#! /usr/bin/make -f
+
+export DH_COMPAT = 4
+
+mdw-setup:
+       upstream=`git-describe djb | sed 's:^djb/::'`; \
+       dir=dot-forward_$$upstream.orig; \
+       git-tar-tree djb $$dir | gzip -9c >../$$dir.tar.gz
+
+build:
+       rm -rf build
+       make
+       touch build
+
+clean:
+       dh_clean
+       xargs rm -f <TARGETS
+       rm -f build
+
+install: build
+       dh_clean
+       make install
+       mkdir -p debian/dot-forward/usr
+       ./install `pwd`/debian/dot-forward/usr
+       mkdir -p debian/dot-forward/usr/share
+       mkdir -p debian/dot-forward/usr/share/doc/dot-forward
+       mv debian/dot-forward/usr/man debian/dot-forward/usr/share
+       rm -rf debian/dot-forward/usr/share/man/cat*
+       rm -rf debian/dot-forward/usr/doc
+       cp BLURB CHANGES INSTALL THANKS TODO \
+         debian/dot-forward/usr/share/doc/dot-forward
+
+binary-indep:
+
+binary-arch: install
+       dh_testdir -a
+       dh_testroot -a
+       dh_compress -a
+       dh_installdocs -a
+       dh_strip -a
+       dh_shlibdeps -a
+       dh_gencontrol -a
+       dh_fixperms -a
+       dh_installdeb -a
+       dh_md5sums -a
+       dh_builddeb -a
+
+binary: binary-indep binary-arch
+
+source: clean mdw-setup
+       dir=`pwd | sed 's:^.*/::'`; \
+       cd ..; \
+       dpkg-source -b -i'(?:^|/)\.git(?:$$|/)' $$dir
+
+.PHONY: binary binary-arch binary-indep clean install source mdw-setup
diff --git a/error.h b/error.h
index 01bd3dc..5d98c6b 100644 (file)
--- a/error.h
+++ b/error.h
@@ -1,7 +1,7 @@
 #ifndef ERROR_H
 #define ERROR_H
 
-extern int errno;
+#include <errno.h>
 
 extern int error_intr;
 extern int error_nomem;
diff --git a/hier.c b/hier.c
index 05a32cb..14e476a 100644 (file)
--- a/hier.c
+++ b/hier.c
@@ -1,16 +1,18 @@
 #include "auto_qmail.h"
 
-void hier()
+void hier(char *home)
 {
-  h(auto_qmail,-1,-1,0755);
+  if (!home)
+    home = auto_qmail;
+  h(home,-1,-1,0755);
 
-  d(auto_qmail,"bin",-1,-1,0755);
-  d(auto_qmail,"man",-1,-1,0755);
-  d(auto_qmail,"man/man1",-1,-1,0755);
-  d(auto_qmail,"man/cat1",-1,-1,0755);
+  d(home,"bin",-1,-1,0755);
+  d(home,"man",-1,-1,0755);
+  d(home,"man/man1",-1,-1,0755);
+  d(home,"man/cat1",-1,-1,0755);
 
-  c(auto_qmail,"bin","dot-forward",-1,-1,0755);
+  c(home,"bin","dot-forward",-1,-1,0755);
 
-  c(auto_qmail,"man/man1","dot-forward.1",-1,-1,0644);
-  c(auto_qmail,"man/cat1","dot-forward.0",-1,-1,0644);
+  c(home,"man/man1","dot-forward.1",-1,-1,0644);
+  c(home,"man/cat1","dot-forward.0",-1,-1,0644);
 }
index beec00c..59426df 100644 (file)
--- a/install.c
+++ b/install.c
@@ -5,7 +5,7 @@
 #include "readwrite.h"
 #include "exit.h"
 
-extern void hier();
+extern void hier(char *);
 
 #define FATAL "install: fatal: "
 
@@ -99,13 +99,16 @@ int mode;
     strerr_die6sys(111,FATAL,"unable to chmod .../",subdir,"/",file,": ");
 }
 
-void main()
+void main(int argc, char *argv[])
 {
+  char *home = 0;
   fdsourcedir = open_read(".");
+  if (argc > 1)
+    home = argv[1];
   if (fdsourcedir == -1)
     strerr_die2sys(111,FATAL,"unable to open current directory: ");
 
   umask(077);
-  hier();
+  hier(home);
   _exit(0);
 }
diff --git a/qmail.c b/qmail.c
index 0fe0dfa..4de4a2c 100644 (file)
--- a/qmail.c
+++ b/qmail.c
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include "substdio.h"
 #include "readwrite.h"
 #include "wait.h"
@@ -7,7 +8,15 @@
 #include "qmail.h"
 #include "auto_qmail.h"
 
-static char *binqqargs[2] = { "bin/qmail-queue", 0 } ;
+static char *binqqargs[2] = { 0, 0 } ;
+
+static void setup_qqargs()
+{
+  if(!binqqargs[0])
+    binqqargs[0] = getenv("QMAILQUEUE");
+  if(!binqqargs[0])
+    binqqargs[0] = "/usr/sbin/qmail-queue";
+}
 
 int qmail_open(qq)
 struct qmail *qq;
@@ -15,6 +24,7 @@ struct qmail *qq;
   int pim[2];
   int pie[2];
 
+  setup_qqargs();
   if (pipe(pim) == -1) return -1;
   if (pipe(pie) == -1) { close(pim[0]); close(pim[1]); return -1; }