switch to format 3.0 (quilt)
[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 = -g -DCK_SYSINI=\\\"/etc/kermit/kermrc\\\"    \
13             -DIKSDCONF=\\\"/etc/kermit/iksd.conf\\\"  \
14             -DOPENSSL_097 -DCK_INI_B -DTIMEH -DCK_SOCKS \
15                         -DX509_SUBJECT_ALT_NAME_TO_USER
16
17 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
18         CFLAGS += -O0
19 else
20         CFLAGS += -O2
21 endif
22
23 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"
24
25 #MAKETARGET=linux+krb5+krb4+openssl+shadow+pam
26 MAKETARGET=linux+shadow+pam
27
28 configure: configure-stamp
29 configure-stamp: patch
30         dh_testdir
31
32         touch configure-stamp
33
34
35 build: build-stamp
36
37 build-stamp: configure-stamp
38         dh_testdir
39
40         $(MAKE) $(MAKEOPTS) $(MAKETARGET)
41
42         touch build-stamp
43
44 clean: unpatch
45         dh_testdir
46         dh_testroot
47         rm -f build-stamp configure-stamp
48
49         $(MAKE) $(MAKEOPTS) clean
50         rm -f wermit # no longer cleaned by upstream makefile
51         rm -f UNINSTALL
52         dh_clean
53
54 install: build
55         dh_testdir
56         dh_testroot
57         dh_clean -k
58         dh_installdirs
59
60         # Add here commands to install the package into debian/ckermit.
61         $(MAKE) $(MAKEOPTS) install
62         # move aside full config file (later linked to by dh_link)
63         mv "$(BUILDDIR)/usr/bin/ckermit.ini" "$(BUILDDIR)/etc/kermit/kermrc.full"
64         # install conf files
65         install -m 0644  -g 0 -o 0 debian/kermrc "$(BUILDDIR)/etc/kermit/"
66         install -m 0644  -g 0 -o 0 debian/iksd.conf "$(BUILDDIR)/etc/kermit/"
67         # link is recreated properly by dh_link
68         rm "$(BUILDDIR)/usr/bin/kermit-sshsub"
69         # duplicated in /usr/share/doc/ckermit/copyright
70         rm "$(BUILDDIR)/usr/share/doc/ckermit/COPYING.TXT"
71
72 # Build architecture-independent files here.
73 binary-indep: build install
74 # We have nothing to do by default.
75
76 # Build architecture-dependent files here.
77 binary-arch: build install
78         dh_testdir
79         dh_testroot
80         dh_installchangelogs -k ckc211.txt
81         dh_installdocs
82         dh_installdirs
83         dh_installmenu
84         dh_installdebconf
85         dh_installpam --name=kermit
86         dh_installman
87         dh_link
88         dh_strip
89         dh_compress
90         dh_fixperms
91         dh_makeshlibs
92         dh_installdeb
93         dh_shlibdeps
94         dh_gencontrol
95         dh_md5sums
96         dh_builddeb
97
98 binary: binary-indep binary-arch
99 .PHONY: build clean binary-indep binary-arch binary install configure