summaryrefslogtreecommitdiff
path: root/debian/rules
blob: aaaea244f389644ad0959b977e01fb6875135b50 (plain)
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
#!/usr/bin/make -f
# rules for mtools package
# by Luis Bustamante (luferbu@fluidsignal.com)

export DH_VERBOSE=1
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

configure: configure-stamp
configure-stamp:
	dh_testdir
	cp -f /usr/share/misc/config.sub /usr/share/misc/config.guess .
	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
	    --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc
	touch configure-stamp

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

clean: unpatch
	dh_testdir
	dh_testroot
	rm -rf build-stamp configure-stamp
	rm -rf config.sub config.guess
	[ ! -f Makefile ] || $(MAKE) distclean
	dh_clean config.cache config.log config.status .#patchlevel.c.1.18 .#mtools.spec.1.4 .#mtools.texi.1.11 .#fat_size_calculation.tex.1.1

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	$(MAKE) install prefix=$$( pwd )/debian/tmp/usr
	install -m 644 debian/mtools.conf debian/mtools/etc/
	dh_movefiles

binary-indep:
binary-arch: mtools
binary: binary-indep binary-arch

mtools: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installexamples -pmtools mtools.conf
	dh_installman
	dh_installinfo -pmtools mtools.info
	dh_undocumented -pmtools mcheck.1 mcomp.1 mxtar.1
	dh_installchangelogs
	dh_strip
	dh_link -pmtools /usr/share/man/man5/mtools.5 /usr/share/man/man5/mtools.conf.5
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

.PHONY: build clean binary-indep binary-arch binary install \
	mtools patch clean-build unpatch configure