3 # Copyright (C) 2004, 2005, 2006, 2007 Richard Kettlewell
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 # This file was generated automatically - edit rules.m4 instead
24 CONFIGURE=--prefix=/usr
30 m4_define([build], [.PHONY: [build]
32 m4_syscmd([test -f ../configure || test -f ../config.status])m4_dnl
33 m4_ifelse(m4_sysval,0,[ if test -f config.status; then \
34 ./config.status; else\
35 ./configure ${CONFIGURE} ${CONFIGURE_EXTRA}; fi
37 $(MAKE) prefix=/usr])m4_dnl
39 m4_define([binary], [.PHONY: [binary] [binary]-arch [binary]-indep
40 [binary]: [binary]-arch [binary]-indep
41 [binary]-arch: _archpkgs
42 [binary]-indep: _indeppkgs])
44 m4_define([anypkg], [m4_define([_package], $1)m4_dnl
45 m4_define([cleanup], cleanup [cleanpkg-$1])m4_dnl
54 mkdir -p debian/$1/DEBIAN
55 mkdir -p debian/$1/usr/share/doc/$1
57 debian/$1/usr/share/doc/$1/copyright
59 debian/$1/usr/share/doc/$1/changelog.Debian
60 gzip -9 debian/$1/usr/share/doc/$1/changelog.Debian
61 @for f in preinst postinst prerm postrm conffiles templates config; do\
62 if test -e debian/$$f.$1; then\
63 echo cp debian/$$f.$1 debian/$1/DEBIAN/$$f; \
64 cp debian/$$f.$1 debian/$1/DEBIAN/$$f; \
67 $2 dpkg-gencontrol -isp -p$1 -Pdebian/$1 -Tdebian/substvars.$1
68 chown -R root:root debian/$1
69 chmod -R g-ws debian/$1
70 dpkg --[build] debian/$1 ..
74 [m4_ifelse([$2],[],[$1],[$2])])
76 m4_define([install_usrbin],
77 [$(INSTALL) -m 755 $1 \
78 debian/_package/usr/bin/_target([$1],[$2])])
80 m4_define([install_usrsbin],
81 [$(INSTALL) -m 755 $1 \
82 debian/_package/usr/sbin/_target([$1],[$2])])
84 m4_define([install_bin],
85 [$(INSTALL) -m 755 $1 \
86 debian/_package/bin/_target([$1],[$2])])
88 m4_define([install_sbin],
89 [$(INSTALL) -m 755 $1 \
90 debian/_package/sbin/_target([$1],[$2])])
93 [m4_patsubst([$1], [^.*\.\([^.]*\)], [\1])])
95 m4_define([install_usrman],
96 [$(INSTALL) -m 644 $1 \
97 debian/_package/usr/share/man/man[]_mansect(_target([$1],[$2]))/_target([$1],[$2])
98 gzip -9 debian/_package/usr/share/man/man[]_mansect(_target([$1],[$2]))/_target([$1],[$2])])
100 m4_define([install_manlink],
101 [ln -s ../man[]_mansect([$1])/$1.gz \
102 debian/_package/usr/man/man[]_mansect([$2])/$2.gz])
104 m4_define([archpkg], [m4_define([_archpkgs], _archpkgs pkg-$1)m4_dnl
107 m4_define([indeppkg], [m4_define([_indeppkgs], _indeppkgs pkg-$1)m4_dnl
110 m4_define([clean], [.PHONY: [clean]
115 rm -f debian/substvars.*])
117 m4_define([cleanup], [])
119 m4_define([_archpkgs], [])
121 m4_define([_indeppkgs], [])
123 m4_define([regenerate], [debian/rules: debian/autorules.m4 debian/rules.m4
124 rm -f debian/rules.tmp
126 m4 -P autorules.m4 rules.m4 > rules.tmp
127 chmod 555 debian/rules.tmp
128 mv -f debian/rules.tmp debian/rules