File: rules

package info (click to toggle)
mew 1%3A6.8-13
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,956 kB
  • sloc: lisp: 36,727; ansic: 3,601; haskell: 569; sh: 439; makefile: 419; ruby: 310; perl: 58
file content (144 lines) | stat: -rwxr-xr-x 4,725 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
#!/usr/bin/make -f

#export DH_VERBOSE=1

export DH_OPTIONS

PACKAGE=`cat debian/PACKAGE`
PKGSNAME=mew
CHG_SUFFIX=`test -f 00changes || ls -1 00changes.* | sed s/00changes// | sort -n -t . -k 2,2 -k 3 | tail -1`

include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
dpkg_buildflags = DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) dpkg-buildflags
CFLAGS=$(shell $(dpkg_buildflags) --get CFLAGS)
CPPFLAGS=$(shell $(dpkg_buildflags) --get CPPFLAGS)
LDFLAGS=$(shell $(dpkg_buildflags) --get LDFLAGS)

configure-stamp: configure
	dh_testdir
	CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
	grep '^Package: ' debian/control | head -1 | sed -e "s/^Package: //g" > debian/PACKAGE
	sed -e "s/@PACKAGE@/$(PACKAGE)/g" debian/README.Debian.in > debian/README.Debian
	sed -e "s/@PACKAGE@/$(PACKAGE)/g" debian/dirs.in > debian/dirs
	sed -e "s/@PACKAGE@/$(PACKAGE)/g" debian/emacsen-install.in > debian/emacsen-install
	sed -e "s/@PACKAGE@/$(PACKAGE)/g" debian/emacsen-remove.in > debian/emacsen-remove
	sed -e "s/@PACKAGE@/$(PACKAGE)/g" debian/emacsen-startup.in > debian/emacsen-startup
	ls -1 00* | egrep -v '(^00copyright$$|^00changes)' > debian/docs
	ls -1 debian/dot.* dot.* > debian/examples
	ls -1 info/mew.*info* > debian/info
	touch $@

build: build-arch build-indep

build-arch: build-arch-stamp
build-arch-stamp: configure-stamp
	$(MAKE) bin
	touch $@

build-indep: build-indep-stamp
build-indep-stamp: configure-stamp
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-arch-stamp build-indep-stamp configure-stamp debian/PACKAGE debian/README.Debian debian/dirs debian/emacsen-install debian/emacsen-remove debian/emacsen-startup debian/docs debian/examples debian/info
	[ ! -f Makefile ] || $(MAKE) distclean
	dh_clean

install: install-arch install-indep
install-indep: DH_OPTIONS=-i
install-indep:
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	cp mew*.el debian/$(PACKAGE)/usr/share/$(PKGSNAME)
	for f in debian/mew*.el; do \
	  if [ -f "$$f" ]; then \
	    cp "$$f" debian/$(PACKAGE)/usr/share/$(PKGSNAME); \
	  fi; \
	done
	for f in 00changes.*; do \
	  if [ -f "$$f" ]; then \
	    cp "$$f" debian/$(PACKAGE)/usr/share/doc/$(PACKAGE)/changelog.`echo $$f | sed -e s/00changes.//`; \
	  fi; \
	done
	rm -f debian/$(PACKAGE)/usr/share/doc/$(PACKAGE)/changelog$(CHG_SUFFIX)
	cp -r etc/* debian/$(PACKAGE)/usr/share/pixmaps/$(PKGSNAME)
	if [ -d contrib ]; then \
	  mkdir debian/$(PACKAGE)/usr/share/$(PKGSNAME)/contrib; \
	  cp contrib/mew*.el debian/$(PACKAGE)/usr/share/$(PKGSNAME)/contrib; \
	  rm -f debian/$(PACKAGE)/usr/share/$(PKGSNAME)/contrib/mew-toolbar-frame.el; \
	fi
	for f in alpha beta; do \
	  if [ -d "$$f" ]; then \
	    cp -r "$$f" debian/$(PACKAGE)/usr/share/doc/$(PACKAGE); \
	  fi; \
	done

install-arch: DH_OPTIONS=-a
install-arch:
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	$(MAKE) DESTDIR=$(CURDIR)/debian/$(PACKAGE)-bin install-bin
	install -m 755 debian/mewstunnel debian/$(PACKAGE)-bin/usr/bin
	install -m 644 debian/mewstunnel.1 debian/$(PACKAGE)-bin/usr/share/man/man1
	rm -f debian/$(PACKAGE)-bin/usr/bin/mewdecode
	rm -f debian/$(PACKAGE)-bin/usr/bin/mewcat
	rm -f debian/$(PACKAGE)-bin/usr/share/man/man1/mewdecode.1*
	rm -f debian/$(PACKAGE)-bin/usr/share/man/man1/mewcat.1*

binary-indep: DH_OPTIONS=-i
binary-indep: build-indep install-indep
	dh_testdir
	dh_testroot
#	dh_installdebconf
	dh_installdocs
	dh_installexamples
	dh_installmenu
	dh_installemacsen
	dh_installman
	dh_installinfo
	dh_installchangelogs 00changes$(CHG_SUFFIX)
	dh_link -p$(PACKAGE) usr/share/pixmaps/$(PKGSNAME) usr/share/$(PKGSNAME)/etc
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch: DH_OPTIONS=-a
binary-arch: build-arch install-arch
	dh_testdir
	dh_testroot
#	dh_installdebconf
	dh_installdocs
	dh_installexamples
	dh_installmenu
	dh_installman
	dh_installinfo
	dh_installchangelogs 00changes$(CHG_SUFFIX)
	dh_strip
	dh_link -p$(PACKAGE)-bin usr/bin/mewencode usr/bin/mewdecode
	dh_link -p$(PACKAGE)-bin usr/bin/mewencode usr/bin/mewcat
	dh_link -p$(PACKAGE)-bin usr/share/man/man1/mewencode.1 usr/share/man/man1/mewdecode.1
	dh_link -p$(PACKAGE)-bin usr/share/man/man1/mewencode.1 usr/share/man/man1/mewcat.1
	dh_compress
	dh_fixperms
	chgrp mail debian/$(PACKAGE)-bin/usr/bin/incm
	chmod g+s  debian/$(PACKAGE)-bin/usr/bin/incm
	dh_lintian
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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