rules 3.12 KB
Newer Older
1 2 3 4 5
#!/usr/bin/make -f

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

6 7
include /usr/share/quilt/quilt.make

8 9 10
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
11
build-stamp: configure-stamp
12
	dh_testdir
13
	dh_auto_build
14 15
	touch build-stamp

16 17 18 19 20 21
# aclocal (called from autoreconf) finds gettext *.m4 files
GETTEXT_TOP_FILES=	ABOUT-NLS config.rpath
GETTEXT_PO_FILES=	Makefile.in.in Rules-quot boldquot.sed \
			en@boldquot.header en@quot.header insert-header.sin \
			quot.sed remove-potcdate.sin

22
configure-stamp: $(QUILT_STAMPFN)
23
	# Move everything we don't need away
24 25
	tar cvf debian/not-needed-for-build.tar \
		intl ABOUT-NLS Makefile.in aclocal.m4 config.guess config.sub \
26
		config.h.in configure depcomp install-sh ltmain.sh missing \
27
		mkinstalldirs src/ltdl.*
28 29 30
	# In the future, an external PCRE should be used if possible
	#mv -vi pcre debian/not-needed-for-build/

31
	test -d m4 || mkdir m4
32 33 34 35 36 37 38
	for f in ${GETTEXT_TOP_FILES}; do \
		cp -f /usr/share/gettext/$$f .; \
	done
	for f in ${GETTEXT_PO_FILES}; do \
		cp -f /usr/share/gettext/po/$$f po/; \
	done

39
	ACLOCAL=aclocal-1.9 AUTOMAKE=automake-1.9 dh_autoreconf
40

41
	dh_auto_configure -- \
42
    --without-included-ltdl \
43 44 45 46
    --prefix=/usr \
    --mandir='$${prefix}/share/man' \
    --with-modules='intl:gettext' \
    --with-tidy=/usr/bin/tidy
47
	@:>$@
48

49
clean: 
50 51
	dh_testdir
	dh_testroot
52 53
	# Generated stuff
	rm -rf autom4te.cache m4
54 55 56 57
	# Generated stuff, should be replaced by dh-reconf or so
	ACLOCAL=aclocal-1.9 AUTOMAKE=automake-1.9 dh_autoreconf_clean
	-tar cvf debian/needed-after-clean.tar ABOUT-NLS po/Makefile.in.in
	# PO stuff
58
	cd po && rm -f ${GETTEXT_PO_FILES} stamp-po POTFILES Makefile.in
59 60
	rm -f ${GETTEXT_TOP_FILES}
	# Restore as much as possible for easy VCS usage
61 62 63 64
	[ ! -f debian/not-needed-for-build.tar ] || tar xvf debian/not-needed-for-build.tar
	#[ ! -f Makefile ] || $(MAKE) clean
	[ ! -f debian/needed-after-clean.tar ] || tar xvf debian/needed-after-clean.tar
	#[ ! -f Makefile ] || $(MAKE) distclean
65 66 67
	#rm -f \
	#    aclocal.m4 config.guess config.h.in config.sub configure depcomp \
	#    install-sh ltmain.sh missing mkinstalldirs
68 69 70
	rm -vf config.h config.log config.status libtool stamp-h1 debian/*.tar \
	       doc/mp4h.html doc/mp4h.pod modules/intl/gettext.mp4hp src/mp4h \
	       pcre/chartables.c pcre/dftables
71
	#find . -name Makefile.in | xargs -r rm
72 73 74 75 76 77
	find . -name .deps -o -name .libs | xargs -r rm -rv
	find . -not -path './debian/*' \
	       -name '*.[ao13]' \
	    -o -name '*.l[ao]' \
	    -o -name Makefile \
	    | xargs -r rm -v
78
	dh_clean build-stamp configure-stamp
79
	$(MAKE) -f debian/rules unpatch
80 81 82 83

install: build-stamp
	dh_testdir
	dh_testroot
84
	dh_prep
85
	dh_auto_install
86
	sed -e "/dependency_libs/ s/'.*'/''/" \
87
	    -i "`find $(CURDIR)/debian/mp4h/usr/lib -name gettext.la`"
88 89 90 91 92 93 94 95

binary: binary-arch binary-indep

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs README README.pcre CREDITS doc/mp4h.html
	dh_installchangelogs ChangeLog
96
	-find $(CURDIR)/debian/mp4h -type d -empty -delete
97 98 99 100 101 102 103 104 105 106 107 108
	dh_strip
	dh_compress
	dh_fixperms
	dh_shlibdeps
	dh_gencontrol
	dh_installdeb
	dh_md5sums
	dh_builddeb

binary-indep:

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