Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3
4 # Uncomment this to turn on verbose mode.
5 #export DH_VERBOSE=1
6
7 # These are used for cross-compiling and for saving the configure script
8 # from having to guess our platform (since we know it already)
9 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
10 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
11 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
12
13 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
14 dpkg_buildflags = DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) dpkg-buildflags
15 CFLAGS=$(shell $(dpkg_buildflags) --get CFLAGS)
16 CPPFLAGS=$(shell $(dpkg_buildflags) --get CPPFLAGS)
17 LDFLAGS=$(shell $(dpkg_buildflags) --get LDFLAGS)
18
19 SUBDIRS_INDEP = doc
20 SUBDIRS_ARCH = eb libebutils ebappendix ebfont ebinfo ebrefile ebstopcode ebzip po-eb po-ebutils m4
21 DIST_SUBDIRS = doc eb libebutils ebappendix ebfont ebinfo ebrefile ebstopcode ebzip m4 samples
22
23 config.status: configure
24 dh_testdir
25 dh_update_autotools_config
26 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
27
28 build: build-indep build-arch
29
30 build-indep: build-indep-stamp
31 build-indep-stamp: config.status
32 $(MAKE) SUBDIRS="$(SUBDIRS_INDEP)"
33 touch $@
34
35 build-arch: build-arch-stamp
36 build-arch-stamp: config.status
37 rm -f eb.conf
38 $(MAKE) SUBDIRS="$(SUBDIRS_ARCH)"
39 perl -i -pe 's!/usr/lib/'`dpkg-architecture -qDEB_HOST_MULTIARCH`'!/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`!g' eb.conf
40 touch $@
41
42 clean:
43 dh_testdir
44 dh_testroot
45 rm -f build-indep-stamp build-arch-stamp
46 rm -f po-eb/Makefile po-ebutils/Makefile
47 [ ! -f Makefile ] || $(MAKE) DIST_SUBDIRS="$(DIST_SUBDIRS)" distclean
48 dh_clean
49
50 install: install-indep install-arch
51
52 install-indep:
53 dh_testdir
54 dh_testroot
55 dh_prep
56 dh_installdirs -i
57
58 # for d in $(SUBDIRS_INDEP); do \
59 # (cd $${d} && make DESTDIR=$(CURDIR)/debian/tmp install); \
60 # done
61 install -d $(CURDIR)/debian/tmp/usr/share/doc/eb-doc/html
62 for f in doc/*.html doc/*.css; do \
63 nkf -w $${f} | LC_ALL=C sed -r 's/.*content-type.*charset=.*//i' > $(CURDIR)/debian/tmp/usr/share/doc/eb-doc/html/`basename $${f}`; \
64 done
65 for f in README NEWS; do \
66 nkf -w $${f} > $(CURDIR)/debian/tmp/usr/share/doc/eb-doc/`basename $${f}`; \
67 done
68 install debian/README.Debian $(CURDIR)/debian/tmp/usr/share/doc/eb-doc/
69
70 dh_movefiles -i
71 dh_install -i
72
73 install-arch:
74 dh_testdir
75 dh_testroot
76 dh_prep
77 dh_installdirs -a
78
79 $(MAKE) SUBDIRS="$(SUBDIRS_ARCH)" DESTDIR=$(CURDIR)/debian/tmp install
80
81 install -d $(CURDIR)/debian/tmp/usr/share/man/man1
82 for f in $(CURDIR)/debian/*.h2m; do \
83 b=`basename $${f} .h2m`; \
84 m=$(CURDIR)/debian/tmp/usr/share/man/man1/$${b}.1; \
85 d=`sed -e 's/ .*//;q' $(CURDIR)/ChangeLog`; \
86 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}; \
87 sed 's/"'$${b}' (EB Library)/"EB Library/; s/ version//' $${m} > $${m}.tmp && mv -f $${m}.tmp $${m}; \
88 rm -f $${m}.tmp; \
89 done
90 install -d $(CURDIR)/debian/tmp/usr/share/eb
91 for f in README; do \
92 nkf -w $${f} > $(CURDIR)/debian/tmp/usr/share/eb/`basename $${f}`; \
93 done
94 install debian/README.Debian $(CURDIR)/debian/tmp/usr/share/eb/
95
96 dh_movefiles -a
97 dh_install -a
98 rm -f $(CURDIR)/debian/eb-utils/usr/bin/ebunzip
99 rm -f $(CURDIR)/debian/eb-utils/usr/bin/ebzipinfo
100
101 binary-common:
102 dh_testdir
103 dh_testroot
104 dh_installchangelogs ChangeLog
105 dh_installdocs
106 dh_installexamples
107 # dh_installmenu
108 # dh_installdebconf
109 # dh_installinfo
110 dh_installman
111 dh_link
112 dh_strip
113 dh_compress
114 dh_fixperms
115 dh_makeshlibs
116 dh_installdeb
117 dh_shlibdeps
118 dh_gencontrol
119 dh_md5sums
120 dh_builddeb
121
122 # Build architecture independant packages using the common target.
123 binary-indep: build-indep install-indep
124 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
125
126 # Build architecture dependant packages using the common target.
127 binary-arch: build-arch install-arch
128 $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
129
130 binary: binary-indep binary-arch
131 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch build-indep build-arch