File: rules

package info (click to toggle)
emacsen-common 1.4.15
  • links: PTS
  • area: main
  • in suites: woody
  • size: 92 kB
  • ctags: 32
  • sloc: perl: 194; lisp: 111; sh: 91; makefile: 75
file content (126 lines) | stat: -rwxr-xr-x 3,741 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
#!/usr/bin/make -f
# Sample debian.rules file - for GNU Hello (1.3).
# 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
#
# modified for emacsen-common by Rob Browning <rlb@defaultvalue.org>

pwd       := $(shell pwd)
version   := $(shell dpkg-parsechangelog | grep Version)
version   := $(shell echo ${version} | perl -pe 's/Version:\s+//o')
upstream  := $(shell echo ${version} | perl -pe 's/-.*//o')
# deb_rev   := $(shell echo ${version} | perl -pe 's/.*-//o')

# the architecture of the package
arch      := $(shell dpkg --print-architecture)

# The Debian target name of the package
target    := ${arch}-debian-linux-gnu

CFLAGS    := -O2 -g

eclib := debian/tmp/usr/lib/emacsen-common
flavors := emacs19 emacs20 xemacs19 xemacs20 xemacs21 emacs21

build:
	$(checkdir)
	ln -sf emacs-install emacs-remove
	ln -sf emacs-package-install emacs-package-remove
	touch build

clean:
	$(checkdir)
	rm -f emacs-remove emacs-package-remove
	find . -name "*~" -print0 | xargs -r -0 rm -f
	find . -name "#*" -print0 | xargs -r -0 rm -f
	rm -rf debian/tmp debian/files build

binary-indep:	checkroot build
	$(checkdir)

	perl -wc emacs-install
	perl -wc emacs-package-install
	perl -wc generate-install-list

	-rm -rf debian/tmp
	install -d debian/tmp

	install -d debian/tmp/etc/emacs
	cp site-start.el debian/tmp/etc/emacs

        # 00debian-vars.el
	install -d debian/tmp/etc/emacs/site-start.d
	cp 00debian-vars.el debian/tmp/etc/emacs/site-start.d

        # debian-startup.el
	install -d debian/tmp/usr/share/emacs/site-lisp
	cp debian-startup.el debian/tmp/usr/share/emacs/site-lisp

	install -d ${eclib}
	install -d ${eclib}/packages/install
	install -d ${eclib}/packages/remove
	cp -a emacs-install ${eclib}
	cp -a emacs-remove ${eclib}
	cp -a emacs-package-install ${eclib}
	cp -a emacs-package-remove ${eclib}
	cp -a generate-install-list ${eclib}

	install -d debian/tmp/var/lib/emacsen-common

        # emacsen-common add-on pacakge scripts
	cp -a emacsen-common.install \
	  ${eclib}/packages/install/emacsen-common
	cp -a emacsen-common.remove \
	  ${eclib}/packages/remove/emacsen-common

        # manpages
        # find debian/tmp/usr/man -type f | xargs --no-run-if-empty gzip -9v

        # /usr/share/doc/emacsen-common directory
	install -d debian/tmp/usr/share/doc/emacsen-common
	cp debian/changelog debian/tmp/usr/share/doc/emacsen-common/
	cp debian-emacs-policy debian/tmp/usr/share/doc/emacsen-common/
	find debian/tmp/usr/share/doc/emacsen-common -type f \
	  | xargs gzip -9v
	cp debian/copyright debian/tmp/usr/share/doc/emacsen-common

        # Mangle permissions to conform.
	chown -R root.root debian/tmp
	find debian/tmp -type d | xargs chmod 755
	find debian/tmp -not -type d | xargs chmod 644

	find ${eclib} -type f | xargs chmod 755 

        # control scripts	
	install -d debian/tmp/DEBIAN
	install --mode 755 debian/postinst debian/tmp/DEBIAN
	install --mode 755 debian/prerm debian/tmp/DEBIAN
	install --mode 755 debian/postrm debian/tmp/DEBIAN
	install --mode 644 debian/conffiles debian/tmp/DEBIAN

	dpkg-gencontrol -pemacsen-common
	dpkg --build debian/tmp ..

binary-arch:	checkroot build
	$(checkdir)

define checkdir
	test -f debian/rules
endef

# Below here is fairly generic really

binary:		binary-indep binary-arch

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