ncurses 5.9 - patch 20120608
[ncurses.git] / package / debian / rules
1 #!/usr/bin/make -f
2 # MAde with the aid of dh_make, by Craig Small
3 # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
4 # Some lines taken from debmake, by Cristoph Lameter.
5
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
8
9 # These are used for cross-compiling and for saving the configure script
10 # from having to guess our platform (since we know it already)
11 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13
14 CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
15 CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
16
17 MY_DIR=/usr/local/ncurses6
18 MYDATA=/usr/local/ncurses/share/terminfo
19
20 CFLAGS = $(CC_NORMAL)
21
22 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
23         CFLAGS += -O0
24 else
25         CFLAGS += -O2
26 endif
27 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
28         INSTALL_PROGRAM += -s
29 endif
30
31
32 configure: configure-stamp
33 configure-stamp:
34         dh_testdir
35
36         RPATH_LIST=../lib:$(MY_DIR)/lib \
37         CFLAGS="$(CFLAGS)" ./configure \
38                 --host=$(DEB_HOST_GNU_TYPE) \
39                 --build=$(DEB_BUILD_GNU_TYPE) \
40                 --prefix=$(MY_DIR) \
41                 --with-default-terminfo-dir=$(MYDATA) \
42                 --with-terminfo-dirs=$(MYDATA):/usr/share/terminfo \
43                 --disable-echo \
44                 --disable-getcap \
45                 --disable-leaks \
46                 --disable-macros  \
47                 --disable-termcap \
48                 --enable-const \
49                 --enable-ext-colors \
50                 --enable-ext-mouse \
51                 --enable-hard-tabs \
52                 --enable-rpath \
53                 --enable-sp-funcs \
54                 --enable-warnings \
55                 --enable-widec \
56                 --verbose \
57                 --with-develop \
58                 --with-shared \
59                 --with-termlib \
60                 --with-ticlib \
61                 --with-trace \
62                 --with-xterm-kbs=DEL \
63                 --without-ada \
64                 --without-debug \
65                 --without-normal
66
67         touch configure-stamp
68
69 build: build-stamp
70 build-stamp: configure-stamp
71         dh_testdir
72
73         $(MAKE)
74
75         touch build-stamp
76
77 clean:
78         dh_testdir
79         dh_testroot
80
81         [ ! -f makefile ] || $(MAKE) distclean
82
83         rm -f configure-stamp build-stamp install-stamp
84
85         dh_clean
86
87 install: install-stamp
88 install-stamp: build-stamp
89         dh_testdir
90         dh_testroot
91         dh_clean -k
92         dh_installdirs
93
94         $(MAKE) install.libs install.progs DESTDIR=$(CURDIR)/debian/ncurses6
95
96         touch install-stamp
97
98 # Build architecture-independent files here.
99 binary-indep: build install
100 # No binary-indep target.
101
102 # Build architecture-dependent files here.
103 binary-arch: build install
104         dh_testdir
105         dh_testroot
106         dh_installchangelogs NEWS
107         dh_strip
108         dh_compress
109         dh_fixperms
110         dh_installdeb
111         dh_shlibdeps
112         dh_gencontrol
113         dh_md5sums
114         dh_builddeb
115
116 binary: binary-indep binary-arch
117 .PHONY: build clean binary-indep binary-arch binary install install-stamp