File: rules

package info (click to toggle)
gch 19990519-6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 500 kB
  • ctags: 19
  • sloc: ada: 1,780; perl: 1,330
file content (135 lines) | stat: -rwxr-xr-x 4,882 bytes parent folder | download
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#! /usr/bin/make -f
# Generated automatically from debian/packages
# by yada v0.8, of Sat, 30 Oct 1999

.PHONY: default
default:
	@echo "Specify a target:"; \
	echo " build              compile the package"; \
	echo " binary             make all binary packages"; \
	echo " binary-arch        make all architecture-dependent binary packages"; \
	echo " binary-indep       make all architecture-independent binary packages"; \
	echo " clean              clean up the source package"; \
	echo; \
	echo " depends            check build-time dependencies"; \
	echo " install-tree       compile the package and create the install trees"; \
	echo " clean-install-tree clean up only under debian/"; \
	echo

# Check build dependencies and conflicts

.PHONY: depends
depends: debian/depends-stamp
debian/depends-stamp:
	@echo 'Checking build conflicts and dependencies; just a minute...'
	@echo -n 'gnat...'; v=$$(dpkg -s 'gnat' | sed -n '/^[sS][tT][aA][tT][uU][sS]:.* config-files$$/q;s/^[vV][eE][rR][sS][iI][oO][nN]: *//p'); \
	if test "$$v"; then \
	    exit 0; \
	fi; \
	echo 'Build depends on `gnat'\'' (any version), which is not satisfied' | fmt; exit 1
	@echo -n 'libasis-3.12p-1-dev...'; v=$$(dpkg -s 'libasis-3.12p-1-dev' | sed -n '/^[sS][tT][aA][tT][uU][sS]:.* config-files$$/q;s/^[vV][eE][rR][sS][iI][oO][nN]: *//p'); \
	if test "$$v"; then \
	    exit 0; \
	fi; \
	echo 'Build depends on `libasis-3.12p-1-dev'\'' (any version), which is not satisfied' | fmt; exit 1
	@echo
	@echo 'Conflicts and dependencies all satisfied!'
	touch debian/depends-stamp

# Build the package and prepare the install tree

.PHONY: build-only build
build-only: debian/build-stamp
build: build-only

# Make sure these rules and the control file are up-to-date

.PHONY: rules control
rules: debian/rules
debian/rules: debian/yada debian/packages
	chmod +x debian/yada
	debian/yada rebuild rules

control: debian/control
debian/control: debian/yada debian/packages
	chmod +x debian/yada
	debian/yada rebuild control

debian/build-stamp: debian/depends-stamp
	@[ -f debian/yada -a -f debian/rules ]
	@umask 022 && (\
	echo -E 'eval "yada () { perl $$(pwd)/debian/yada \"\$$@\"; }"; set -e; set -v';\
	echo -E 'gnatmake -g -O2 -I/usr/lib/asis gch-driver -largs -lasis -lgnat') | /bin/sh
	touch debian/build-stamp

.PHONY: install-tree
install-tree: install-tree-any
install-tree-any: \
	debian/tmp-gch/DEBIAN/control

debian/tmp-gch/DEBIAN/control: debian/build-stamp debian/control
	rm -rf debian/tmp-gch
	umask 022 && install -d debian/tmp-gch/DEBIAN
	chmod +x debian/yada
	install -d debian/tmp-gch/usr/share/doc/gch
	umask 022; debian/yada generate copyright \
	                       >debian/tmp-gch/usr/share/doc/gch/copyright
	install -m 644 -p debian/changelog \
	                  debian/tmp-gch/usr/share/doc/gch/changelog.Debian
	@umask 022 && export PACKAGE="gch" \
	    && export ROOT="$$(pwd)/debian/tmp-gch" \
	    && export CONTROL="$$(pwd)/debian/tmp-gch/DEBIAN" && (\
	echo -E 'eval "yada () { perl $$(pwd)/debian/yada \"\$$@\"; }"; set -e; set -v';\
	echo -E 'yada install -bin gch-driver -as gch';\
	echo -E 'yada undocumented gch.1';\
	echo -E 'yada install -doc gch_ug.txt') | /bin/sh
	LD_LIBRARY_PATH="debian/tmp-gch/lib:debian/tmp-gch/usr/lib:$$LD_LIBRARY_PATH" dpkg-shlibdeps -pgch -dDepends debian/tmp-gch/usr/bin/*
	debian/yada compress gch
	find debian/tmp-gch -type f -print \
	  | sed -n 's/^debian\/tmp-gch\(\/etc\/.*\)$$/\1/p' \
	    > debian/tmp-gch/DEBIAN/conffiles
	if test ! -s debian/tmp-gch/DEBIAN/conffiles; then rm -f debian/tmp-gch/DEBIAN/conffiles; fi
	debian/yada generate maintscripts gch
	umask 022 && dpkg-gencontrol -isp -pgch -Pdebian/tmp-gch

# Build package files

.PHONY: binary binary-arch binary-indep
binary: binary-arch binary-indep
binary-arch: binary-arch-any

.PHONY: binary-arch-any
binary-arch-any: \
	binary-package-gch
binary-indep:

.PHONY: binary-package-gch
binary-package-gch: check-root debian/tmp-gch/DEBIAN/control
	@[ -f debian/yada -a -f debian/rules ]
	chown -R 0.0 debian/tmp-gch
	chmod -R u=rwX,go=rX debian/tmp-gch
	@if [ -d debian/tmp-gch/usr/doc/gch ]; then \
	  echo "*** Yada warning: /usr/doc/gch should be /usr/share/doc/gch";\
	fi
	dpkg-deb --build debian/tmp-gch ..

.PHONY: check-root
check-root:
	@[ `id -u` = 0 ] || (echo "You must be root to do this!"; false)

# Clean up afterwards

.PHONY: clean clean-install-tree clean-build
clean: clean-install-tree clean-build debian/control debian/rules

clean-build:
	@[ -f debian/yada -a -f debian/rules ]
	rm -f debian/build-stamp debian/depends-stamp
	@umask 022 && (\
	echo -E 'eval "yada () { perl $$(pwd)/debian/yada \"\$$@\"; }"; set -e; set -v';\
	echo -E 'rm -f b~* *.o *.ali gch-driver || true') | /bin/sh

clean-install-tree: debian/rules
	@[ -f debian/yada -a -f debian/rules ]
	rm -f debian/install-tree-stamp
	rm -rf debian/tmp* debian/files* debian/substvars