]> git.sven.stormbind.net Git - sven/mysqltcl.git/blob - debian/rules
cdacbbe2011f0753cd6bee9bf773a8c540ccf0aa
[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* \
67                 $(CURDIR)/debian/mysqltcl/usr/lib/tcltk
68         rm -rf \
69                 $(CURDIR)/debian/mysqltcl/usr/share/man/mann \
70                 $(CURDIR)/debian/mysqltcl/usr/bin \
71                 $(CURDIR)/debian/mysqltcl/usr/include
72
73
74 # Build architecture-independent files here.
75 binary-indep: build install
76 # We have nothing to do by default.
77
78 # Build architecture-dependent files here.
79 binary-arch: build install
80         dh_testdir
81         dh_testroot
82         dh_installdocs
83         dh_installman
84         dh_installchangelogs ChangeLog
85         dh_link
86         dh_strip
87         dh_compress
88         dh_fixperms
89         dh_installdeb
90         dh_shlibdeps
91         tcltk-depends
92         dh_gencontrol
93         dh_md5sums
94         dh_builddeb
95
96 binary: binary-indep binary-arch
97 .PHONY: build clean binary-indep binary-arch binary install configure