chiark / gitweb /
Switch to GPL v3
[disorder] / debian / rules
index c11698c235564b4ebcde79700feb117d601143c5..86d835a413b69f0903bb029063ff4f0740705ce8 100755 (executable)
@@ -2,24 +2,26 @@
 #
 # Copyright (C) 2004-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# This program 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
+# the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
-# This program 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.
-#
+# This program 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 received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
+cgiexecdir=/usr/lib/cgi-bin
+httpdir=/var/www
+browser=x-www-browser
+
 # Options to configure.  This can be overridden by the caller if necessary.
-CONFIGURE=--prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --mandir=/usr/share/man --with-browser=x-www-browser
+CONFIGURE=--prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --mandir=/usr/share/man --with-browser=${browser} cgiexecdir="${cgiexecdir}" httpdir="${httpdir}"
 
 # Set DEB_BUILD_OPTIONS=noopt to produce a non-optimized build.
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
@@ -45,30 +47,29 @@ export INSTALL_DATA
 export INSTALL_SCRIPT
 export INSTALL_PROGRAM
 
+# We override sendmail to the value defined in policy, in case configure picks
+# up some other sendmail.
+SENDMAIL=/usr/sbin/sendmail
+
 LIBTOOL=./libtool
 FAKEROOT=fakeroot
 
-.PHONY: build
 # ./prepare is the script that generates configure etc.  It only needs to be
 # run if building from a checkout rather than a tarball.
 build:
-       @if test ! -f configure; then \
-         echo ./prepare ${CONFIGURE} ${CONFIGURE_EXTRA};\
-         ./prepare ${CONFIGURE} ${CONFIGURE_EXTRA};\
-       elif test ! -f config.status; then \
+       @set -e;if test ! -f configure; then \
+         echo ./prepare;\
+         ./prepare;\
+       fi
+       @set -e;if test ! -f config.status; then \
          echo ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\
          ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\
        else\
          echo ./config.status;\
          ./config.status;\
        fi
-       $(MAKE)
-
-.PHONY: cleanpkg-disorder
-cleanpkg-disorder:
-       rm -rf debian/disorder
+       $(MAKE) SENDMAIL=${SENDMAIL}
 
-.PHONY: pkg-disorder
 pkg-disorder: build
        rm -rf debian/disorder
        $(MKDIR) debian/disorder
@@ -93,21 +94,22 @@ pkg-disorder: build
                debian/disorder/etc/bash_completion.d/disorder
        rm -rf debian/disorder/usr/share/man/man8
        rm -rf debian/disorder/usr/share/disorder/*.html
+       rm -rf debian/disorder/usr/share/disorder/*.tmpl
        rmdir debian/disorder/usr/share/disorder
        rm -f debian/disorder/usr/bin/disorder-playrtp
        rm -f debian/disorder/usr/bin/disobedience
        rm -f debian/disorder/usr/share/man/man1/disorder-playrtp.1
        rm -f debian/disorder/usr/share/man/man1/disobedience.1
+       rm -f debian/disorder/usr/share/man/man5/disorder_templates.5
+       rm -f debian/disorder/usr/share/man/man5/disorder_actions.5
+       rm -f debian/disorder/usr/share/man/man5/disorder_options.5
        $(MKDIR) debian/disorder/etc/disorder
        dpkg-shlibdeps -Tdebian/substvars.disorder \
                debian/disorder/usr/bin/*
-       $(INSTALL_DATA) CHANGES README debian/README.Debian \
+       $(INSTALL_DATA) CHANGES.html README debian/README.Debian \
                BUGS README.* \
                debian/disorder/usr/share/doc/disorder/.
-       rm -f debian/disorder/usr/share/doc/disorder/README.mac
-       rm -f debian/disorder/usr/share/doc/disorder/README.freebsd
-       gzip -9f debian/disorder/usr/share/doc/disorder/CHANGES \
-                debian/disorder/usr/share/doc/disorder/README \
+       gzip -9f debian/disorder/usr/share/doc/disorder/README \
                 debian/disorder/usr/share/doc/disorder/README.* \
                 debian/disorder/usr/share/doc/disorder/BUGS \
                 debian/disorder/usr/share/man/man*/*
@@ -116,12 +118,6 @@ pkg-disorder: build
        chmod -R g-ws debian/disorder
        dpkg --build debian/disorder ..
 
-
-.PHONY: cleanpkg-disorder-server
-cleanpkg-disorder-server:
-       rm -rf debian/disorder-server
-
-.PHONY: pkg-disorder-server
 pkg-disorder-server: build
        rm -rf debian/disorder-server
        $(MKDIR) debian/disorder-server
@@ -138,19 +134,20 @@ pkg-disorder-server: build
            $(INSTALL_SCRIPT) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
          fi;\
        done
-       $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C images
-       $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C server
-       $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C templates
-       $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C driver
-       $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C plugins
-       $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C sounds
-       $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C doc
+       $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C images
+       $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C server
+       $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C templates
+       $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C driver
+       $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C plugins
+       $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C sounds
+       $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C doc
        rm -rf debian/disorder-server/usr/share/man/man1
        rm -rf debian/disorder-server/usr/share/man/man3
-       rm -rf debian/disorder-server/usr/share/man/man5
+       rm -f debian/disorder-server/usr/share/man/man5/disorder_config.5
+       rm -f debian/disorder-server/usr/share/man/man5/disorder_protocol.5
        $(MKDIR) debian/disorder-server/etc/disorder
        $(MKDIR) debian/disorder-server/etc/init.d
-       $(MKDIR) debian/disorder-server/usr/lib/cgi-bin
+       $(MKDIR) debian/disorder-server${cgiexecdir}
        $(MKDIR) debian/disorder-server/var/lib/disorder
        $(INSTALL_SCRIPT) examples/disorder.init \
                debian/disorder-server/etc/init.d/disorder
@@ -160,10 +157,10 @@ pkg-disorder-server: build
                debian/disorder-server/etc/disorder/options
        $(INSTALL_DATA) debian/etc.disorder.options.user \
                debian/disorder-server/etc/disorder/options.user
-       $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) server/disorder.cgi \
-               $(shell pwd)/debian/disorder-server/usr/lib/cgi-bin/disorder
+       $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) cgi/disorder \
+               $(shell pwd)/debian/disorder-server${cgiexecdir}/disorder
        dpkg-shlibdeps -Tdebian/substvars.disorder-server \
-               debian/disorder-server/usr/lib/cgi-bin/disorder \
+               debian/disorder-server${cgiexecdir}/disorder \
                debian/disorder-server/usr/sbin/* \
                debian/disorder-server/usr/lib/disorder/*.so*
        rm -rf debian/disorder-server/usr/share/doc/disorder-server
@@ -173,12 +170,6 @@ pkg-disorder-server: build
        chmod -R g-ws debian/disorder-server
        dpkg --build debian/disorder-server ..
 
-
-.PHONY: cleanpkg-disorder-playrtp
-cleanpkg-disorder-playrtp:
-       rm -rf debian/disorder-playrtp
-
-.PHONY: pkg-disorder-playrtp
 pkg-disorder-playrtp: build
        rm -rf debian/disorder-playrtp
        $(MKDIR) debian/disorder-playrtp
@@ -205,20 +196,13 @@ pkg-disorder-playrtp: build
                debian/disorder-playrtp/usr/bin/*
        $(INSTALL_DATA) debian/README.RTP \
                debian/disorder-playrtp/usr/share/doc/disorder-playrtp/README
-       $(INSTALL_DATA) CHANGES debian/disorder-playrtp/usr/share/doc/disorder-playrtp/CHANGES
-       gzip -9f debian/disorder-playrtp/usr/share/doc/disorder-playrtp/CHANGES \
-                debian/disorder-playrtp/usr/share/man/man*/*
+       $(INSTALL_DATA) CHANGES.html debian/disorder-playrtp/usr/share/doc/disorder-playrtp/CHANGES.html
+       gzip -9f debian/disorder-playrtp/usr/share/man/man*/*
        dpkg-gencontrol -isp -pdisorder-playrtp -Pdebian/disorder-playrtp -Tdebian/substvars.disorder-playrtp
        chown -R root:root debian/disorder-playrtp
        chmod -R g-ws debian/disorder-playrtp
        dpkg --build debian/disorder-playrtp ..
 
-
-.PHONY: cleanpkg-disobedience
-cleanpkg-disobedience:
-       rm -rf debian/disobedience
-
-.PHONY: pkg-disobedience
 pkg-disobedience: build
        rm -rf debian/disobedience
        $(MKDIR) debian/disobedience
@@ -256,7 +240,6 @@ pkg-disobedience: build
        chmod -R g-ws debian/disobedience
        dpkg --build debian/disobedience ..
 
-
 DEBVERSION:=$(shell dpkg-parsechangelog|awk '/Version:/ {print $$2}')
 DSC=disorder_$(DEBVERSION).dsc
 DEBSRC=disorder_$(DEBVERSION).tar.gz
@@ -274,16 +257,20 @@ source-check: source
        dpkg-source -x $(DSC)
        cd disorder-$(DEBVERSION) && dpkg-buildpackage -r$(FAKEROOT)
 
-.PHONY: source source-check
-
-.PHONY: binary binary-arch binary-indep
 binary: binary-arch binary-indep
-binary-arch:  pkg-disorder pkg-disorder-server pkg-disorder-playrtp pkg-disobedience
+binary-arch: pkg-disorder pkg-disorder-server pkg-disorder-playrtp \
+            pkg-disobedience
 binary-indep: 
 
-.PHONY: clean
-clean:  cleanpkg-disorder cleanpkg-disorder-server cleanpkg-disorder-playrtp cleanpkg-disobedience
+clean:
        -$(MAKE) distclean
        rm -f config.cache
        rm -f debian/files
        rm -f debian/substvars.*
+       rm -rf debian/disorder
+       rm -rf debian/disorder-server
+       rm -rf debian/disorder-playrtp
+       rm -rf debian/disobedience
+
+.PHONY: clean build pkg-disorder pkg-disorder-server pkg-disorder-playrtp \
+       pkg-disobedience source source-check binary binary-arch binary-indep