Debianization, and minor fixes. master
authorMark Wooding <mdw@distorted.org.uk>
Wed, 15 Feb 2006 18:34:50 +0000 (18:34 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 15 Feb 2006 18:34:50 +0000 (18:34 +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..6da49ef
--- /dev/null
@@ -0,0 +1,128 @@
+alloc.a
+alloc.o
+alloc_re.o
+auto-ccld.sh
+auto-str
+auto-str.o
+auto_qmail.c
+auto_qmail.o
+byte_chr.o
+byte_copy.o
+byte_cr.o
+byte_diff.o
+case.a
+case_lowerb.o
+cdb.a
+cdb_hash.o
+cdb_seek.o
+cdb_unpack.o
+cdbmake.a
+cdbmake_add.o
+cdbmake_hash.o
+cdbmake_pack.o
+cdbmss.o
+check
+coe.o
+compile
+control.o
+env.a
+envread.o
+error.a
+error.o
+error_str.o
+fastforward
+fastforward.0
+fastforward.o
+fd.a
+fd_copy.o
+fd_move.o
+find-systype
+fmt_ulong.o
+fork.h
+fs.a
+getln.a
+getln.o
+getln2.o
+getopt.a
+hassgact.h
+haswaitp.h
+hier.o
+install
+install.o
+instcheck
+instcheck.o
+it
+load
+make-compile
+make-load
+make-makelib
+makelib
+man
+newaliases
+newaliases.0
+newaliases.o
+newinclude
+newinclude.0
+newinclude.o
+open.a
+open_read.o
+open_trunc.o
+printforward
+printforward.0
+printforward.o
+printmaillist
+printmaillist.0
+printmaillist.o
+prog
+qmail.o
+scan_ulong.o
+seek.a
+seek_set.o
+setforward
+setforward.0
+setforward.o
+setmaillist
+setmaillist.0
+setmaillist.o
+setup
+sgetopt.o
+sig.a
+sig_catch.o
+sig_pipe.o
+slurpclose.o
+str.a
+str_chr.o
+str_cpy.o
+str_diff.o
+str_diffn.o
+str_len.o
+str_rchr.o
+stralloc.a
+stralloc_arts.o
+stralloc_cat.o
+stralloc_catb.o
+stralloc_cats.o
+stralloc_copy.o
+stralloc_eady.o
+stralloc_opyb.o
+stralloc_opys.o
+stralloc_pend.o
+strerr.a
+strerr_die.o
+strerr_sys.o
+strset.o
+subfderr.o
+subfdins.o
+subfdouts.o
+subgetopt.o
+substdi.o
+substdio.a
+substdio.o
+substdio_copy.o
+substdo.o
+systype
+token822.o
+uint32.h
+wait.a
+wait_pid.o
+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..1ad84e5
--- /dev/null
@@ -0,0 +1,5 @@
+fastforward (0.51-1) experimental; urgency=low
+
+  * Debianization!
+
+ -- Mark Wooding <mdw@distorted.org.uk>  Thu,  6 Oct 2005 12:22:15 +0100
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..83f269e
--- /dev/null
@@ -0,0 +1,11 @@
+Source: fastforward
+Section: mail
+Priority: extra
+Maintainer: Mark Wooding <mdw@distorted.org.uk>
+Standards-Version: 3.1.1
+
+Package: fastforward
+Architecture: any
+Depends: ${shlibs:Depends}, qmail
+Description: /etc/aliases support for qmail
+ Nuff said.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..b084bae
--- /dev/null
@@ -0,0 +1,7 @@
+fastforward 0.51, alpha.
+19980519
+Copyright 1998
+D. J. Bernstein, djb@pobox.com
+
+You may distribute unmodified copies of the fastforward package.
+
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..044b80f
--- /dev/null
@@ -0,0 +1,55 @@
+#! /usr/bin/make -f
+
+export DH_COMPAT = 4
+
+mdw-setup:
+       upstream=`git-describe djb | sed 's:^djb/::'`; \
+       dir=fastforward_$$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/fastforward/usr
+       ./install `pwd`/debian/fastforward/usr
+       mkdir -p debian/fastforward/usr/share
+       mv debian/fastforward/usr/man debian/fastforward/usr/share
+       mv debian/fastforward/usr/doc debian/fastforward/usr/share
+       rm -rf debian/fastforward/usr/share/man/cat*
+       rm -rf debian/fastforward/usr/doc
+       cp ALIASES BLURB CHANGES INSTALL THANKS TODO \
+         debian/fastforward/usr/share/doc/fastforward
+
+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 b5caa7f..86f2d0b 100644 (file)
--- a/hier.c
+++ b/hier.c
@@ -1,39 +1,41 @@
 #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,"doc",-1,-1,0755);
-  d(auto_qmail,"doc/fastforward",-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,"doc",-1,-1,0755);
+  d(home,"doc/fastforward",-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","fastforward",-1,-1,0755);
-  c(auto_qmail,"bin","printforward",-1,-1,0755);
-  c(auto_qmail,"bin","setforward",-1,-1,0755);
-  c(auto_qmail,"bin","newaliases",-1,-1,0755);
-  c(auto_qmail,"bin","printmaillist",-1,-1,0755);
-  c(auto_qmail,"bin","setmaillist",-1,-1,0755);
-  c(auto_qmail,"bin","newinclude",-1,-1,0755);
+  c(home,"bin","fastforward",-1,-1,0755);
+  c(home,"bin","printforward",-1,-1,0755);
+  c(home,"bin","setforward",-1,-1,0755);
+  c(home,"bin","newaliases",-1,-1,0755);
+  c(home,"bin","printmaillist",-1,-1,0755);
+  c(home,"bin","setmaillist",-1,-1,0755);
+  c(home,"bin","newinclude",-1,-1,0755);
 
-  c(auto_qmail,"doc/fastforward","ALIASES",-1,-1,0644);
+  c(home,"doc/fastforward","ALIASES",-1,-1,0644);
 
-  c(auto_qmail,"man/man1","fastforward.1",-1,-1,0644);
-  c(auto_qmail,"man/man1","printforward.1",-1,-1,0644);
-  c(auto_qmail,"man/man1","setforward.1",-1,-1,0644);
-  c(auto_qmail,"man/man1","newaliases.1",-1,-1,0644);
-  c(auto_qmail,"man/man1","printmaillist.1",-1,-1,0644);
-  c(auto_qmail,"man/man1","setmaillist.1",-1,-1,0644);
-  c(auto_qmail,"man/man1","newinclude.1",-1,-1,0644);
+  c(home,"man/man1","fastforward.1",-1,-1,0644);
+  c(home,"man/man1","printforward.1",-1,-1,0644);
+  c(home,"man/man1","setforward.1",-1,-1,0644);
+  c(home,"man/man1","newaliases.1",-1,-1,0644);
+  c(home,"man/man1","printmaillist.1",-1,-1,0644);
+  c(home,"man/man1","setmaillist.1",-1,-1,0644);
+  c(home,"man/man1","newinclude.1",-1,-1,0644);
 
-  c(auto_qmail,"man/cat1","fastforward.0",-1,-1,0644);
-  c(auto_qmail,"man/cat1","printforward.0",-1,-1,0644);
-  c(auto_qmail,"man/cat1","setforward.0",-1,-1,0644);
-  c(auto_qmail,"man/cat1","newaliases.0",-1,-1,0644);
-  c(auto_qmail,"man/cat1","printmaillist.0",-1,-1,0644);
-  c(auto_qmail,"man/cat1","setmaillist.0",-1,-1,0644);
-  c(auto_qmail,"man/cat1","newinclude.0",-1,-1,0644);
+  c(home,"man/cat1","fastforward.0",-1,-1,0644);
+  c(home,"man/cat1","printforward.0",-1,-1,0644);
+  c(home,"man/cat1","setforward.0",-1,-1,0644);
+  c(home,"man/cat1","newaliases.0",-1,-1,0644);
+  c(home,"man/cat1","printmaillist.0",-1,-1,0644);
+  c(home,"man/cat1","setmaillist.0",-1,-1,0644);
+  c(home,"man/cat1","newinclude.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; }