aboutsummaryrefslogtreecommitdiff
path: root/debian/rules
blob: bb929c65c5e27879314db3bf137e28c4072874a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#! /usr/bin/make -f
#
# Copyright 1994,1995 by Ian Jackson.
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself.  (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
# This file may have to be extensively modified
# Copyright 1996 by Kevin Dalley.

# To make the binary distribution package, the ``Debianized'' source package
# and the context diff to the original package, type `./debian.rules dist'.
# Make sure that `debian.rules' is executable before the final distribution
# is made.
#
# Invoke each target with `./debian.rules <target>'.  All targets should be
# invoked with the package root as the current directory.
#
# The `binary' target must be run as root, as it needs to install files with
# specific ownerships.

# The name of the package (for example, `emacs').
package = dejagnu

CC = gcc
CFLAGS = -O2 -Wall # sane warning options vary between programs
LDFLAGS = # none


build:
	$(checkdir)
	./configure --prefix=/usr
	$(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
	  libexecdir=/usr/lib/locate localstatedir=/var/lib/locate all
#	$(MAKE) 
	touch build

clean:
	$(checkdir)
	-rm -f build
	-$(MAKE) -i distclean
	-rm -rf *~ debian/tmp debian/*~ debian/files*
	rm -f config.cache doc/config.log testsuite/config.log \
		testsuite/.tmp testsuite/dbg.log testsuite/runtest.log \
		testsuite/runtest.sum testsuite/setval.tmp \
		testsuite/testrun.log testsuite/testrun.sum \
		example/testrun.sum

binary-indep:	checkroot build
	$(checkdir)
	-rm -rf debian/tmp
	install -d debian/tmp debian/tmp/DEBIAN
	install -d debian/tmp/usr/doc/$(package)
	install -d -g root -m 755 -o root debian/tmp/etc/$(package)
	install debian/{postinst,preinst} debian/tmp/DEBIAN/.
	cd $(package); $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" \
	  LDFLAGS="$(LDFLAGS)" \
	  prefix=`pwd`/debian/tmp/usr install
	chmod 0644 debian/tmp/usr/share/dejagnu/runtest.exp
	cd $(package); $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" \
	  LDFLAGS="$(LDFLAGS)" \
	  pkgdatadir=debian/tmp/usr/doc/$(package) install-doc
#	gzip -9v debian/tmp/usr/info/*
#	gzip -9v debian/tmp/usr/man/man1/*
	install -d debian/tmp/usr/doc/$(package)/html/stylesheet-images
	install -m 0644 doc/overview.rtf debian/tmp/usr/doc/$(package)
	install -m 0644 doc/overview.ps debian/tmp/usr/doc/$(package)
	install -m 0644 doc/overview.pdf debian/tmp/usr/doc/$(package)
	install -m 0644 doc/overview/*.html debian/tmp/usr/doc/$(package)/html/
	install -m 0644 doc/overview/stylesheet-images/*.png debian/tmp/usr/doc/$(package)/html/stylesheet-images
	install -m 0644 debian/copyright debian/tmp/usr/doc/$(package)
	install -m 0644 debian/changelog debian/tmp/usr/doc/$(package)/changelog.Debian
	gzip -9v debian/tmp/usr/doc/$(package)/changelog.Debian
	install -m 0644 ChangeLog debian/tmp/usr/doc/$(package)
	gzip -9v debian/tmp/usr/doc/$(package)/ChangeLog
	ln -s ChangeLog.gz debian/tmp/usr/doc/$(package)/changelog.gz
	install -g root -m 644 -o root debian/site.exp \
		debian/tmp/etc/$(package)/site.exp
	cd debian/tmp/usr/lib/$(package); ln -fs /etc/$(package)/site.exp .
#	install -d debian/tmp/usr/doc/$(package)/examples
	-cd example; $(MAKE) -i distclean
#	(cd example; tar cf - . ) | \
#		(cd debian/tmp/usr/doc/$(package)/examples; tar xf -)
#	install debian/tmp/usr/doc/$(package)/examples
	dpkg-gencontrol
#	chown -R root.root debian/tmp
#	chmod -R g-ws debian/tmp
	dpkg --build debian/tmp ..

binary-arch:

define checkdir
	test -f runtest.exp -a -f debian/rules
endef
# Below here is fairly generic really

binary:		binary-indep

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

checkroot:
	$(checkdir)
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep clean checkroot