File: rules

package info (click to toggle)
acl-installer 6.2.32
  • links: PTS
  • area: contrib
  • in suites: sarge
  • size: 176 kB
  • ctags: 99
  • sloc: sh: 1,017; lisp: 183; makefile: 117
file content (175 lines) | stat: -rwxr-xr-x 5,488 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#!/usr/bin/make -f
# This is part of the acl-installer program: 
#    http://b9.com/acl-installer.html

#
# Copyright (c) 2002 Kevin M. Rosenberg <kmr@debian.org>
#
# acl-installer is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License (version 2) as
# published by the Free Software Foundation.
#
# acl-installer is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have a copy of the GNU General Public License on your
# Debian system in the file /usr/share/common-licenses/GPL-2

ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)

pkg=acl-pro-installer
pkg-trial=acl-installer
pkg-alisp=acl-alisp
pkg-alisp8=acl-alisp8
pkg-mlisp=acl-mlisp
pkg-mlisp8=acl-mlisp8
pkg-acldoc=acldoc-el

pkg-name	:= acl-pro
pkg-trial-name	:= acl

prefix		:= debian/$(pkg)
prefix-trial	:= debian/$(pkg-trial)
prefix-acldoc	:= debian/$(pkg-acldoc)
clc-bin-dir	:= usr/lib/common-lisp/bin
acl-dir		:= usr/lib/$(pkg-name)
trial-dir	:= usr/lib/$(pkg-trial-name)
emacs-dir	:= usr/share/emacs/site-lisp
site-start-dir	:= etc/emacs/site-start.d

all-clc-pkgs	:= $(pkg-alisp) $(pkg-alisp8) $(pkg-mlisp) $(pkg-mlisp8)

base-clc-lib-dir	:= usr/lib/common-lisp

configure: configure-stamp

configure-stamp:
	dh_testdir
	# Add here commands to configure the package.

	touch configure-stamp

build: configure-stamp build-stamp
build-stamp:
	dh_testdir
	# Add here to build the package
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	# Add here commands to clean up after the build process.
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	dh_installdirs -p $(pkg-trial) $(trial-dir) $(clc-bin-dir)

	# Add here commands to install the package into debian/tmp.
	dh_installdirs -p $(pkg) $(acl-dir)
	dh_installdirs -p $(pkg-alisp) $(clc-bin-dir)
	dh_installdirs -p $(pkg-alisp8) $(clc-bin-dir)
	dh_installdirs -p $(pkg-mlisp) $(clc-bin-dir)
	dh_installdirs -p $(pkg-mlisp8) $(clc-bin-dir)
	dh_install -p $(pkg) siteinit.cl $(acl-dir)
	dh_install -p $(pkg-trial) siteinit.cl $(trial-dir)

	sed -e "s@%dir%@/$(acl-dir)@;" dl-and-install-patches.sh.template > $(prefix)/$(acl-dir)/dl-and-install-patches.sh
	sed -e "s@%dir%@/$(trial-dir)@;" dl-and-install-patches.sh.template > $(prefix-trial)/$(trial-dir)/dl-and-install-patches.sh
	chown root.root $(prefix)/$(acl-dir)/dl-and-install-patches.sh \
		$(prefix-trial)/$(trial-dir)/dl-and-install-patches.sh
	chmod +x $(prefix)/$(acl-dir)/dl-and-install-patches.sh \
		 $(prefix-trial)/$(trial-dir)/dl-and-install-patches.sh

	for p in $(all-clc-pkgs); do \
	       	echo "processing CLC script for $$p" ;\
		target=`echo $$p | sed -e "s/^acl-//;"` ;\
		dir=/$(acl-dir); \
		sed -e "s@%dir%@$$dir@;" < acl.sh.template | \
		sed -e "s@%target%@$$target@;" | \
		sed -e "s@%builder%@$$target@;" > $$target.sh ;\
		sed -e "s@%basedir%@/$(base-clc-lib-dir)@;" < install-clc.cl.template | \
			sed -e "s@%impl%@$$target@" | \
			sed -e "s@%dirname%@$(pkg-name)@" > install-clc-$${target}.cl; \
		chown root.root $$target.sh; \
		chmod +x $$target.sh; \
		dh_install -p $$p $$target.sh $(clc-bin-dir); \
		dh_install -p $$p install-clc-$${target}.cl $(acl-dir); \
	done

	sed -e "s@%dir%@/usr/lib/$(pkg-trial-name)@;" < acl.sh.template | \
	sed -e "s@%target%@$(pkg-trial-name)@;" | \
	sed -e "s@%builder%@$(pkg-trial-name)@;" > $(pkg-trial-name).sh
	chown root.root $(pkg-trial-name).sh
	chmod +x $(pkg-trial-name).sh
	dh_install -p $(pkg-trial) $(pkg-trial-name).sh $(clc-bin-dir)
	sed -e "s@%basedir%@/$(base-clc-lib-dir)@;" < install-clc.cl.template | \
		sed -e "s@%impl%@$(pkg-trial-name)@" | \
		sed -e "s@%dirname%@$(pkg-trial-name)@" > $(prefix-trial)/$(trial-dir)/install-clc-$(pkg-trial-name).cl


	for p in $(all-clc-pkgs); do \
                echo "Processing maintainer scripts for $$p" ;\
		l=`echo $$p | sed -e "s/^acl-//;"` ;\
		sed -e "s/%pkg%/$$p/;" < debian/prerm.template | \
			sed -e "s/%impl%/$$l/;" \
			 > debian/$$p.prerm ;\
		sed -e "s/%pkg%/$$p/;" < debian/postinst.template | \
			sed -e "s/%impl%/$$l/;" \
			 > debian/$$p.postinst ;\
		chown root.root debian/$$p.prerm debian/$$p.postinst; \
		chmod +x debian/$$p.prerm debian/$$p.postinst; \
	done

	# Emacs package
	dh_installdirs -p $(pkg-acldoc) $(emacs-dir) $(site-start-dir)
	dh_install -p $(pkg-acldoc) acldoc.el $(emacs-dir)
	dh_install -p $(pkg-acldoc) debian/50acldoc.el $(site-start-dir)

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
#	dh_testversion
	dh_testdir
	dh_testroot
	dh_installdebconf	
	dh_installdocs -A README
	dh_installexamples
#	dh_installmenu
	dh_installemacsen
#	dh_installpam
#	dh_installinit
#	dh_installcron
	dh_installman -p $(pkg) debian/alisp.1 debian/alisp8.1 debian/mlisp.1 debian/mlisp8.1
	dh_installman -p $(pkg-trial) debian/acl.1
#	dh_installinfo
#	dh_undocumented
	dh_installchangelogs 
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
#	dh_makeshlibs
	dh_installdeb
#	dh_perl
	dh_shlibdeps
ifeq ($(ARCH),amd64)
	dh_gencontrol -- -VEXTRADEPENDS=,ia32-libs
else
	dh_gencontrol
endif
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure