]> git.sven.stormbind.net Git - sven/mysqltcl.git/blob - debian/rules
* Adopt the new Tcl/Tk policy and move the lib into /usr/lib/tcltk.
[sven/mysqltcl.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 include /usr/share/quilt/quilt.make
7
8
9 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
10         CONFIGURE_OPTIONS += --build $(DEB_HOST_GNU_TYPE)
11 else
12         CONFIGURE_OPTIONS += --build $(DEB_BUILD_GNU_TYPE) \
13                 --host $(DEB_HOST_GNU_TYPE)
14 endif
15
16
17 CONFIGURE_OPTIONS += \
18                 --prefix=/usr \
19                 --enable-threads \
20                 --mandir=/usr/share/man \
21                 --infodir=/usr/share/info \
22
23
24 LDFLAGS += -Wl,-z,defs -Wl,--as-needed
25
26 CFLAGS += -Wall -g
27
28 ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
29         CFLAGS += -O2
30 else
31         CFLAGS += -O0
32 endif
33
34
35 configure: patch configure-stamp
36 configure-stamp:
37         dh_testdir
38
39         CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
40         ./configure $(CONFIGURE_OPTIONS)
41
42         touch configure-stamp
43
44 build: configure build-stamp
45 build-stamp:
46         dh_testdir
47         $(MAKE)
48         touch build-stamp
49
50 clean: cleaner unpatch
51 cleaner:
52         dh_testdir
53         dh_testroot
54         rm -f build-stamp configure-stamp
55         [ ! -f Makefile ] || $(MAKE) distclean
56         dh_clean
57
58 install: build
59         dh_testdir
60         dh_testroot
61         dh_clean -k
62         dh_installdirs
63
64         $(MAKE) install DESTDIR=$(CURDIR)/debian/mysqltcl
65         mkdir $(CURDIR)/debian/mysqltcl/usr/lib/tcltk
66         mv $(CURDIR)/debian/mysqltcl/usr/lib/mysqltcl* $(CURDIR)/debian/mysqltcl/usr/lib/tcltk
67         rm -rf \
68                 $(CURDIR)/debian/mysqltcl/usr/share/man/mann \
69                 $(CURDIR)/debian/mysqltcl/usr/bin \
70                 $(CURDIR)/debian/mysqltcl/usr/include
71
72
73 # Build architecture-independent files here.
74 binary-indep: build install
75 # We have nothing to do by default.
76
77 # Build architecture-dependent files here.
78 binary-arch: build install
79         dh_testdir
80         dh_testroot
81         dh_installdocs
82         dh_installman
83         dh_installchangelogs ChangeLog
84         dh_link
85         dh_strip
86         dh_compress
87         dh_fixperms
88         dh_installdeb
89         dh_shlibdeps
90         tcltk-depends
91         dh_gencontrol
92         dh_md5sums
93         dh_builddeb
94
95 binary: binary-indep binary-arch
96 .PHONY: build clean binary-indep binary-arch binary install configure