4 DEB_HOST_GNU_TYPE ?=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
5 DEB_BUILD_GNU_TYPE ?=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
8 ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
13 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
21 ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS)))
22 CONFFLAGS =--disable-zlib
23 CC =diet -v -Os gcc -nostdinc
26 DIR =$(shell pwd)/debian/dropbear
28 patch: deb-checkdir patch-stamp
30 for i in `ls -1 debian/diff/*.diff || :`; do \
31 patch -p0 <$$i || exit 1; \
35 config.status: patch-stamp configure
37 CFLAGS='$(CFLAGS)'' -DSFTPSERVER_PATH="\"/usr/lib/sftp-server\""' \
38 ./configure --host='$(DEB_HOST_GNU_TYPE)' \
39 --build='$(DEB_BUILD_GNU_TYPE)' --prefix=/usr \
40 --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info \
43 build: deb-checkdir build-stamp
44 build-stamp: config.status
45 $(MAKE) CC='$(CC)' LD='$(CC)'
48 clean: deb-checkdir deb-checkuid
50 test ! -e patch-stamp || \
51 for i in `ls -1r debian/diff/*.diff || :`; do \
54 rm -f patch-stamp build-stamp config.log config.status
56 rm -f debian/files debian/substvars debian/copyright changelog
58 install: deb-checkdir deb-checkuid build-stamp
60 install -d -m0755 '$(DIR)'/etc/dropbear
62 install -d -m0755 '$(DIR)'/usr/sbin
63 install -m0755 dropbear '$(DIR)'/usr/sbin/dropbear
64 install -d -m0755 '$(DIR)'/usr/bin
65 install -m0755 dbclient '$(DIR)'/usr/bin/dbclient
66 install -m0755 dropbearkey '$(DIR)'/usr/bin/dropbearkey
67 install -d -m0755 '$(DIR)'/usr/lib/dropbear
68 install -m0755 dropbearconvert \
69 '$(DIR)'/usr/lib/dropbear/dropbearconvert
70 $(STRIP) -R .comment -R .note '$(DIR)'/usr/sbin/* \
71 '$(DIR)'/usr/bin/* '$(DIR)'/usr/lib/dropbear/*
72 # init and run scripts
73 install -d -m0755 '$(DIR)'/etc/init.d
74 install -m0755 debian/dropbear.init '$(DIR)'/etc/init.d/dropbear
75 install -m0755 debian/service/run '$(DIR)'/etc/dropbear/run
76 install -d -m0755 '$(DIR)'/etc/dropbear/log
77 install -m0755 debian/service/log '$(DIR)'/etc/dropbear/log/run
78 ln -s /var/log/dropbear '$(DIR)'/etc/dropbear/log/main
79 ln -s /var/run/dropbear '$(DIR)'/etc/dropbear/supervise
80 ln -s /var/run/dropbear.log '$(DIR)'/etc/dropbear/log/supervise
82 install -d -m0755 '$(DIR)'/usr/share/man/man8
83 for i in dropbear.8 dropbearkey.8; do \
84 install -m644 $$i '$(DIR)'/usr/share/man/man8/ || exit 1; \
86 gzip -9 '$(DIR)'/usr/share/man/man8/*.8
87 install -d -m0755 '$(DIR)'/usr/share/man/man1
88 install -m644 dbclient.1 '$(DIR)'/usr/share/man/man1/
89 gzip -9 '$(DIR)'/usr/share/man/man1/*.1
90 # copyright, changelog
91 cat debian/copyright.in LICENSE >debian/copyright
92 test -r changelog || ln -s CHANGES changelog
96 binary-arch: install dropbear.deb
97 test '$(CC)' != 'gcc' || \
98 dpkg-shlibdeps '$(DIR)'/usr/sbin/* '$(DIR)'/usr/bin/* \
99 '$(DIR)'/usr/lib/dropbear/*
100 dpkg-gencontrol -isp -pdropbear -P'$(DIR)'
103 binary: binary-arch binary-indep
105 .PHONY: patch build clean install binary-indep binary-arch binary
107 include debian/implicit