Fix Hurd FTBFS: (Closes: #674444)
[ckermit.git] / debian / rules
index a378309..c0a0e4d 100755 (executable)
@@ -1,17 +1,16 @@
 #!/usr/bin/make -f
 # -*- makefile -*-
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-# modified for ckermit by Ian Beckwith <ianb@debian.org>
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
 BUILDDIR=`pwd`/debian/ckermit
 
-CFLAGS =-g \
+CFLAGS = `dpkg-buildflags --get CFLAGS`
+CFLAGS += `dpkg-buildflags --get CPPFLAGS`
+CFLAGS +=-g \
        -DIKSDCONF=\\\\\\\\\\\\\\\"/etc/kermit/iksd.conf\\\\\\\\\\\\\\\"  \
        -DCK_SYSINI=\\\\\\\\\\\\\\\"/etc/kermit/kermrc\\\\\\\\\\\\\\\"  \
        -DCK_INI_B -DX509_SUBJECT_ALT_NAME_TO_USER
@@ -19,10 +18,22 @@ CFLAGS =-g \
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -O0
 else
-       CFLAGS += -O2
+       CFLAGS += -O1
+endif
+
+DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+ifneq (,$(or $(findstring kfreebsd, $(DEB_HOST_ARCH_OS)), $(findstring hurd, $(DEB_HOST_ARCH_OS))))
+       CFLAGS += -DSELECT
 endif
 
-MAKEOPTS=-f makefile DESTDIR=\"$(BUILDDIR)\" BINDIR=/usr/bin MANDIR=/usr/share/man/man1 INFODIR=/usr/share/doc/ckermit KFLAGS='$(CFLAGS)' LNKFLAGS="-Wl,-z,defs -Wl,--as-needed"
+ifeq (,$(findstring hurd, $(DEB_HOST_ARCH_OS)))
+       CFLAGS += -DHAVE_PTMX
+endif
+
+LINKERFLAGS=`dpkg-buildflags --get LDFLAGS`
+LINKERFLAGS+=-Wl,-z,defs -Wl,--as-needed
+
+MAKEOPTS=-f makefile DESTDIR=\"$(BUILDDIR)\" BINDIR=/usr/bin MANDIR=/usr/share/man/man1 INFODIR=/usr/share/doc/ckermit KFLAGS='$(CFLAGS)' MULTIARCH=\"$(DEB_HOST_MULTIARCH)\" LNKFLAGS="$(LINKERFLAGS)"
 MAKETARGET=linux+krb5+openssl
 
 %:
@@ -50,7 +61,7 @@ override_dh_auto_install:
        rm "$(BUILDDIR)/usr/share/doc/ckermit/COPYING.TXT"
 
 override_dh_installchangelogs:
-       dh_installchangelogs -k ckc299.txt
+       dh_installchangelogs -k ckc302.txt
 
 override_dh_installpam:
        dh_installpam --name=kermit