86269e40528eaf9d516760bebba71dc9722d9091
[ckermit.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # debian/rules for ckermit
4 # GNU copyright 1997 to 1999 by Joey Hess.
5 # modified for ckermit by Ian Beckwith <ianb@debian.org>
6
7 # Uncomment this to turn on verbose mode.
8 #export DH_VERBOSE=1
9
10 BUILDDIR=`pwd`/debian/ckermit
11
12 CFLAGS = -O2 \
13         -DCK_SYSINI=\\\"/etc/kermit/kermrc\\\"    \
14         -DIKSDCONF=\\\"/etc/kermit/iksd.conf\\\"  \
15         -DCK_INI_B -DCK_SOCKS \
16         -DX509_SUBJECT_ALT_NAME_TO_USER \
17         -DFNFLOAT -DCK_NEWTERM \
18         -DUSE_STRERROR -DCK_NCURSES \
19         -DHAVE_OPENPTY \
20         -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
21         -DOPENSSL_097 -DOPENSSL_098 -DOPENSSL_100
22
23 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
24         CFLAGS += -O0
25 else
26         CFLAGS += -O2
27 endif
28
29 MAKEOPTS=-f makefile DESTDIR=\"$(BUILDDIR)\" BINDIR=/usr/bin MANDIR=/usr/share/man/man1 INFODIR=/usr/share/doc/ckermit KFLAGS='$(CFLAGS)' LNKFLAGS="-lsocks -lutil -Wl,-z,defs -Wl,--as-needed"
30 MAKETARGET=linux+krb5+openssl+zlib+shadow+pam
31
32 configure: configure-stamp
33 configure-stamp:
34         dh_testdir
35
36         touch configure-stamp
37
38
39 build: build-stamp
40
41 build-stamp: configure-stamp
42         dh_testdir
43
44         $(MAKE) $(MAKEOPTS) $(MAKETARGET)
45
46         touch build-stamp
47
48 clean:
49         dh_testdir
50         dh_testroot
51         rm -f build-stamp configure-stamp
52
53         $(MAKE) $(MAKEOPTS) clean
54         rm -f wermit # no longer cleaned by upstream makefile
55         rm -f UNINSTALL
56         dh_clean
57
58 install: build
59         dh_testdir
60         dh_testroot
61         dh_prep
62         dh_installdirs
63
64         # Add here commands to install the package into debian/ckermit.
65         $(MAKE) $(MAKEOPTS) install
66         # move aside full config file (later linked to by dh_link)
67         mv "$(BUILDDIR)/usr/bin/ckermit.ini" "$(BUILDDIR)/etc/kermit/kermrc.full"
68         # install conf files
69         install -m 0644  -g 0 -o 0 debian/kermrc "$(BUILDDIR)/etc/kermit/"
70         install -m 0644  -g 0 -o 0 debian/iksd.conf "$(BUILDDIR)/etc/kermit/"
71         # link is recreated properly by dh_link
72         rm "$(BUILDDIR)/usr/bin/kermit-sshsub"
73         # duplicated in /usr/share/doc/ckermit/copyright
74         rm "$(BUILDDIR)/usr/share/doc/ckermit/COPYING.TXT"
75
76 # Build architecture-independent files here.
77 binary-indep: build install
78 # We have nothing to do by default.
79
80 # Build architecture-dependent files here.
81 binary-arch: build install
82         dh_testdir
83         dh_testroot
84         dh_installchangelogs -k ckc211.txt
85         dh_installdocs
86         dh_installdirs
87         dh_installmenu
88         dh_installdebconf
89         dh_installpam --name=kermit
90         dh_installman
91         dh_lintian
92         dh_link
93         dh_strip
94         dh_compress
95         dh_fixperms
96         dh_makeshlibs
97         dh_installdeb
98         dh_shlibdeps
99         dh_gencontrol
100         dh_md5sums
101         dh_builddeb
102
103 binary: binary-indep binary-arch
104 .PHONY: build clean binary-indep binary-arch binary install configure