From 6d3392f802846e1041479530ed5d569099f9f4ac Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 15 Feb 2006 18:34:50 +0000 Subject: [PATCH] Debianization, and minor fixes. --- .gitignore | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ debian/.gitignore | 2 + debian/changelog | 5 +++ debian/control | 11 +++++ debian/copyright | 7 +++ debian/rules | 55 +++++++++++++++++++++++ error.h | 2 +- hier.c | 62 +++++++++++++------------- install.c | 9 ++-- qmail.c | 12 ++++- 10 files changed, 258 insertions(+), 35 deletions(-) create mode 100644 .gitignore create mode 100644 debian/.gitignore create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100755 debian/rules diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6da49ef --- /dev/null +++ b/.gitignore @@ -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 index 0000000..8c0f814 --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,2 @@ +*.substvars +files diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..1ad84e5 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +fastforward (0.51-1) experimental; urgency=low + + * Debianization! + + -- Mark Wooding Thu, 6 Oct 2005 12:22:15 +0100 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..83f269e --- /dev/null +++ b/debian/control @@ -0,0 +1,11 @@ +Source: fastforward +Section: mail +Priority: extra +Maintainer: Mark Wooding +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 index 0000000..b084bae --- /dev/null +++ b/debian/copyright @@ -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 index 0000000..044b80f --- /dev/null +++ b/debian/rules @@ -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 extern int error_intr; extern int error_nomem; diff --git a/hier.c b/hier.c index b5caa7f..86f2d0b 100644 --- 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); } diff --git a/install.c b/install.c index beec00c..59426df 100644 --- 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 --- a/qmail.c +++ b/qmail.c @@ -1,3 +1,4 @@ +#include #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; } -- 2.11.0