]> git.sven.stormbind.net Git - sven/mysqltcl.git/blob - debian/rules
723bf5212a509546c09b2be54d10efa73de96089
[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                 --with-tcl=/usr/lib \
23                 --with-tclinclude=/usr/include/tcl \
24
25
26 LDFLAGS += -Wl,-z,defs -Wl,--as-needed
27
28 CFLAGS = -Wall -g
29
30 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
31         CFLAGS += -O0
32 else
33         CFLAGS += -O2
34 endif
35
36
37 configure: patch configure-stamp
38 configure-stamp:
39         dh_testdir
40
41         CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
42         ./configure $(CONFIGURE_OPTIONS)
43
44         touch configure-stamp
45
46 build: configure build-stamp
47 build-stamp:
48         dh_testdir
49         $(MAKE)
50         touch build-stamp
51
52 clean: cleaner unpatch
53 cleaner:
54         dh_testdir
55         dh_testroot
56         rm -f build-stamp configure-stamp
57         [ ! -f Makefile ] || $(MAKE) distclean
58         dh_clean
59
60 install: build
61         dh_testdir
62         dh_testroot
63         dh_clean -k
64         dh_installdirs
65
66         $(MAKE) install DESTDIR=$(CURDIR)/debian/mysqltcl
67         mkdir $(CURDIR)/debian/mysqltcl/usr/lib/tcltk
68         mv $(CURDIR)/debian/mysqltcl/usr/lib/mysqltcl* \
69                 $(CURDIR)/debian/mysqltcl/usr/lib/tcltk
70         rm -rf \
71                 $(CURDIR)/debian/mysqltcl/usr/share/man/mann \
72                 $(CURDIR)/debian/mysqltcl/usr/bin \
73                 $(CURDIR)/debian/mysqltcl/usr/include
74
75
76 # Build architecture-independent files here.
77 binary-indep: build install
78 # We have nothing to do by default.
79
80 # Build architecture-dependent files here.
81 binary-arch: build install
82         dh_testdir
83         dh_testroot
84         dh_installdocs
85         dh_installman
86         dh_installchangelogs ChangeLog
87         dh_link
88         dh_strip
89         dh_compress
90         dh_fixperms
91         dh_installdeb
92         dh_shlibdeps
93         tcltk-depends
94         dh_gencontrol
95         dh_md5sums
96         dh_builddeb
97
98 binary: binary-indep binary-arch
99 .PHONY: build clean binary-indep binary-arch binary install configure