File: rules

package info (click to toggle)
wml 2.0.11ds2-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,024 kB
  • ctags: 48
  • sloc: perl: 4,757; sh: 3,663; makefile: 1,087
file content (158 lines) | stat: -rwxr-xr-x 5,014 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/usr/bin/make -f

SHELL = /bin/sh

r = $(shell pwd)/debian/wml
t = $(shell pwd)/debian/tmp
p = wml

# Repackaging variables
DEBIAN_REVISION := $(shell echo -n `head -1 debian/changelog | sed -e 's/^.*(\(.*\)).*$$/\\1/'`)
DEBIAN_VERSION := $(shell echo -n $(DEBIAN_REVISION) | sed -e 's/-.*//')
UPSTREAM_VERSION := $(shell echo -n $(DEBIAN_VERSION) | sed -e 's/ds[0-9]$$//')
UPSTREAM_DIR := "$(t)/wml-$(UPSTREAM_VERSION)"
DEBIAN_DIR := "$(t)/wml-$(UPSTREAM_VERSION).orig"

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
unexport CFLAGS
unexport CPPFLAGS
unexport LDFLAGS

include /usr/share/quilt/quilt.make

get-orig-source:
	# Prepare repackaging directory
	rm -rf $(t)
	mkdir -p $(t)
	# Unpack tar ball as downloaded by uscan(1)
	tar xvz -C $(t) -f ../wml_$(UPSTREAM_VERSION).orig.tar.gz
	# Rename directory
	mv -v $(UPSTREAM_DIR) $(DEBIAN_DIR)

	# We don't want upstream VCS stuff in our orig.tar.gz
	-find $(DEBIAN_DIR) -name .svn -exec rm -rvf '{}' ';'

	# Also remove stuff which should not belong in the upstream
	# distribution files either.
	find $(DEBIAN_DIR) -name '*~' -exec rm -rvf '{}' ';'
	find $(DEBIAN_DIR) -name '*.tmp' -exec rm -rvf '{}' ';'

	# Remove stuff which will be removed by make distclean anyway
	find $(DEBIAN_DIR) -mindepth 1 -name '*.orig' -exec rm -rvf '{}' ';'
	rm -rvf $(DEBIAN_DIR)/wml_backend/p2_mp4h/autom4te.cache

	# Remove non-free stuff
	rm -vf $(DEBIAN_DIR)/wml_docs/wml_std_*.txt
	rm -vf $(DEBIAN_DIR)/wml_docs/wml_barebone.txt

	# Remove all embedded code copies not needed to build the
	# Debian package.
	find $(DEBIAN_DIR) -name 'configure.in' -exec rm -rvf '{}' ';'
	rm -vf $(DEBIAN_DIR)/config/aclocal.m4
	rm -vf $(DEBIAN_DIR)/config/configure*
	rm -vf $(DEBIAN_DIR)/config/prep_modules_files.sh
	rm -rvf $(DEBIAN_DIR)/wml_aux/freetable
	rm -rvf $(DEBIAN_DIR)/wml_aux/txt2html
	rm -rvf $(DEBIAN_DIR)/wml_{aux,common}/htmlclean
	rm -rvf $(DEBIAN_DIR)/wml_aux/iselect
	rm -rvf $(DEBIAN_DIR)/wml_aux/linklint
	rm -rvf $(DEBIAN_DIR)/wml_aux/tidy
	rm -rvf $(DEBIAN_DIR)/wml_aux/weblint
	rm -rvf $(DEBIAN_DIR)/wml_backend/p2_mp4h
	rm -rvf $(DEBIAN_DIR)/wml_backend/p3_eperl
	rm -rvf $(DEBIAN_DIR)/wml_backend/p4_gm4
	rm -rvf $(DEBIAN_DIR)/wml_backend/p9_slice
	rm -rvf $(DEBIAN_DIR)/wml_common/bitvector
	rm -rvf $(DEBIAN_DIR)/wml_common/gd/libgd
	rm -rvf $(DEBIAN_DIR)/wml_common/getoptlong
	rm -rvf $(DEBIAN_DIR)/wml_common/imagesize
	rm -rvf $(DEBIAN_DIR)/wml_common/io
	rm -rvf $(DEBIAN_DIR)/wml_common/termreadkey
	# Do not remove wml_test for now.

	# Pack the Debian Source
	tar cv -C $(t) -f ../wml_$(DEBIAN_VERSION).orig.tar \
		wml-$(UPSTREAM_VERSION).orig
	gzip -9vf ../wml_$(DEBIAN_VERSION).orig.tar

	# Clean up again
	rm -rf $(t)

configure: configure-stamp
configure-stamp: $(QUILT_STAMPFN)
	dh_testdir

	# Always use uptodate config.{sub,guess} from autotools-dev
	cp -fb -S .dbk /usr/share/misc/config.sub etc/
	cp -fb -S .dbk /usr/share/misc/config.guess etc/

	./configure --prefix=/usr --with-catdir=man --mandir=/usr/share/man
	touch configure-stamp

build: build-stamp
build-stamp: configure
	dh_testdir
	$(MAKE)
	touch build-stamp

clean: unpatch
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	# Add here commands to clean up after the build process.
	[ ! -f Makefile ] || $(MAKE) distclean
	dh_clean
	# Restore original config.{sub,guess}
	-test -r etc/config.sub.dbk && \
	 mv -f etc/config.sub.dbk etc/config.sub
	-test -r etc/config.guess.dbk && \
	 mv -f etc/config.guess.dbk etc/config.guess

# Build architecture-independent files here.
binary-indep: build
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

# Build architecture-dependent files here.
binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	$(MAKE) prefix=$(r)/usr mandir=$(r)/usr/share/man INSTALLDIRS=perl install
	cd wml_common/filepathconvert && \
		$(MAKE) DESTDIR=$(r) mandir=$(r)/usr/share/man INSTALLDIRS=perl install
	cd wml_common/gd && \
		$(MAKE) DESTDIR=$(r) mandir=$(r)/usr/share/man INSTALLDIRS=perl install
	dh_installdocs ANNOUNCE BUGREPORT COPYRIGHT COPYRIGHT.OTHER CREDITS \
		MANIFEST NEWS README README.mp4h SUPPORT VERSION \
		VERSION.HISTORY wml_contrib/
	find $(r) -name \*.spec | xargs rm -f
	find $(r)/usr -type f -name .packlist | xargs rm -f
	#   Fix documentation
	for f in $(r)/usr/share/man/*/*; do \
	   sed -e 's|.*/\([^/	]*\)	.*/\([^/	]*\)|s/\2/\1/|' debian/links |\
	   sed -f - $$f > $$f.new && mv $$f.new $$f; \
	done
	chmod 644 $(r)/usr/share/man/*/*
	# Install icons for wml::std::logo
	cd wml_misc && \
		$(MAKE) DESTDIR=$(r) libdir=$(r)/usr/share/wml install
	ln -vs ../../../share/wml/data/logo $(r)/usr/lib/wml/data/logo
	dh_installchangelogs ChangeLog
	dh_lintian
	dh_strip
	dh_compress
	dh_link
	dh_fixperms
	dh_installdeb
	dh_perl usr/lib/wml/perl/lib
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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