[project @ import to darcs]
[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@nessie.mcc.ac.uk>
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="-lsocksd"
24
25 #MAKETARGET=linux+krb5+krb4+openssl+shadow+pam
26 MAKETARGET=linux+shadow+pam
27
28 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
29         INSTALL_PROGRAM += -s
30 endif
31
32 configure: configure-stamp
33 configure-stamp:
34         dh_testdir
35         # Add here commands to configure the package.
36
37         touch configure-stamp
38
39
40 build: build-stamp
41
42 build-stamp: configure-stamp 
43         dh_testdir
44
45         # Add here commands to compile the package.
46         $(MAKE) $(MAKEOPTS) $(MAKETARGET)
47
48         touch build-stamp
49
50 clean:
51         dh_testdir
52         dh_testroot
53         rm -f build-stamp configure-stamp
54
55         # Add here commands to clean up after the build process.
56         -$(MAKE) $(MAKEOPTS) clean
57         -rm -f wermit # no longer cleaned by upstream makefile
58         -rm -f UNINSTALL 
59         dh_clean 
60
61 install: build
62         dh_testdir
63         dh_testroot
64         dh_clean -k 
65         dh_installdirs
66
67         # Add here commands to install the package into debian/ckermit.
68         $(MAKE) $(MAKEOPTS) install
69         # move aside full config file (later linked to by dh_link)
70         mv "$(BUILDDIR)/usr/bin/ckermit.ini" "$(BUILDDIR)/etc/kermit/kermrc.full"
71         # install conf files
72         install -m 0644  -g 0 -o 0 debian/kermrc "$(BUILDDIR)/etc/kermit/"
73         install -m 0644  -g 0 -o 0 debian/iksd.conf "$(BUILDDIR)/etc/kermit/"
74         # link is recreated properly by dh_link
75         rm "$(BUILDDIR)/usr/bin/kermit-sshsub"
76         # duplicated in /usr/share/doc/ckermit/copyright
77         rm "$(BUILDDIR)/usr/share/doc/ckermit/COPYING.TXT"
78
79 # Build architecture-independent files here.
80 binary-indep: build install
81 # We have nothing to do by default.
82
83 # Build architecture-dependent files here.
84 binary-arch: build install
85         dh_testdir
86         dh_testroot
87         dh_installchangelogs -k ckc211.txt
88         dh_installdocs
89 #       dh_installexamples
90         dh_installdirs 
91 #       dh_install
92         dh_installmenu
93         dh_installdebconf       
94 #       dh_installlogrotate
95 #       dh_installemacsen
96         dh_installpam --name=kermit
97 #       dh_installmime
98 #       dh_installinit
99 #       dh_installcron
100 #       dh_installinfo
101         dh_installman
102         dh_link
103         dh_strip
104         dh_compress
105         dh_fixperms
106 #       dh_perl
107 #       dh_python
108         dh_makeshlibs
109         dh_installdeb
110         dh_shlibdeps
111         dh_gencontrol
112         dh_md5sums
113         dh_builddeb
114
115 binary: binary-indep binary-arch
116 .PHONY: build clean binary-indep binary-arch binary install configure