File: rules.in

package info (click to toggle)
mailcrypt 3.5.9-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,252 kB
  • ctags: 624
  • sloc: lisp: 5,382; python: 1,170; makefile: 215; sh: 172
file content (165 lines) | stat: -rw-r--r-- 4,678 bytes parent folder | download | duplicates (3)
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
#include "variables"
#! /usr/bin/make -f
#
# rules for <:=${PACKAGE}:>
#
<:=@COPYRIGHT:>//

checkdir=test -f debian/rules
checkroot=test root = "$$(whoami)"
fixperms=chmod -R a+rX .

tmp := $(shell pwd)/debian/tmp

SHELL := /bin/bash
INSTDIR := install -m 755 -d
INSTPROG := install -m 755 -s
INSTDATA := install -m 644
INSTSCRIPT := install -m 755
STRIP := strip -R .note -R .comment

<:# DO NOT include <% debian/rules %> nor <% debian/templates %> :>//
DFILES := debian/README debian/copyright \
debian/config debian/postinst debian/prerm debian/postrm \
debian/docbase debian/lintian \
debian/bug.presubj debian/bug.script \
debian/install debian/remove

<:# <% Debconf %> templates :>//
DCSOURCES := $(shell cat debian/po/POTFILES.in \
		| perl -pe 's|^\[[^]]+\] +(.*)$$|debian/$${1}|')
DFILES += $(patsubst %templates, %templates.dcobj, $(DCSOURCES))

SCRIPTS := configure install-sh
SOURCES := *.in *.el load-path.hack
<:# Hacks needed by configure. :>//
MAKEFILEHACKS := tests/Makefile.in tests/remailer/Makefile.in

.PHONY: pre-build
pre-build:
	autoconf || true

debian/rules: debian/variables

<:# Eperl is simply great: thanks, Ralf! :>//
%:: %.in
	eperl -d DEBIAN_DIR="$(shell pwd)/debian/" \
		-I "$(shell pwd)/debian/" -P -o $@ $<

debian/po/templates.pot: $(DCSOURCES)
	umask 0022 && debconf-updatepo --verbose --podir=debian/po/
	@touch $@

%.dcobj: % debian/po/templates.pot
	po2debconf --verbose --podir debian/po $< > $@

build: $(DFILES) debian/po/templates.pot
	$(checkdir)
	chmod a+x ./configure;	<:# next upstream release remove me :>//
	./configure --infodir=<:=${info}:> EMACS=echo
	$(MAKE) MAKEINFO="makeinfo --verbose" \
		TEXI2HTML="texi2html --Verbose" \
		info html
	touch build

.PHONY: clean
clean: debian/po/templates.pot
	$(checkdir)
	-rm -rf build core $(tmp) debian/{files*,substvars}
	-rm -f debian/po/updatepo
	[ ! -f Makefile ] || $(MAKE) distclean
	-rm -f $(DFILES)
	$(fixperms)

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

.PHONY: binary-indep
binary-indep: build
	$(checkdir)
	$(checkroot)
	-rm -rf $(tmp)

<:# install package :>//
	$(INSTDIR) $(tmp)<:=${lisp}:>
	$(INSTDATA) debian/<:=${PACKAGE}:>-init.el $(tmp)<:=${lisp}:>/../
	$(INSTSCRIPT) $(SCRIPTS) $(tmp)<:=${lisp}:>/
	$(INSTDATA) $(SOURCES) $(tmp)<:=${lisp}:>/
	umask 0022; for i in $(MAKEFILEHACKS); do \
		$(INSTDIR) $(tmp)<:=${lisp}:>/$${i%/*}/; \
		echo -e "clean distclean:\n\trm -f Makefile\n" \
			> $(tmp)<:=${lisp}:>/$${i}; \
	done
	$(MAKE) INSTALL_INFO="echo install-info" \
		install-info infodir=$(tmp)<:=${info}:>
	gzip -9frv $(tmp)<:=${info}:>

<:# install Debian doc :>//
	$(INSTDIR) $(tmp)<:=${doc}:>
	$(INSTDATA) <:=${DOCS}:> $(tmp)<:=${doc}:>
	$(INSTDATA) debian/README $(tmp)<:=${doc}:>/README.Debian
	$(INSTDATA) ChangeLog $(tmp)<:=${doc}:>
	$(INSTDATA) debian/changelog $(tmp)<:=${doc}:>/changelog.Debian
	gzip -9frv $(tmp)<:=${doc}:>
	ln -sf ChangeLog.gz $(tmp)<:=${doc}:>/changelog.gz
	$(INSTDATA) debian/copyright $(tmp)<:=${doc}:>
	$(INSTDIR) $(tmp)<:=${html}:>
	$(INSTDATA) htmls/*.html $(tmp)<:=${html}:>
	ln -snf mailcrypt_toc.html $(tmp)<:=${html}:>/index.html

<:# install Debian system files :>//
	$(INSTDIR) $(tmp)<:=${ecode}:>/install
	$(INSTDIR) $(tmp)<:=${ecode}:>/remove
	$(INSTSCRIPT) debian/install \
		$(tmp)<:=${ecode}:>/install/<:=${PACKAGE}:>
	$(INSTSCRIPT) debian/remove \
		$(tmp)<:=${ecode}:>/remove/<:=${PACKAGE}:>
	$(INSTDIR) $(tmp)<:=${docbase}:>
	$(INSTDATA) debian/docbase $(tmp)<:=${docbase}:>/<:=${PACKAGE}:>
	$(INSTDIR) $(tmp)<:=${bug}:>
	$(INSTDATA) debian/bug.presubj $(tmp)<:=${bug}:>/presubj
	$(INSTSCRIPT) debian/bug.script $(tmp)<:=${bug}:>/script
	$(INSTDIR) $(tmp)<:=${lintian}:>
	$(INSTDATA) debian/lintian $(tmp)<:=${lintian}:>/<:=${PACKAGE}:>

<:# install Debian control files :>//
	$(INSTDIR) $(tmp)<:=${debian}:>
	$(INSTDATA) debian/templates.dcobj \
		$(tmp)<:=${debian}:>/templates
	$(INSTSCRIPT) debian/{config,postinst,postrm,prerm} \
		$(tmp)<:=${debian}:>

<:# standard stuff :>//
	cd $(tmp) && md5sum \
		$$(find ./ -path './DEBIAN' -prune \
		-o -type f -printf "%P\n") \
		| sort -k 2 -o $(tmp)<:=${debian}:>/md5sums
	dpkg-gencontrol -isp
	chown -R root.root $(tmp)
	chmod -R go=rX $(tmp)
	dpkg --build $(tmp) ..

.PHONY: binary-arch
binary-arch: build
	$(checkdir)
	$(checkroot)

.PHONY: build-package
build-package: clean
	dpkg-buildpackage -rfakeroot -tc -i

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

# arch-tag: 7f6799c7-dca1-4d84-8038-1ad9c2888751<:='-child':>
<:
# local variables:
# mode: makefile
# coding: utf-8
# ispell-local-dictionary: "american"
# ispell-check-comments: exclusive
# end:
#
# LocalWords:  Eperl Ralf
:>//