File: rules

package info (click to toggle)
records 1.4.9-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 736 kB
  • ctags: 497
  • sloc: lisp: 6,196; perl: 664; sh: 315; makefile: 192
file content (137 lines) | stat: -rwxr-xr-x 4,697 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
#!/usr/bin/make -f

INST=debian/inst

testdir:
	test -e debian/control

testroot:
	test root = "`whoami`" || (echo need root priviledges; exit 1)

test: testdir testroot

Makefile: Makefile.in configure
	./configure --prefix=/usr

config: testdir Makefile

build: testdir config

clean: test
	-$(MAKE) clean
	rm -f recordsadmin config.log config.cache config.status Makefile
	rm -rf debian/files debian/substvars $(INST)

install-records-common: test build
	install -d -m0755 \
		$(INST)/records-common/usr/bin \
		$(INST)/records-common/usr/share/emacs/site-lisp/records \
		$(INST)/records-common/usr/share/info \
		$(INST)/records-common/usr/share/doc/records-common/examples \
		$(INST)/records-common/usr/share/man/man1
	install -m0644 records.info \
		$(INST)/records-common/usr/share/info/records.info
	install -m0755 recordsadmin $(INST)/records-common/usr/bin
	install -m0644 \
		FAQ INSTALL README debian/README.Debian \
		debian/copyright records.ps \
		$(INST)/records-common/usr/share/doc/records-common
	install -m0644 \
		debian/changelog \
		$(INST)/records-common/usr/share/doc/records-common/changelog.Debian
	install -m0644 \
		NEWS \
		$(INST)/records-common/usr/share/doc/records-common/changelog
	install -m0644 \
		records-templ.tex \
		$(INST)/records-common/usr/share/doc/records-common/examples
	find $(INST)/records-common/usr/share/doc/records-common \
		-type f -a \! -name '*.gz' -a \! -name 'copyright' -print0 \
		| xargs -0 --no-run-if-empty gzip -9f --
	for a in recordsadmin; do \
		ln -sf ../man7/undocumented.7.gz \
		$(INST)/records-common/usr/share/man/man1/$$a.1.gz ;\
	done
	install -m0644 records-index.el records-dindex.el \
		records-util.el records-vars.el records.el \
		records-search.el records-autoloads.el \
		records-tex.el \
		$(INST)/records-common/usr/share/emacs/site-lisp/records

install-records-gnuemacs: test build
	install -d -m0755 $(INST)/records-gnuemacs/usr/share/doc
	ln -sf records-common $(INST)/records-gnuemacs/usr/share/doc/records-gnuemacs

install-records-xemacs: test build
	install -d -m0755 $(INST)/records-xemacs/usr/share/doc
	ln -sf records-common $(INST)/records-xemacs/usr/share/doc/records-xemacs

install: \
	install-records-common \
	install-records-gnuemacs \
	install-records-xemacs

make-maintscripts-%:
	@[ ! -e "debian/prerm.$*" ] || $(call SED_INSTALL,$*,debian/prerm.$*,$(INST)/$*/DEBIAN/prerm,0755)
	@[ ! -e "debian/postinst.$*" ] || $(call SED_INSTALL,$*,debian/postinst.$*,$(INST)/$*/DEBIAN/postinst,0755)

make-debian-%:
	install -d -m0755 $(INST)/$*/DEBIAN

make-package-%:
	set -e; if [ -d $(INST)/$*/etc ]; then \
		cd $(INST)/$* && find ./etc -type f \
		| sed 's/^\.//g' >DEBIAN/conffiles.tmp ;\
		chmod 0644 DEBIAN/conffiles.tmp ;\
		mv DEBIAN/conffiles.tmp DEBIAN/conffiles ;\
	fi
	dpkg-gencontrol -isp -p$* -P$(INST)/$*
	dpkg --build $(INST)/$* ..

# $(call SED_INSTALL,package,from,to,mode)
SED_INSTALL = \
	echo "sed_install PACKAGE=$(1) $(2) $(3)" ;\
	set -e ;\
	sed 's/^PACKAGE=.*/PACKAGE=$(1)/' <$(2) >$(3).tmp ;\
	chmod $(4) $(3).tmp ;\
	mv $(3).tmp $(3)

make-emacsen-%:
	install -d \
		$(INST)/records-$*/usr/lib/emacsen-common/packages/install \
		$(INST)/records-$*/usr/lib/emacsen-common/packages/remove \
		$(INST)/records-$*/etc/emacs/site-start.d

	@$(call SED_INSTALL,records-$*,debian/emacsen-install,$(INST)/records-$*/usr/lib/emacsen-common/packages/install/records-$*,0755)
	@$(call SED_INSTALL,records-$*,debian/emacsen-remove,$(INST)/records-$*/usr/lib/emacsen-common/packages/remove/records-$*,0755)
	@$(call SED_INSTALL,records-$*,debian/emacsen-startup,$(INST)/records-$*/etc/emacs/site-start.d/50records-$*.el,0644)

	@$(call SED_INSTALL,records-$*,debian/postinst-emacsen,$(INST)/records-$*/DEBIAN/postinst,0755)
	@$(call SED_INSTALL,records-$*,debian/prerm-emacsen,$(INST)/records-$*/DEBIAN/prerm,0755)

binary-indep-records-common: test install-records-common \
		make-debian-records-common \
		make-maintscripts-records-common \
		make-package-records-common

binary-indep-records-gnuemacs: test install-records-gnuemacs \
		make-debian-records-gnuemacs make-emacsen-gnuemacs \
		make-package-records-gnuemacs

binary-indep-records-xemacs: test install-records-xemacs \
		make-debian-records-xemacs \
		make-emacsen-xemacs \
		make-package-records-xemacs

binary-indep: binary-indep-records-common \
	binary-indep-records-gnuemacs binary-indep-records-xemacs

binary-arch:

binary: binary-indep binary-arch

.PHONY: testdir testroot test config build clean \
	install-records-common install-records-gnuemacs \
	install-records-xemacs install binary-indep-records-common \
	binary-indep-records-gnuemacs binary-indep-records-xemacs \
	binary-indep binary-arch binary