comparison debian/rules @ 118:5312ca05ed48 private-rez

propagate of 717950f4061f1123659ee87c7c168805af920ab7 and 839f98f136788cc1466e4641bf796f96040a085d from branch 'matt.dbclient.authpam' to 'matt.dbclient.rez'
author Matt Johnston <matt@ucc.asn.au>
date Sun, 12 Sep 2004 04:56:50 +0000
parents 95f4bc4bcd58
children 743fce568f49 3ee0c2f85e1e
comparison
equal deleted inserted replaced
57:3b2a5a1c4347 118:5312ca05ed48
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 dbclient "$(DIR)"/usr/bin/dbclient
59 install -m0755 dropbearkey "$(DIR)"/usr/bin/dropbearkey
60 install -d -m0755 "$(DIR)"/usr/lib/dropbear
61 install -m0755 dropbearconvert \
62 "$(DIR)"/usr/lib/dropbear/dropbearconvert
63 $(STRIP) -R .comment -R .note "$(DIR)"/usr/sbin/* \
64 "$(DIR)"/usr/bin/* "$(DIR)"/usr/lib/dropbear/*
65 # init and run scripts
66 install -d -m0755 "$(DIR)"/etc/init.d
67 install -m0755 debian/dropbear.init "$(DIR)"/etc/init.d/dropbear
68 install -m0755 debian/service/run "$(DIR)"/etc/dropbear/run
69 install -d -m0755 "$(DIR)"/etc/dropbear/log
70 install -m0755 debian/service/log "$(DIR)"/etc/dropbear/log/run
71 ln -s /var/log/dropbear "$(DIR)"/etc/dropbear/log/main
72 ln -s /var/run/dropbear "$(DIR)"/etc/dropbear/supervise
73 ln -s /var/run/dropbear.log "$(DIR)"/etc/dropbear/log/supervise
74 # man pages
75 install -d -m0755 "$(DIR)"/usr/share/man/man8
76 for i in dropbear.8 dropbearkey.8; do \
77 install -m644 $$i "$(DIR)"/usr/share/man/man8/ || exit 1; \
78 done
79 gzip -9 "$(DIR)"/usr/share/man/man8/*.8
80 # copyright, changelog
81 cat debian/copyright.in LICENSE >debian/copyright
82 ln -s CHANGES changelog
83
84 binary-indep:
85
86 binary-arch: install dropbear.deb
87 test "$(CC)" != 'gcc' || \
88 dpkg-shlibdeps "$(DIR)"/usr/sbin/* "$(DIR)"/usr/bin/* \
89 "$(DIR)"/usr/lib/dropbear/*
90 dpkg-gencontrol -isp -pdropbear -P"$(DIR)"
91 dpkg -b "$(DIR)" ..
92
93 binary: binary-arch binary-indep
94
95 .PHONY: patch build clean install binary-indep binary-arch binary
96
97 include debian/implicit