use minimal dh rules file
[ckermit.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # This file was originally written by Joey Hess and Craig Small.
4 # As a special exception, when this file is copied by dh-make into a
5 # dh-make output file, you may use that output file without restriction.
6 # This special exception was added by Craig Small in version 0.37 of dh-make.
7 # modified for ckermit by Ian Beckwith <ianb@debian.org>
8
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
11
12 BUILDDIR=`pwd`/debian/ckermit
13
14 CFLAGS =-g \
15         -DIKSDCONF=\\\\\\\\\\\\\\\"/etc/kermit/iksd.conf\\\\\\\\\\\\\\\"  \
16         -DCK_SYSINI=\\\\\\\\\\\\\\\"/etc/kermit/kermrc\\\\\\\\\\\\\\\"  \
17         -DCK_INI_B -DCK_SOCKS \
18         -DX509_SUBJECT_ALT_NAME_TO_USER
19
20 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
21         CFLAGS += -O0
22 else
23         CFLAGS += -O2
24 endif
25
26 MAKEOPTS=-f makefile DESTDIR=\"$(BUILDDIR)\" BINDIR=/usr/bin MANDIR=/usr/share/man/man1 INFODIR=/usr/share/doc/ckermit KFLAGS='$(CFLAGS)' LNKFLAGS="-lsocks -Wl,-z,defs -Wl,--as-needed"
27 MAKETARGET=linux+krb5+openssl
28
29 %:
30         dh $@
31
32 override_dh_auto_build:
33         $(MAKE) $(MAKEOPTS) $(MAKETARGET)
34
35 override_dh_auto_clean:
36         $(MAKE) $(MAKEOPTS) clean
37         rm -f wermit # no longer cleaned by upstream makefile
38         rm -f UNINSTALL
39         dh_clean
40
41 override_dh_auto_install:
42         $(MAKE) $(MAKEOPTS) install
43         # move aside full config file (later linked to by dh_link)
44         mv "$(BUILDDIR)/usr/bin/ckermit.ini" "$(BUILDDIR)/etc/kermit/kermrc.full"
45         # install conf files
46         install -m 0644  -g 0 -o 0 debian/kermrc "$(BUILDDIR)/etc/kermit/"
47         install -m 0644  -g 0 -o 0 debian/iksd.conf "$(BUILDDIR)/etc/kermit/"
48         # link is recreated properly by dh_link
49         rm "$(BUILDDIR)/usr/bin/kermit-sshsub"
50         # duplicated in /usr/share/doc/ckermit/copyright
51         rm "$(BUILDDIR)/usr/share/doc/ckermit/COPYING.TXT"
52
53 override_dh_installchangelogs:
54         dh_installchangelogs -k ckc299.txt
55
56 override_dh_installpam:
57         dh_installpam --name=kermit