File: rules

package info (click to toggle)
eb 4.4.3-13
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,944 kB
  • sloc: ansic: 22,726; sh: 10,130; perl: 1,114; makefile: 706
file content (131 lines) | stat: -rwxr-xr-x 4,410 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

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)

SUBDIRS_INDEP = doc
SUBDIRS_ARCH = eb libebutils ebappendix ebfont ebinfo ebrefile ebstopcode ebzip po-eb po-ebutils m4
DIST_SUBDIRS = doc eb libebutils ebappendix ebfont ebinfo ebrefile ebstopcode ebzip m4 samples

config.status: configure
	dh_testdir
	dh_update_autotools_config
	CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) --with-pkgdocdir=/usr/share/doc/eb-doc

build: build-indep build-arch

build-indep: build-indep-stamp
build-indep-stamp: config.status
	$(MAKE) SUBDIRS="$(SUBDIRS_INDEP)"
	touch $@

build-arch: build-arch-stamp
build-arch-stamp: config.status
	rm -f eb.conf
	$(MAKE) SUBDIRS="$(SUBDIRS_ARCH)"
	perl -i -pe 's!/usr/lib/'`dpkg-architecture -qDEB_HOST_MULTIARCH`'!/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`!g' eb.conf
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-indep-stamp build-arch-stamp
	rm -f po-eb/Makefile po-ebutils/Makefile
	[ ! -f Makefile ] || $(MAKE) DIST_SUBDIRS="$(DIST_SUBDIRS)" distclean
	dh_clean

install: install-indep install-arch

install-indep:
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs -i

#	for d in $(SUBDIRS_INDEP); do \
#	  (cd $${d} && make DESTDIR=$(CURDIR)/debian/tmp install); \
#	done
	install -d $(CURDIR)/debian/tmp/usr/share/doc/eb-doc/html
	for f in doc/*.html doc/*.css; do \
	  nkf -w $${f} | LC_ALL=C sed -r 's/.*content-type.*charset=.*//i' > $(CURDIR)/debian/tmp/usr/share/doc/eb-doc/html/`basename $${f}`; \
	done
	for f in README NEWS; do \
	  nkf -w $${f} > $(CURDIR)/debian/tmp/usr/share/doc/eb-doc/`basename $${f}`; \
	done
	install debian/README.Debian $(CURDIR)/debian/tmp/usr/share/doc/eb-doc/

	dh_movefiles -i
	dh_install -i

install-arch:
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs -a

	$(MAKE) SUBDIRS="$(SUBDIRS_ARCH)" DESTDIR=$(CURDIR)/debian/tmp install

	install -d $(CURDIR)/debian/tmp/usr/share/man/man1
	for f in $(CURDIR)/debian/*.h2m; do \
	  b=`basename $${f} .h2m`; \
	  m=$(CURDIR)/debian/tmp/usr/share/man/man1/$${b}.1; \
	  d=`sed -e 's/ .*//;q' $(CURDIR)/ChangeLog`; \
	  LD_LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) SOURCE_DATE_EPOCH=`date --utc -d $${d} +%s` help2man --no-info --include=$${f} --output=$${m} $(CURDIR)/debian/tmp/usr/bin/$${b}; \
	  sed 's/"'$${b}' (EB Library)/"EB Library/; s/ version//' $${m} > $${m}.tmp && mv -f $${m}.tmp $${m}; \
	  rm -f $${m}.tmp; \
	done
	install -d $(CURDIR)/debian/tmp/usr/share/eb
	for f in README; do \
	  nkf -w $${f} > $(CURDIR)/debian/tmp/usr/share/eb/`basename $${f}`; \
	done
	install debian/README.Debian $(CURDIR)/debian/tmp/usr/share/eb/

	dh_movefiles -a
	dh_install -a
	rm -f $(CURDIR)/debian/eb-utils/usr/bin/ebunzip
	rm -f $(CURDIR)/debian/eb-utils/usr/bin/ebzipinfo

binary-common:
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_installexamples
#	dh_installmenu
#	dh_installdebconf
#	dh_installinfo
	dh_installman
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture independant packages using the common target.
binary-indep: build-indep install-indep
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common

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