* deb: Move from here ..
[dejagnu.git] / packaging / deb / rules
blobfcf0ea9a463a7ea240c451f874dc51eccd4f0f11
1 #! /usr/bin/make -f
3 # Copyright 1994, 1995 by Ian Jackson.
4 # I hereby give you perpetual unlimited permission to copy,
5 # modify and relicense this file, provided that you do not remove
6 # my name from the file itself. (I assert my moral right of
7 # paternity under the Copyright, Designs and Patents Act 1988.)
8 # This file may have to be extensively modified
9 # Copyright 1996 by Kevin Dalley.
11 # To make the binary distribution package, the ``Debianized'' source package
12 # and the context diff to the original package, type `./debian.rules dist'.
13 # Make sure that `debian.rules' is executable before the final distribution
14 # is made.
16 # Invoke each target with `./debian.rules <target>'. All targets should be
17 # invoked with the package root as the current directory.
19 # The `binary' target must be run as root, as it needs to install files with
20 # specific ownerships.
22 # The name of the package (for example, `emacs').
23 package = dejagnu
25 CC = gcc
26 CFLAGS = -O2 -Wall # sane warning options vary between programs
27 LDFLAGS = # none
30 build:
31 $(checkdir)
32 ./configure --prefix=/usr
33 $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
34 libexecdir=/usr/lib/locate localstatedir=/var/lib/locate all
35 # $(MAKE)
36 touch build
38 clean:
39 $(checkdir)
40 -rm -f build
41 -$(MAKE) -i distclean
42 -rm -rf *~ debian/tmp debian/*~ debian/files*
43 rm -f config.cache doc/config.log testsuite/config.log \
44 testsuite/.tmp testsuite/dbg.log testsuite/runtest.log \
45 testsuite/runtest.sum testsuite/setval.tmp \
46 testsuite/testrun.log testsuite/testrun.sum \
47 example/testrun.sum
49 binary-indep: checkroot build
50 $(checkdir)
51 -rm -rf debian/tmp
52 install -d debian/tmp debian/tmp/DEBIAN
53 install -d debian/tmp/usr/doc/$(package)
54 install -d -g root -m 755 -o root debian/tmp/etc/$(package)
55 install debian/{postinst,preinst} debian/tmp/DEBIAN/.
56 cd $(package); $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" \
57 LDFLAGS="$(LDFLAGS)" \
58 prefix=`pwd`/debian/tmp/usr install
59 chmod 0644 debian/tmp/usr/share/dejagnu/runtest.exp
60 cd $(package); $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" \
61 LDFLAGS="$(LDFLAGS)" \
62 pkgdatadir=debian/tmp/usr/doc/$(package) install-doc
63 # gzip -9v debian/tmp/usr/info/*
64 # gzip -9v debian/tmp/usr/man/man1/*
65 install -d debian/tmp/usr/doc/$(package)/html/stylesheet-images
66 install -m 0644 doc/overview.rtf debian/tmp/usr/doc/$(package)
67 install -m 0644 doc/overview.ps debian/tmp/usr/doc/$(package)
68 install -m 0644 doc/overview.pdf debian/tmp/usr/doc/$(package)
69 install -m 0644 doc/html/*.html debian/tmp/usr/doc/$(package)/html/
70 install -m 0644 debian/copyright debian/tmp/usr/doc/$(package)
71 install -m 0644 debian/changelog debian/tmp/usr/doc/$(package)/changelog.Debian
72 gzip -9v debian/tmp/usr/doc/$(package)/changelog.Debian
73 install -m 0644 ChangeLog debian/tmp/usr/doc/$(package)
74 gzip -9v debian/tmp/usr/doc/$(package)/ChangeLog
75 ln -s ChangeLog.gz debian/tmp/usr/doc/$(package)/changelog.gz
76 install -g root -m 644 -o root debian/site.exp \
77 debian/tmp/etc/$(package)/site.exp
78 cd debian/tmp/usr/lib/$(package); ln -fs /etc/$(package)/site.exp .
79 # install -d debian/tmp/usr/doc/$(package)/examples
80 -cd example; $(MAKE) -i distclean
81 # (cd example; tar cf - . ) | \
82 # (cd debian/tmp/usr/doc/$(package)/examples; tar xf -)
83 # install debian/tmp/usr/doc/$(package)/examples
84 dpkg-gencontrol
85 # chown -R root.root debian/tmp
86 # chmod -R g-ws debian/tmp
87 dpkg --build debian/tmp ..
89 binary-arch:
91 define checkdir
92 test -f runtest.exp -a -f debian/rules
93 endef
94 # Below here is fairly generic really
96 binary: binary-indep
98 source diff:
99 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
101 checkroot:
102 $(checkdir)
103 test root = "`whoami`"
105 .PHONY: binary binary-arch binary-indep clean checkroot