File: rules

package info (click to toggle)
sgmltools-lite 3.0.3.0.cvs.20010909-20
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 568 kB
  • ctags: 214
  • sloc: python: 701; sh: 271; makefile: 180
file content (94 lines) | stat: -rwxr-xr-x 3,710 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
#!/usr/bin/make -f
# This is converted from a sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

PKG = sgmltools-lite
PKGDIR = $(CURDIR)/debian/$(PKG)
PKGETCDIR = $(PKGDIR)/usr/share/$(PKG)
PKGDOCDIR = $(PKGDIR)/usr/share/doc/$(PKG)
PKGMANDIR = $(PKGDIR)/usr/share/man
DBIMAGEDIR = /usr/share/sgml/docbook/stylesheet/dsssl/modular/images/

export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 -SDate)" +%s)

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp

build-stamp:
	cd src && ./configure --prefix=/usr --datadir=/usr/share \
	  --mandir=/usr/share/man \
	  --with-etcsgml="/usr/share/sgmltools-lite" \
	  --with-dbimages="$(DBIMAGEDIR)"
	cd src && $(MAKE)
	touch build-stamp

clean:
	rm -f build-stamp
	[ ! -f src/Makefile ] || $(MAKE) -C src clean
	sh debian/common/doclean.sh $(PKG)

install: build
	sh debian/common/doclean.sh $(PKG)
	sh debian/common/installdirs.sh $(PKG)
	cd src && $(MAKE) install prefix=$(PKGDIR)/usr \
		datadir=$(PKGDIR)/usr/share \
		mandir=$(PKGDIR)/usr/share/man \
		etcdir=$(PKGDIR)/usr/share/sgmltools-lite
# remove extra dtd files
	rm -rf $(PKGDIR)/usr/share/sgml/dtd
# remove extra catalog files
	rm -f $(PKGETCDIR)/catalog.rh71
	rm -f $(PKGETCDIR)/catalog.rh62
	rm -f $(PKGETCDIR)/catalog.suse
# remove buildcat since Debian has sgml-base package
	rm -rf $(PKGDIR)/usr/bin/buildcat
# replace gensgmlenv with Debian specific one
	cp debian/addition/gensgmlenv $(PKGDIR)/usr/bin/
# Debian does not need buildcat and we use modified gensgmlenv
	rm -rf $(PKGETCDIR)/catalog.d
# create symlink from system supercatalog to package config dir
	ln -s /etc/sgml/catalog $(PKGETCDIR)/catalog
# move stylesheet files
	mkdir -p $(PKGDIR)/usr/share/sgml/stylesheet/dsssl/
	mv $(PKGDIR)/usr/share/sgml/stylesheets/sgmltools \
	  $(PKGDIR)/usr/share/sgml/stylesheet/dsssl/
	rmdir $(PKGDIR)/usr/share/sgml/stylesheets
# add Debian specific manpages
	cp debian/addition/*.1 $(PKGDIR)/usr/share/man/man1/
# rename the manpage of the main command
	mv $(PKGDIR)/usr/share/man/man1/sgmltools-lite.1 \
		$(PKGDIR)/usr/share/man/man1/sgmltools.1
# add Debian specific jadewhich script
	mkdir -p $(PKGDIR)/usr/share/sgmltools-lite/
	cp debian/addition/jadewhich $(PKGDIR)/usr/share/sgmltools-lite/
	chmod a+x $(PKGDIR)/usr/share/sgmltools-lite/jadewhich
# rewrite main command to use jadewhich
	sed -e "s:/usr/bin/.*jade:/usr/share/sgmltools-lite/jadewhich:" \
	 $(PKGDIR)/usr/bin/sgmltools >$(PKGDIR)/usr/bin/sgmltools.new;
	mv $(PKGDIR)/usr/bin/sgmltools.new $(PKGDIR)/usr/bin/sgmltools;
	chmod a+x $(PKGDIR)/usr/bin/*

binary-indep: build install
	sh debian/common/installdocs.sh $(PKG)
	gzip -9n $(PKGDIR)/usr/share/man/man1/*
	install -o 0 -g 0 -p -m 644 debian/changelog $(PKGDOCDIR)/changelog.Debian
	install -o 0 -g 0 -p -m 644 src/ChangeLog $(PKGDOCDIR)/changelog
	gzip -9n $(PKGDOCDIR)/changelog*
	gzip -9n $(PKGDOCDIR)/README*
	find $(PKGDIR) -print0 | xargs -0r chown --no-dereference 0:0
	find $(PKGDIR) ! -type l -print0 | xargs -0r chmod go=rX,u+rw,a-s
	find $(PKGDOCDIR) -type d -print0 | xargs -0r chmod 755
	find $(PKGMANDIR) -type f -print0 | xargs -0r chmod 644
	sh debian/common/installmaintscript.sh $(PKG)
	dpkg-gencontrol -P$(PKGDIR)
	cd $(PKGDIR) && find * -type f ! -regex '^DEBIAN/.*' -print0 |\
		LC_ALL=C sort -z | xargs -0r md5sum > DEBIAN/md5sums
	chmod 644 $(PKGDIR)/DEBIAN/md5sums
	chown 0:0 $(PKGDIR)/DEBIAN/md5sums
	find $(PKGDIR) -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \
		xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH"
	dpkg --build $(PKGDIR) ..

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