From 63ee33181bf4a66cf42a8be6df93c24bf924d2d9 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 15 Feb 2006 18:44:50 +0000 Subject: [PATCH] Debianization. --- .gitignore | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ debian/.gitignore | 2 ++ debian/changelog | 5 ++++ debian/control | 11 +++++++ debian/copyright | 4 +++ debian/rules | 55 ++++++++++++++++++++++++++++++++++ error.h | 2 +- hier.c | 20 +++++++------ install.c | 9 ++++-- qmail.c | 12 +++++++- 10 files changed, 195 insertions(+), 14 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..c89323d --- /dev/null +++ b/.gitignore @@ -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 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..6adcdac --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +dot-forward (0.71-1) experimental; urgency=low + + * Debianization! + + -- Mark Wooding Thu, 6 Oct 2005 12:41:04 +0100 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..aca933f --- /dev/null +++ b/debian/control @@ -0,0 +1,11 @@ +Source: dot-forward +Section: mail +Priority: extra +Maintainer: Mark Wooding +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 index 0000000..f5f7140 --- /dev/null +++ b/debian/copyright @@ -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 index 0000000..c9af57a --- /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=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 extern int error_intr; extern int error_nomem; diff --git a/hier.c b/hier.c index 05a32cb..14e476a 100644 --- 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); } 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