]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - package/debian/rules
ncurses 5.9 - patch 20150530
[ncurses.git] / package / debian / rules
index c66edd4921c3ba6f62beecc823bd16da7f32903e..bff27f2b75a5fc3e3572064f9bd4ed6838499b24 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/bin/make -f
-# MAde with the aid of dh_make, by Craig Small
+# Made with the aid of dh_make, by Craig Small
 # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
 # Some lines taken from debmake, by Cristoph Lameter.
 
@@ -14,11 +14,22 @@ DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
 CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
 
-MY_DIR=/usr/local/ncurses6
+MY_ABI=6
+MY_DIR=/usr
 MYDATA=/usr/local/ncurses/share/terminfo
-BUILD_DIR=$(CURDIR)/debian/ncurses6
+BUILD_DIR=$(CURDIR)/debian/ncurses$(MY_ABI)
 
-CFLAGS = $(CC_NORMAL)
+CFLAGS   = $(shell dpkg-buildflags --get CFLAGS) $(CC_NORMAL)
+CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
+LDFLAGS  = $(shell dpkg-buildflags --get LDFLAGS)
+
+ifneq ($(MY_DIR),/usr)
+       RPATH_ENV = RPATH_LIST=../lib:$(MY_DIR)/lib
+       RPATH_OPT = --enable-rpath
+else
+       RPATH_ENV =
+       RPATH_OPT = --disable-rpath --disable-rpath-hack
+endif
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
         CFLAGS += -O0
@@ -34,8 +45,10 @@ configure: configure-stamp
 configure-stamp:
        dh_testdir
 
-       RPATH_LIST=../lib:$(MY_DIR)/lib \
-       CFLAGS="$(CFLAGS)" ./configure \
+       $(RPATH_ENV) \
+       CFLAGS="$(CFLAGS)" \
+       CPPFLAGS="$(CPPFLAGS)" \
+       LDFLAGS="$(LDFLAGS)" ./configure $(RPATH_OPT) \
                --host=$(DEB_HOST_GNU_TYPE) \
                --build=$(DEB_BUILD_GNU_TYPE) \
                --prefix=$(MY_DIR) \
@@ -45,6 +58,7 @@ configure-stamp:
                --disable-getcap \
                --disable-leaks \
                --disable-macros  \
+               --disable-overwrite  \
                --disable-termcap \
                --enable-const \
                --enable-ext-colors \
@@ -53,15 +67,16 @@ configure-stamp:
                --enable-hard-tabs \
                --enable-interop \
                --enable-pc-files \
-               --enable-rpath \
                --enable-sp-funcs \
                --enable-warnings \
+               --enable-wgetch-events \
                --enable-widec \
+               --program-suffix=$(MY_ABI) \
                --verbose \
                --with-chtype=uint32_t \
                --with-mmask_t=uint32_t \
                --with-develop \
-               --with-pc-suffix=6 \
+               --with-extra-suffix=$(MY_ABI) \
                --with-shared \
                --with-termlib \
                --with-ticlib \
@@ -103,7 +118,7 @@ install-stamp: build-stamp
        $(MAKE) install.libs install.progs DESTDIR=$(BUILD_DIR)
 
        ( cd test && make ncurses LOCAL_LIBDIR=$(MY_DIR)/lib )
-       mv test/ncurses $(BUILD_DIR)$(MY_DIR)/bin/ncurses6
+       mv test/ncurses $(BUILD_DIR)$(MY_DIR)/bin/ncurses$(MY_ABI)
 
        touch install-stamp
 
@@ -120,6 +135,7 @@ binary-arch: build install
        dh_compress
        dh_fixperms
        dh_installdeb
+       dh_makeshlibs
        dh_shlibdeps
        dh_gencontrol
        dh_md5sums