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