chiark / gitweb /
Debianization.
authormdw <mdw>
Thu, 13 Nov 2003 11:47:18 +0000 (11:47 +0000)
committermdw <mdw>
Thu, 13 Nov 2003 11:47:18 +0000 (11:47 +0000)
.cvsignore
Makefile
debian/.cvsignore [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/inst [new file with mode: 0644]
debian/rules [new file with mode: 0755]

index 04d6c7a057b258842be018962b01040c77fc72c5..0088593f143b8b40ff2467d9911348049e76fb5b 100644 (file)
@@ -1,3 +1,4 @@
 cdb-check-domain cdb-probe not qmail-checkspam
 gorp if-mtu locking
 shadowfix.8
+build *.tar.gz
index d74a07068e3e416f6069a805532090773c283d8a..00eadb4a9cc849212583077b1317e98ffbc7c0fb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,51 +2,34 @@
 ##
 ## No proper build system here.  Just kludgy hacks.
 
+PACKAGE = nsict-utils
 VERSION = 1.1.0
 
-BINSCRIPTS = \
-       cdb-assign cdb-list check-sender \
-       unfwd splitconf z
-
-SBINSCRIPTS = \
-       shadowfix
-
+BINSCRIPTS = cdb-assign cdb-list check-sender unfwd splitconf z
+SBINSCRIPTS = shadowfix
 SCRIPTS = $(BINSCRIPTS) $(SBINSCRIPTS)
-
-BINPROGS = \
-       not \
-       cdb-probe cdb-check-domain \
-       gorp \
-       locking if-mtu
-
-SBINPROGS = \
-       qmail-checkspam
-
+BINPROGS = not cdb-probe cdb-check-domain gorp locking if-mtu
+SBINPROGS = qmail-checkspam
 PROGS = $(BINPROGS) $(SBINPROGS)
-
 PERLLIBS = MdwOpt.pm
-
-LIBS = \
-       xtitle.so
-
-MAN1 = \
-       not.1 z.1 \
-       cdb-assign.1 cdb-list.1 cdb-probe.1 cdb-check-domain.1 \
-       gorp.1 \
-       unfwd.1 splitconf.1 locking.1 if-mtu.1
-
-MAN8 = \
-       qmail-checkspam.8 \
-       shadowfix.8
-
-BUILDFILES = \
-       shadowfix.8
+LIBS = xtitle.so
+DISTMAN1 = \
+       not.1 z.1 cdb-assign.1 cdb-list.1 cdb-probe.1 cdb-check-domain.1 \
+       gorp.1 unfwd.1 splitconf.1 locking.1 if-mtu.1
+MAN1 = $(DISTMAN1)
+DISTMAN8 = qmail-checkspam.8
+MAN8 = $(DISTMAN8) shadowfix.8
+BUILDFILES = shadowfix.8
+SOURCES = \
+       not.c cdb-probe.c cdb-check-domain.c gorp.c locking.c if-mtu.c \
+       qmail-checkspam.c xtitle.c
 
 CC = gcc
 LD = gcc
 CFLAGS = -O2 -g -pedantic -Wall -DVERSION=\"$(VERSION)\"
 LINK = $(LD) $(LDFLAGS) -o $@ $^
 
+INST = 
 prefix = /usr/local
 bindir = $(prefix)/bin
 sbindir = $(prefix)/sbin
@@ -59,18 +42,26 @@ perllibdir = $(libdir)/site_perl
 all: $(BUILDFILES) $(PROGS) $(LIBS)
 
 install: all
-       [ -d $(libdir) ] || install -d $(libdir)
-       install -m644 $(LIBS) $(libdir)
-       [ -d $(perllibdir) ] || install -d $(perllibdir)
-       install -m644 $(PERLLIBS) $(perllibdir)
-       [ -d $(bindir) ] || install -d $(bindir)
-       install -m775 $(BINPROGS) $(BINSCRIPTS) $(bindir)
-       [ -d $(sbindir) ] || install -d $(sbindir)
-       install -m775 $(SBINPROGS) $(SBINSCRIPTS) $(sbindir)
-       [ -d $(man1dir) ] || install -d $(man1dir)
-       install -m644 $(MAN1) $(man1dir)
-       [ -d $(man8dir) ] || install -d $(man8dir)
-       install -m644 $(MAN8) $(man8dir)
+       [ -d $(INST)$(libdir) ] || install -d $(INST)$(libdir)
+       install -m644 $(LIBS) $(INST)$(libdir)
+       [ -d $(INST)$(perllibdir) ] || install -d $(INST)$(perllibdir)
+       install -m644 $(PERLLIBS) $(INST)$(perllibdir)
+       [ -d $(INST)$(bindir) ] || install -d $(INST)$(bindir)
+       install -m775 $(BINPROGS) $(BINSCRIPTS) $(INST)$(bindir)
+       [ -d $(INST)$(sbindir) ] || install -d $(INST)$(sbindir)
+       install -m775 $(SBINPROGS) $(SBINSCRIPTS) $(INST)$(sbindir)
+       [ -d $(INST)$(man1dir) ] || install -d $(INST)$(man1dir)
+       install -m644 $(MAN1) $(INST)$(man1dir)
+       [ -d $(INST)$(man8dir) ] || install -d $(INST)$(man8dir)
+       install -m644 $(MAN8) $(INST)$(man8dir)
+
+uninstall:
+       for i in $(LIBS); do rm -f $(INST)$(libdir)/$$i; done
+       for i in $(PERLLIBS); do rm -f $(INST)$(perllibdir)/$$i; done
+       for i in $(BINPROGS); do rm -f $(INST)$(bindir)/$$i; done
+       for i in $(SBINPROGS); do rm -f $(INST)$(sbindir)/$$i; done
+       for i in $(MAN1); do rm -f $(INST)$(man1dir)/$$i; done
+       for i in $(MAN8); do rm -f $(INST)$(man8dir)/$$i; done
 
 qmail-checkspam: qmail-checkspam.o
        $(LINK) -lspamc
@@ -104,4 +95,43 @@ shadowfix.8: shadowfix
 
 clean:; rm -f *.o *~ $(PROGS) $(OTHERS)
 
-.PHONY: all clean install
+DISTDIR = $(PACKAGE)-$(VERSION)
+DISTFILES = \
+       Makefile \
+       $(SCRIPTS) $(DISTMAN1) $(DISTMAN8) $(SOURCES) $(PERLLIBS) \
+       debian/changelog debian/control debian/copyright \
+       debian/rules debian/inst
+distdir: $(DISTFILES)
+       $(RM) -rf $(DISTDIR)
+       mkdir $(DISTDIR) $(DISTDIR)/debian
+       for i in $(DISTFILES); do \
+         case $$i in \
+           */*) \
+             dir=$${i%/*}; \
+             up=`echo $$dir | sed 's:[^/]\+:..:g'`; \
+             mkdir -p $(DISTDIR)/$$dir;; \
+           *) dir= up=;; \
+         esac; \
+         ln -s ../$$up/$$i $(DISTDIR)/$$i; \
+       done
+disttar: distdir
+       tar chofz $(INST)$(DISTDIR).tar.gz $(DISTDIR)
+dist: disttar
+       $(RM) -rf $(DISTDIR)
+distcheck: dist
+       @echo "*** Packing..."
+       $(MAKE) dist
+       @echo "*** Unpacking..."
+       tar xfz $(DISTDIR).tar.gz
+       @echo "*** Test building..."
+       set -e; \
+       cd $(DISTDIR); \
+       $(MAKE) clean; \
+       $(MAKE); \
+       $(MAKE) install INST=inst; \
+       $(MAKE) dist
+       @echo "*** Tidying up..."
+       rm -rf $(DISTDIR)
+       @echo "*** All OK"
+
+.PHONY: all clean install dist distdir disttar
diff --git a/debian/.cvsignore b/debian/.cvsignore
new file mode 100644 (file)
index 0000000..2676d6c
--- /dev/null
@@ -0,0 +1,3 @@
+*.debhelper files *.substvars
+gorp if-mtu locking mdwopt-perl nsict-cdb nsict-mail qmail-checkspam shadowfix splitconf xtitle zz
+nsict-utils
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..040a1cb
--- /dev/null
@@ -0,0 +1,5 @@
+nsict-utils (1.0) experimental; urgency=low
+  
+  * Debianization!
+  
+ -- Mark Wooding <mdw@nsict.org>  Wed, 12 Nov 2003 20:17:35 +0000
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..cf1f43b
--- /dev/null
@@ -0,0 +1,79 @@
+Source: nsict-utils
+Section: utils
+Priority: extra
+Maintainer: Mark Wooding <mdw@nsict.org>
+Standards-Version: 3.1.1
+
+Package: nsict-utils
+Architecture: all
+Section: utils
+Depends: mdwopt-perl, nsict-cdb, locking, qmail-checkspam, nsict-mail,
+ if-mtu, shadowfix, zz, gorp, splitconf, xtitle
+Description: Dummy package for convenience.
+
+Package: mdwopt-perl
+Architecture: all
+Section: libs
+Depends: perl5
+Description: Options parser library for perl.
+
+Package: nsict-cdb
+Architecture: any
+Section: utils
+Depends: ${shlibs:Depends}, perl5, libcdb-file-perl
+Description: Simple utilities for messing with CDB files.
+
+Package: locking
+Architecture: any
+Section: utils
+Depends: ${shlibs:Depends}
+Description: Run a program while holding a file lock.
+
+Package: qmail-checkspam
+Architecture: any
+Section: mail
+Depends: ${shlibs:Depends}, qmail
+Suggests: spamassassin
+Description: Check mail for spamminess before queueing it.
+
+Package: nsict-mail
+Architecture: all
+Section: mail
+Depends: qmail, nsict-cdb, perl5, libmime-perl
+Description: Some simple scripts for mail handling.
+
+Package: if-mtu
+Architecture: any
+Section: utils
+Depends: ${shlibs:Depends}
+Description: Report the MTU of a network interface.
+
+Package: shadowfix
+Architecture: all
+Section: utils
+Depends: perl5, mdwopt-perl
+Description: Check and fix shadow password and group files.
+
+Package: zz
+Architecture: all
+Section: utils
+Description: Run a program, automatically decompressing its argument files.
+
+Package: xtitle
+Architecture: any
+Depends: ${shlibs:Depends}, bash (>= 2.0.0)
+Recommends: x-terminal-emulator
+Section: utils
+Description: Bash builtin for messing with xterm title bars.
+
+Package: splitconf
+Architecture: all
+Depends: tclsh
+Section: utils
+Description: Gather little config files into one big one.
+
+Package: gorp
+Architecture: any
+Depends: ${shlibs:Depends}
+Section: utils
+Description: Print a random base64 string.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..a297ff3
--- /dev/null
@@ -0,0 +1,16 @@
+nsict-utils is copyright (c) 2003 Mark Wooding
+
+nsict-utils is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+nsict-utils is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have a copy of the GNU General Public License in
+/usr/share/common-licenses/GPL; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+USA.
diff --git a/debian/inst b/debian/inst
new file mode 100644 (file)
index 0000000..9052cc6
--- /dev/null
@@ -0,0 +1,30 @@
+MdwOpt.pm mdwopt-perl /usr/share/perl5
+cdb-assign nsict-cdb /usr/bin
+cdb-assign.1 nsict-cdb /usr/share/man/man1
+cdb-check-domain nsict-cdb /usr/bin
+cdb-check-domain.1 nsict-cdb /usr/share/man/man1
+cdb-list nsict-cdb /usr/bin
+cdb-list.1 nsict-cdb /usr/share/man/man1
+cdb-probe nsict-cdb /usr/bin
+cdb-probe.1 nsict-cdb /usr/share/man/man1
+check-sender nsict-mail /usr/bin
+check-sender.1 nsict-mail /usr/share/man/man1
+gorp gorp /usr/bin
+gorp.1 gorp /usr/share/man/man1
+if-mtu if-mtu /usr/sbin
+if-mtu.1 if-mtu /usr/share/man/man1
+locking locking /usr/bin
+locking.1 locking /usr/share/man/man1
+not nsict-mail /usr/bin
+not.1 nsict-mail /usr/share/man/man1
+qmail-checkspam qmail-checkspam /usr/sbin
+qmail-checkspam.8 qmail-checkspam /usr/share/man/man8
+shadowfix shadowfix /usr/sbin
+shadowfix.8 shadowfix /usr/share/man/man8
+splitconf splitconf /usr/bin
+splitconf.1 splitconf /usr/share/man/man1
+unfwd nsict-mail /usr/bin
+unfwd.1 nsict-mail /usr/share/man/man1
+xtitle.so xtitle /usr/lib/bash/
+z zz /usr/bin
+z.1 zz /usr/share/man/man1
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..2360dcc
--- /dev/null
@@ -0,0 +1,56 @@
+#! /usr/bin/make -f
+
+export DH_COMPAT = 4
+
+build:
+       make
+       touch build
+
+clean:
+       dh_clean
+       make clean
+       rm -f build
+
+install: build
+       dh_clean
+       while read file package dir; do \
+         mkdir -p debian/$$package$$dir; \
+         cp $$file debian/$$package$$dir/$$file; \
+       done <debian/inst
+       mkdir -p debian/nsict-utils
+
+binary-indep: 
+       dh_testdir -i
+       dh_testroot -i
+       dh_compress -i
+       dh_installdocs -i
+       dh_gencontrol -i
+       dh_fixperms -i
+       dh_installdeb -i
+       dh_md5sums -i
+       dh_builddeb -i
+
+binary-arch:
+       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: install binary-indep binary-arch
+
+source:
+       rm -rf =inst=
+       mkdir -p =inst=/=deb=
+       make dist INST==inst=/
+       cd =inst=/=deb=; tar xvfz ../*.tar.gz
+       d=`pwd`; cd ..; dpkg-source -i -b $$d/=inst=/=deb=/*
+       rm -rf =inst=
+
+.PHONY: binary binary-arch binary-indep clean install source