File: rules

package info (click to toggle)
exmh 1:2.9.0-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 4,216 kB
  • sloc: tcl: 38,046; perl: 1,647; makefile: 130; sh: 101; exp: 75; csh: 9; sed: 2
file content (116 lines) | stat: -rwxr-xr-x 4,192 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
#! /usr/bin/make -f
#
# debian/exmh.conf contains configuration information taken from
# exmh.install.  debian/exmh.conf must be manually generated and
# verified before building the exmh package and updated with each
# new upstream release of exmh.

SHELL = /bin/sh

INSTALL = /usr/bin/install
INSTALL_PROGRAM = $(INSTALL) -m 755 -o root -g root
INSTALL_DATA = $(INSTALL) -m 644 -o root -g root
INSTALL_DIR = $(INSTALL) -d -m 755 -o root -g root

# name and version number of the package
PACKAGE=exmh
VERSION=$(shell sed -n '1s/^.*(\(.*\)).*$$/\1/p' debian/changelog)

DSTDIR=debian/tmp/

BUILD_DATE := $(shell dpkg-parsechangelog | sed -n -e 's/^Date: //p')


config:
	$(checkdir)
	touch stamp-config

build: 
	$(checkdir)
	test -f stamp-config || make -f debian/rules config
	touch stamp-build

clean: 
	$(checkdir)
	-rm -f stamp-config stamp-build
	-rm -rf $(DSTDIR) debian/files* 

binary-arch: checkroot

binary-indep: checkroot
	$(checkdir)
	test -f stamp-build || make -f debian/rules build
	-rm -rf $(DSTDIR)

# make all directories in one go
	$(INSTALL_DIR) $(DSTDIR)/DEBIAN $(DSTDIR)/usr/bin/ $(DSTDIR)/etc/
	$(INSTALL_DIR) $(DSTDIR)/usr/share/menu $(DSTDIR)/usr/lib/exmh
	$(INSTALL_DIR) $(DSTDIR)/usr/share/doc/exmh/html $(DSTDIR)/usr/share/doc/exmh/misc $(DSTDIR)/usr/share/doc/exmh/examples $(DSTDIR)/usr/share/man/man1 $(DSTDIR)/usr/share/exmh/bitmaps/

# the maintainer stuff first
	$(INSTALL_PROGRAM) debian/preinst debian/postinst debian/postrm $(DSTDIR)/DEBIAN/
	$(INSTALL_DATA) debian/conffiles  $(DSTDIR)/DEBIAN/

# configuration file, but vith our current version substituted
	sed -e s/MYVERSION/$(VERSION)/g <debian/exmh.conf >$(DSTDIR)/etc/exmh.conf
	chown root:root $(DSTDIR)/etc/exmh.conf
	chmod 644 $(DSTDIR)/etc/exmh.conf

# binaries. in upstream scheme, the install script massages .MASTER versions
	$(INSTALL_PROGRAM) exmh.MASTER $(DSTDIR)/usr/bin/exmh
	$(INSTALL_PROGRAM) exmh-async.MASTER $(DSTDIR)/usr/share/exmh/exmh-async
	$(INSTALL_PROGRAM) exmh-bg.MASTER $(DSTDIR)/usr/share/exmh/exmh-bg
	$(INSTALL_PROGRAM) ftp.expect.MASTER $(DSTDIR)/usr/share/exmh/ftp.expect
	$(INSTALL_PROGRAM) inc.expect.MASTER $(DSTDIR)/usr/share/exmh/inc.expect
# libraries 
	$(INSTALL_DATA) debian/menu $(DSTDIR)/usr/share/menu/exmh

# everything from lib but the docs, the images, the 
# tclindex (built by postinst), and also not the mime.type (use main one in etc)
	$(INSTALL_DATA) lib/*.tcl  lib/app-defaults*  lib/*.au  lib/PgpDecryptExpect lib/*.exp $(DSTDIR)/usr/lib/exmh/
	$(INSTALL_DATA) lib/*.gif lib/*.bitmap lib/*.mask lib/*.ppm lib/bitmaps/* $(DSTDIR)/usr/share/exmh/bitmaps/
	$(INSTALL_PROGRAM) exmh-strip.MASTER $(DSTDIR)/usr/share/doc/exmh/examples/exmh-strip
	$(INSTALL_PROGRAM) exmhcomp $(DSTDIR)/usr/share/doc/exmh/examples/



# man pages
	$(INSTALL_DATA)	exmh.l $(DSTDIR)/usr/share/man/man1/exmh.1
	-gzip -9frn $(DSTDIR)/usr/share/man/man1

# html documentation goes into html dir, extras go into misc subdir
# others go into main docs area
	$(INSTALL_DATA) lib/html/* $(DSTDIR)/usr/share/doc/exmh/html/	
	# all misc except RPM info
	$(INSTALL_DATA) misc/README* misc/Par150* misc/archiveoldmail misc/cite* misc/comp* misc/exmhwrapper misc/gbuffy* misc/jpilot* misc/locked* misc/mh* misc/netscape-remote* misc/ns* misc/query*  $(DSTDIR)/usr/share/doc/exmh/misc/

	$(INSTALL_DATA) debian/copyright $(DSTDIR)/usr/share/doc/exmh/copyright
	$(INSTALL_DATA) debian/changelog $(DSTDIR)/usr/share/doc/exmh/changelog.Debian
	$(INSTALL_DATA) exmh.CHANGES $(DSTDIR)/usr/share/doc/exmh/changelog

	$(INSTALL_DATA) debian/README.Debian debian/NEWS.Debian $(DSTDIR)/usr/share/doc/exmh
	$(INSTALL_DATA) exmh.README $(DSTDIR)/usr/share/doc/exmh/README
	gzip -9n $(DSTDIR)/usr/share/doc/exmh/changelog* $(DSTDIR)/usr/share/doc/exmh/NEWS.Debian

# build the run-time package
	dpkg-gencontrol -isp
	find '$(DSTDIR)' -depth -newermt '$(BUILD_DATE)' -print0 | \
	xargs -0r touch --no-dereference --date='$(BUILD_DATE)'

	dpkg --build $(DSTDIR) ..

define checkdir
	test -f exmh.MASTER -a -f debian/rules
endef

binary: binary-indep binary-arch

build-arch: build

build-indep: build

checkroot:
	$(checkdir)
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep clean