comparison debian/rules @ 70:b0316ce64e4b

Merging in the changes from 0.41-0.43 main Dropbear tree
author Matt Johnston <matt@ucc.asn.au>
date Thu, 12 Aug 2004 16:41:58 +0000
parents fe6bca95afa7
children 95f4bc4bcd58
comparison
equal deleted inserted replaced
69:59d16db56e9f 70:b0316ce64e4b
1 #!/usr/bin/make -f 1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
4 #
5 # Modified to make a template file for a multi-binary package with separated
6 # build-arch and build-indep targets by Bill Allombert 2001
7 2
8 # Uncomment this to turn on verbose mode. 3 #export DH_OPTIONS
9 #export DH_VERBOSE=1 4 DEB_HOST_GNU_TYPE ?=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
5 DEB_BUILD_GNU_TYPE ?=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
10 6
11 # This has to be exported to make some magic below work. 7 STRIP =strip
12 export DH_OPTIONS 8 ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
13 9 STRIP =: nostrip
14 # These are used for cross-compiling and for saving the configure script
15 # from having to guess our platform (since we know it already)
16 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
17 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
18
19
20 CFLAGS = -Wall -g
21
22 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
23 CFLAGS += -O0
24 else
25 CFLAGS += -O2
26 endif
27 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
28 INSTALL_PROGRAM += -s
29 endif 10 endif
30 11
31 config.status: configure 12 CFLAGS =-Wall -g
32 dh_testdir 13 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
33 # Add here commands to configure the package. 14 CFLAGS +=-O0
34 CFLAGS='-DSFTPSERVER_PATH="\"/usr/lib/sftp-server\""' ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info 15 else
35 16 CFLAGS +=-O2
36
37 #Architecture
38 build: build-arch #build-indep
39
40 build-arch: build-arch-stamp
41 build-arch-stamp: config.status
42
43 # Add here commands to compile the arch part of the package.
44 $(MAKE) CC=gcc LD=gcc
45
46 build-indep: build-indep-stamp
47 build-indep-stamp: config.status
48
49 # Add here commands to compile the indep part of the package.
50 #$(MAKE) doc
51
52 clean:
53 dh_testdir
54 dh_testroot
55 rm -f build-arch-stamp build-indep-stamp config-stamp
56
57 # Add here commands to clean up after the build process.
58 -$(MAKE) clean
59 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
60 cp -f /usr/share/misc/config.sub config.sub
61 endif
62 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
63 cp -f /usr/share/misc/config.guess config.guess
64 endif 17 endif
65 18
66 19 CC =gcc
67 dh_clean 20 ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS)))
21 CC =diet -v -Os gcc
22 endif
68 23
69 install: install-indep install-arch 24 DIR=`pwd`/debian/dropbear
70 install-indep:
71 dh_testdir
72 dh_testroot
73 dh_clean -k -i
74 dh_installdirs -i
75
76 # Add here commands to install the indep part of the package into
77 # debian/<package>-doc.
78 #INSTALLDOC#
79
80 dh_install -i
81 25
82 install-arch: 26 patch: deb-checkdir patch-stamp
83 dh_testdir 27 patch-stamp:
84 dh_testroot 28 # no patches for now
85 dh_clean -k -a 29 # for i in debian/diff/*.diff; do patch -p0 <$$i || exit 1; done
86 dh_installdirs -a 30 touch patch-stamp
87 dh_installdirs /etc/dropbear
88 31
89 # Add here commands to install the arch part of the package into 32 config.status: patch-stamp configure
90 # debian/tmp. 33 CFLAGS="$(CFLAGS)"' -DSFTPSERVER_PATH="\"/usr/lib/sftp-server\""' \
91 $(MAKE) install prefix=$(CURDIR)/debian/dropbear/usr 34 ./configure --host="$(DEB_HOST_GNU_TYPE)" \
35 --build="$(DEB_BUILD_GNU_TYPE)" --prefix=/usr \
36 --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
92 37
93 dh_install -a 38 build: deb-checkdir build-stamp
94 # Must not depend on anything. This is to be called by 39 build-stamp: config.status
95 # binary-arch/binary-multi 40 $(MAKE) CC="$(CC)" LD="$(CC)"
96 # in another 'make' thread. 41 touch build-stamp
97 binary-common:
98 cat $(CURDIR)/debian/copyright.in $(CURDIR)/LICENSE > $(CURDIR)/debian/copyright
99 dh_testdir
100 dh_testroot
101 dh_installchangelogs CHANGES
102 dh_installdocs
103 dh_installexamples
104 # dh_installmenu
105 # dh_installdebconf
106 # dh_installlogrotate
107 # dh_installemacsen
108 # dh_installpam
109 # dh_installmime
110 dh_installinit
111 # dh_installcron
112 # dh_installinfo
113 dh_installman
114 dh_link
115 dh_strip
116 dh_compress
117 dh_fixperms
118 # dh_perl
119 # dh_python
120 dh_makeshlibs
121 dh_installdeb
122 dh_gencontrol
123 dh_md5sums
124 dh_builddeb
125 # Build architecture independant packages using the common target.
126 binary-indep: build-indep install-indep
127 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
128 42
129 # Build architecture dependant packages using the common target. 43 clean: deb-checkdir deb-checkuid
130 binary-arch: build-arch install-arch 44 -$(MAKE) distclean
131 $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common 45 # test ! -e patch-stamp || \
46 # for i in debian/diff/*.diff; do patch -p0 -R <$$i; done
47 rm -f patch-stamp build-stamp config.log config.status
48 rm -rf "$(DIR)"
49 rm -f debian/files debian/substvars debian/copyright changelog
132 50
133 binary: binary-arch #binary-indep 51 install: deb-checkdir deb-checkuid build-stamp
134 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch 52 rm -rf "$(DIR)"
53 install -d -m0755 "$(DIR)"/etc/dropbear
54 # programs
55 install -d -m0755 "$(DIR)"/usr/sbin
56 install -m0755 dropbear "$(DIR)"/usr/sbin/dropbear
57 install -d -m0755 "$(DIR)"/usr/bin
58 install -m0755 dropbearkey "$(DIR)"/usr/bin/dropbearkey
59 install -d -m0755 "$(DIR)"/usr/lib/dropbear
60 install -m0755 dropbearconvert \
61 "$(DIR)"/usr/lib/dropbear/dropbearconvert
62 $(STRIP) -R .comment -R .note "$(DIR)"/usr/sbin/* \
63 "$(DIR)"/usr/bin/* "$(DIR)"/usr/lib/dropbear/*
64 # init and run scripts
65 install -d -m0755 "$(DIR)"/etc/init.d
66 install -m0755 debian/dropbear.init "$(DIR)"/etc/init.d/dropbear
67 install -m0755 debian/service/run "$(DIR)"/etc/dropbear/run
68 install -d -m0755 "$(DIR)"/etc/dropbear/log
69 install -m0755 debian/service/log "$(DIR)"/etc/dropbear/log/run
70 ln -s /var/log/dropbear "$(DIR)"/etc/dropbear/log/main
71 ln -s /var/run/dropbear "$(DIR)"/etc/dropbear/supervise
72 ln -s /var/run/dropbear.log "$(DIR)"/etc/dropbear/log/supervise
73 # man pages
74 install -d -m0755 "$(DIR)"/usr/share/man/man8
75 for i in dropbear.8 dropbearkey.8; do \
76 install -m644 $$i "$(DIR)"/usr/share/man/man8/ || exit 1; \
77 done
78 gzip -9 "$(DIR)"/usr/share/man/man8/*.8
79 # copyright, changelog
80 cat debian/copyright.in LICENSE >debian/copyright
81 ln -s CHANGES changelog
82
83 binary-indep:
84
85 binary-arch: install dropbear.deb
86 test "$(CC)" != 'gcc' || \
87 dpkg-shlibdeps "$(DIR)"/usr/sbin/* "$(DIR)"/usr/bin/* \
88 "$(DIR)"/usr/lib/dropbear/*
89 dpkg-gencontrol -isp -pdropbear -P"$(DIR)"
90 dpkg -b "$(DIR)" ..
91
92 binary: binary-arch binary-indep
93
94 .PHONY: patch build clean install binary-indep binary-arch binary
95
96 include debian/implicit