File: rules

package info (click to toggle)
unison 2.9.1-2sarge2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,084 kB
  • ctags: 2,396
  • sloc: ml: 15,015; makefile: 303; sh: 27; ansic: 8
file content (78 lines) | stat: -rwxr-xr-x 2,187 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
74
75
76
77
78
#!/usr/bin/make -f

# In order to use dpatch 
include /usr/share/dpatch/dpatch.make

PACKAGE=unison

# set $(NATIVE) to true if this arch has an optimising compiler
NATIVE := $(shell test -x /usr/bin/ocamlopt -o -x /usr/bin/ocamlopt.opt && echo true || echo false)

build: build-stamp
build-stamp: patch-stamp
	dh_testdir
#	if we have the optimising compiler, build natively with debugging because
#	we can strip it later. if we don't, disable debugging because stripping
#	the non-native binaries removes the bytecode and leaves you with the
#	interpreter, and a somewhat useless binary... =)
	$(MAKE) UISTYLE=gtk NATIVE=$(NATIVE) DEBUGGING=$(NATIVE)
	mv unison unison-gtk
	$(MAKE) UISTYLE=text NATIVE=$(NATIVE) DEBUGGING=$(NATIVE)
	env HOME=$(CURDIR) $(CURDIR)/unison -doc all > $(CURDIR)/unison-manual.txt

#	remove the chrpath of unison-gtk
	if [ "$(NATIVE)" = "true" ]; then       \
		/usr/bin/chrpath -d unison-gtk;  \
	fi

	touch build-stamp

clean: unpatch
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	rm -f unison-manual.txt unison-gtk
	-$(MAKE) clean
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	install -o root -g root -m 755 unison $(CURDIR)/debian/unison/usr/bin
	install -o root -g root -m 755 unison-gtk $(CURDIR)/debian/unison-gtk/usr/bin
	ln -s unison $(CURDIR)/debian/unison-gtk/usr/share/doc/unison-gtk
	ln -s unison.1.gz $(CURDIR)/debian/unison-gtk/usr/share/man/man1/unison-gtk.1.gz

binary-indep: build install

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installmenu
	dh_installman debian/unison.1
	dh_installchangelogs NEWS
#	Strip it if it's native or it breaks, add dependency on ocamlrun
	if [ "x$(NATIVE)" = "xtrue" ]; then\
	    for i in debian/*.substvars; do \
	      echo "interpreter:Depends=" >> $$i;\
	    done;\
	    dh_strip -a;\
	  else\
	    for i in debian/*.substvars; do \
	      echo "interpreter:Depends=ocaml-base-3.08.3" >> $$i;\
	    done;\
	fi
	dh_compress
	dh_fixperms
#	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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