chiark / gitweb /
cope without main config file
[disorder] / debian / autorules.m4
CommitLineData
460b9539 1#! /usr/bin/make -f
2#
eb525fcd 3# Copyright (C) 2004, 2005, 2006, 2007 Richard Kettlewell
460b9539 4#
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.
9#
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.
14#
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
18# USA
19#
20# This file was generated automatically - edit rules.m4 instead
21#
22
23INSTALL=install
24CONFIGURE=--prefix=/usr
25
26m4_divert(-1)m4_dnl
27
28m4_changequote([,])
29
825f60a3
RK
30m4_define([build], [.PHONY: [build]
31[build]:
460b9539 32m4_syscmd([test -f ../configure || test -f ../config.status])m4_dnl
66ec39ed
RK
33m4_ifelse(m4_sysval,0,[ if test -f config.status; then \
34 ./config.status; else\
35 ./configure ${CONFIGURE} ${CONFIGURE_EXTRA}; fi
460b9539 36])m4_dnl
37 $(MAKE) prefix=/usr])m4_dnl
38
825f60a3
RK
39m4_define([binary], [.PHONY: [binary] [binary]-arch [binary]-indep
40[binary]: [binary]-arch [binary]-indep
460b9539 41[binary]-arch: _archpkgs
42[binary]-indep: _indeppkgs])
43
44m4_define([anypkg], [m4_define([_package], $1)m4_dnl
45m4_define([cleanup], cleanup [cleanpkg-$1])m4_dnl
825f60a3 46.PHONY: cleanpkg-$1
460b9539 47cleanpkg-$1:
48 rm -rf debian/$1
49
825f60a3 50.PHONY: pkg-$1
460b9539 51pkg-$1: [build]
52 rm -rf debian/$1
53 mkdir -p debian/$1
54 mkdir -p debian/$1/DEBIAN
55 mkdir -p debian/$1/usr/share/doc/$1
56 cp debian/copyright \
57 debian/$1/usr/share/doc/$1/copyright
58 cp debian/changelog \
59 debian/$1/usr/share/doc/$1/changelog.Debian
f1b2e9ac 60 gzip -9 debian/$1/usr/share/doc/$1/changelog.Debian
460b9539 61$2 dpkg-gencontrol -isp -p$1 -Pdebian/$1 -Tdebian/substvars.$1
62 chown -R root:root debian/$1
63 chmod -R g-ws debian/$1
64 dpkg --[build] debian/$1 ..
65])
66
67m4_define([_target],
68 [m4_ifelse([$2],[],[$1],[$2])])
69
70m4_define([install_usrbin],
71 [$(INSTALL) -m 755 $1 \
72 debian/_package/usr/bin/_target([$1],[$2])])
73
74m4_define([install_usrsbin],
75 [$(INSTALL) -m 755 $1 \
76 debian/_package/usr/sbin/_target([$1],[$2])])
77
78m4_define([install_bin],
79 [$(INSTALL) -m 755 $1 \
80 debian/_package/bin/_target([$1],[$2])])
81
82m4_define([install_sbin],
83 [$(INSTALL) -m 755 $1 \
84 debian/_package/sbin/_target([$1],[$2])])
85
86m4_define([_mansect],
87 [m4_patsubst([$1], [^.*\.\([^.]*\)], [\1])])
88
89m4_define([install_usrman],
90 [$(INSTALL) -m 644 $1 \
91 debian/_package/usr/share/man/man[]_mansect(_target([$1],[$2]))/_target([$1],[$2])
92 gzip -9 debian/_package/usr/share/man/man[]_mansect(_target([$1],[$2]))/_target([$1],[$2])])
93
94m4_define([install_manlink],
95 [ln -s ../man[]_mansect([$1])/$1.gz \
96 debian/_package/usr/man/man[]_mansect([$2])/$2.gz])
97
98m4_define([archpkg], [m4_define([_archpkgs], _archpkgs pkg-$1)m4_dnl
99anypkg([$1],[$2])])
100
101m4_define([indeppkg], [m4_define([_indeppkgs], _indeppkgs pkg-$1)m4_dnl
102anypkg([$1],[$2])])
103
825f60a3
RK
104m4_define([clean], [.PHONY: [clean]
105[clean]: cleanup
460b9539 106 -$(MAKE) distclean
107 rm -f config.cache
108 rm -f debian/files
109 rm -f debian/substvars.*])
110
111m4_define([cleanup], [])
112
113m4_define([_archpkgs], [])
114
115m4_define([_indeppkgs], [])
116
117m4_define([regenerate], [debian/rules: debian/autorules.m4 debian/rules.m4
118 rm -f debian/rules.tmp
825f60a3
RK
119 cd debian && \
120 m4 -P autorules.m4 rules.m4 > rules.tmp
460b9539 121 chmod 555 debian/rules.tmp
122 mv -f debian/rules.tmp debian/rules
123])
124
125m4_divert(0)m4_dnl