ncurses 5.9 - patch 20141220
[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 BUILD_DIR=$(CURDIR)/debian/ncurses6
20
21 CFLAGS = $(CC_NORMAL)
22
23 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
24         CFLAGS += -O0
25 else
26         CFLAGS += -O2
27 endif
28 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
29         INSTALL_PROGRAM += -s
30 endif
31
32
33 configure: configure-stamp
34 configure-stamp:
35         dh_testdir
36
37         RPATH_LIST=../lib:$(MY_DIR)/lib \
38         CFLAGS="$(CFLAGS)" ./configure \
39                 --host=$(DEB_HOST_GNU_TYPE) \
40                 --build=$(DEB_BUILD_GNU_TYPE) \
41                 --prefix=$(MY_DIR) \
42                 --with-default-terminfo-dir=$(MYDATA) \
43                 --with-terminfo-dirs=$(MYDATA):/usr/share/terminfo \
44                 --disable-echo \
45                 --disable-getcap \
46                 --disable-leaks \
47                 --disable-macros  \
48                 --disable-termcap \
49                 --enable-const \
50                 --enable-ext-colors \
51                 --enable-ext-mouse \
52                 --enable-hard-tabs \
53                 --enable-interop \
54                 --enable-pc-files \
55                 --enable-rpath \
56                 --enable-sp-funcs \
57                 --enable-warnings \
58                 --enable-widec \
59                 --verbose \
60                 --with-chtype=uint32_t \
61                 --with-mmask_t=uint32_t \
62                 --with-develop \
63                 --with-pc-suffix=6 \
64                 --with-shared \
65                 --with-termlib \
66                 --with-ticlib \
67                 --with-trace \
68                 --with-cxx-shared \
69                 --with-versioned-syms \
70                 --with-xterm-kbs=DEL \
71                 --without-ada \
72                 --without-debug \
73                 --without-normal
74
75         touch configure-stamp
76
77 build: build-stamp
78 build-stamp: configure-stamp
79         dh_testdir
80
81         $(MAKE)
82
83         touch build-stamp
84
85 clean:
86         dh_testdir
87         dh_testroot
88
89         [ ! -f makefile ] || $(MAKE) distclean
90
91         rm -f configure-stamp build-stamp install-stamp
92
93         dh_clean
94
95 install: install-stamp
96 install-stamp: build-stamp
97         dh_testdir
98         dh_testroot
99         dh_clean -k
100         dh_installdirs
101
102         $(MAKE) install.libs install.progs DESTDIR=$(BUILD_DIR)
103
104         ( cd test && make ncurses LOCAL_LIBDIR=$(MY_DIR)/lib )
105         mv test/ncurses $(BUILD_DIR)$(MY_DIR)/bin/ncurses6
106
107         touch install-stamp
108
109 # Build architecture-independent files here.
110 binary-indep: build install
111 # No binary-indep target.
112
113 # Build architecture-dependent files here.
114 binary-arch: build install
115         dh_testdir
116         dh_testroot
117         dh_installchangelogs NEWS
118         dh_strip
119         dh_compress
120         dh_fixperms
121         dh_installdeb
122         dh_shlibdeps
123         dh_gencontrol
124         dh_md5sums
125         dh_builddeb
126
127 binary: binary-indep binary-arch
128 .PHONY: build clean binary-indep binary-arch binary install install-stamp