Debianization and various other fixes.
[ezmlm] / debian / rules
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..6394f6b
--- /dev/null
@@ -0,0 +1,60 @@
+#! /usr/bin/make -f
+
+export DH_COMPAT = 4
+
+mdw-setup:
+       upstream=`git-describe idx | sed 's:^idx/::'`; \
+       dir=ezmlm-idx_$$upstream.orig; \
+       git-tar-tree idx $$dir | gzip -9c >../$$dir.tar.gz
+
+clean:
+       make clean std
+       dh_clean
+       rm -f build
+
+build:
+       make pgsql
+       make it install man
+       touch build
+
+install: build
+       dh_clean
+       mkdir -p debian/ezmlm-idx/usr/bin debian/ezmlm-idx/usr/share/man
+       ./install debian/ezmlm-idx/usr/bin <BIN
+       ./install debian/ezmlm-idx/usr/share/man <MAN
+       rm -rf debian/ezmlm-idx/usr/share/man/cat*
+       mkdir -p debian/ezmlm-idx/usr/share/ezmlm
+       find debian/ezmlm-idx/usr/bin ! -perm +111 -print0 | \
+               xargs -0ri mv {} debian/ezmlm-idx/usr/share/ezmlm
+       mkdir -p debian/ezmlm-cgi/usr/lib/cgi-bin
+       mkdir -p debian/ezmlm-cgi/usr/share/man/man1
+       cp ezmlm-cgi debian/ezmlm-cgi/usr/lib/cgi-bin
+       cp ezmlm-cgi.1 debian/ezmlm-cgi/usr/share/man/man1
+
+binary-indep:
+
+binary-arch: install
+       dh_testdir -a
+       dh_testroot -a
+       dh_installman -a
+       dh_compress -a
+       dh_installdocs -a
+       dh_makeshlibs -a
+       dh_fixperms -a
+       dh_strip -a
+       dh_shlibdeps -a
+       dh_gencontrol -a
+       dh_installdeb -a
+       dh_md5sums -a
+       dh_builddeb -a
+
+binary: binary-arch binary-indep
+
+source: clean mdw-setup
+       dir=`pwd | sed 's:^.*/::'`; \
+        upstream=`git-describe idx | sed 's:^idx/::'`; \
+        tarball=ezmlm-idx_$$upstream.orig.tar.gz; \
+       cd ..; \
+       dpkg-source -b -i'(?:^|/)\.git(?:$$|/)' $$dir $$tarball
+
+.PHONY: clean binary-indep binary-arch binary source mdw-setup