Fix installation for silc-client and silc-toolkit packages
[silc.git] / debian-silc-server / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3
4 # Uncomment this to turn on verbose mode.
5 #export DH_VERBOSE=1
6
7 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
8 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
9
10 CFLAGS = -Wall -g
11
12 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
13         CFLAGS += -O0
14 else
15         CFLAGS += -O2
16 endif
17
18 config.status: configure
19         dh_testdir
20         rm -f config.sub config.guess
21         ln -sf /usr/share/misc/config.sub config.sub
22         ln -sf /usr/share/misc/config.guess config.guess
23         ./configure \
24                 --host=$(DEB_HOST_GNU_TYPE) \
25                 --build=$(DEB_BUILD_GNU_TYPE) \
26                 --prefix=/usr \
27                 --mandir=\$${prefix}/share/man \
28                 --infodir=\$${prefix}/share/info \
29                 --docdir=\$${prefix}/share/doc/silcd \
30                 --sysconfdir=/etc/silcd \
31                 --with-silcd-config-file=/etc/silcd/silcd.conf \
32                 --localstatedir=/var/run \
33                 --with-logsdir=/var/log/silcd \
34                 CFLAGS="$(CFLAGS)" \
35                 LDFLAGS="-Wl,-z,defs"
36
37 build: build-stamp
38
39 build-stamp:  config.status
40         dh_testdir
41         # the following are crude hacks to get around the autotools problem on
42         # build because these directories are missing, notified upstream
43         mkdir -p $(CURDIR)/lib/silcutil/win32
44         mkdir -p $(CURDIR)/lib/silcutil/symbian
45         $(MAKE)
46         touch $@
47
48 clean:
49         dh_testdir
50         dh_testroot
51         debconf-updatepo
52         rm -f build-stamp 
53         [ ! -f Makefile ] || $(MAKE) distclean
54         rm -f config.sub config.guess
55         dh_clean 
56
57 install: build
58         dh_testdir
59         dh_testroot
60         dh_clean -k 
61         dh_installdirs
62         $(MAKE) DESTDIR=$(CURDIR)/debian/silcd install
63         rm -f $(CURDIR)/debian/silcd/usr/share/doc/silcd/COPYING
64         rm -f $(CURDIR)/debian/silcd/usr/share/doc/silcd/INSTALL
65         rm -f $(CURDIR)/debian/silcd/etc/silcd/silcd.conf
66
67 # Build architecture-independent files here.
68 binary-indep: build install
69         # We have nothing to do.
70
71 # Build architecture-dependent files here.
72 binary-arch: build install
73         dh_testdir
74         dh_testroot
75         dh_installchangelogs ChangeLog
76         dh_installdocs
77         dh_installexamples
78         dh_installdebconf       
79         dh_installlogrotate
80         dh_installinit
81         dh_link
82         dh_strip --dbg-package=silcd-dbg
83         dh_compress
84         dh_fixperms
85         dh_installdeb
86         dh_shlibdeps
87         dh_gencontrol
88         dh_md5sums
89         dh_builddeb
90
91 binary: binary-indep binary-arch
92 .PHONY: build clean binary-indep binary-arch binary install