File: rules

package info (click to toggle)
haskell-hledger-interest 1.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 96 kB
  • ctags: 10
  • sloc: haskell: 290; makefile: 48
file content (73 lines) | stat: -rwxr-xr-x 1,862 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
#!/usr/bin/make -f

INSTALL = install
INSTALL_FILE    = $(INSTALL) -p    -o root -g root  -m  644
INSTALL_PROGRAM = $(INSTALL) -p    -o root -g root  -m  755
INSTALL_SCRIPT  = $(INSTALL) -p    -o root -g root  -m  755
INSTALL_DIR     = $(INSTALL) -p -d -o root -g root  -m  755

package=hledger-interest

clean:
	$(checkdir)
	rm -f debian/hlibrary.setup stamp-configure build-arch
	rm -rf debian/$(package)

build: build-arch build-indep
build-indep:

build-arch: stamp-configure debian/hlibrary.setup
	$(checkdir)

	debian/hlibrary.setup build

	touch build-arch

stamp-configure: debian/hlibrary.setup
	$(checkdir)

	debian/hlibrary.setup configure --prefix=/usr

	touch stamp-configure

binary: binary-arch

binary-indep:	checkroot build

binary-arch:	checkroot build debian/hlibrary.setup
	$(checkdir)

	debian/hlibrary.setup copy --destdir=$(CURDIR)/debian/$(package)
	rm -rf debian/$(package)/usr/share/doc/$(package)-*
	cd debian/$(package) && $(INSTALL_DIR) \
		usr/bin \
		usr/share/doc/$(package) \
		DEBIAN

	$(INSTALL_FILE) debian/copyright debian/$(package)/usr/share/doc/$(package)/copyright

	$(INSTALL_FILE) debian/changelog debian/$(package)/usr/share/doc/$(package)/changelog.Debian
	gzip -9f debian/$(package)/usr/share/doc/$(package)/changelog.Debian

	dpkg-shlibdeps -Tdebian/substvars -dDepends debian/$(package)/usr/bin/*
	dpkg-gencontrol -ldebian/changelog -isp -p$(package) -Tdebian/substvars -Pdebian/$(package)

	cd debian/$(package) && find * -type f ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums

	chown -R root:root debian/$(package)
	chmod -R go=rX debian/$(package)

	dpkg --build debian/$(package) ..

debian/hlibrary.setup:
	ghc --make Setup.hs -o $@

define checkdir
	test -f debian/rules
endef

checkroot:
	$(checkdir)
	test root = "`whoami`"

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