comparison debian/rules @ 522:8cc0598b0b9a maemo

- Split into separate debs
author Matt Johnston <matt@ucc.asn.au>
date Tue, 18 Nov 2008 12:53:48 +0000
parents 8c2d2edadf2a
children 4ff1bf0345c9 b0668a7f76d9
comparison
equal deleted inserted replaced
521:cc2dff9bd671 522:8cc0598b0b9a
11 11
12 CFLAGS =-Wall -g 12 CFLAGS =-Wall -g
13 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) 13 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
14 CFLAGS +=-O0 14 CFLAGS +=-O0
15 else 15 else
16 CFLAGS +=-O2 16 CFLAGS +=-Os
17 endif 17 endif
18 18
19 CONFFLAGS = 19 CONFFLAGS =
20 CC =gcc 20 CC =gcc
21 ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS))) 21 ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS)))
22 CONFFLAGS =--disable-zlib 22 CONFFLAGS =--disable-zlib
23 CC =diet -v -Os gcc -nostdinc 23 CC =diet -v -Os gcc -nostdinc
24 endif 24 endif
25
26 DIR =$(shell pwd)/debian/dropbear
27 25
28 patch: deb-checkdir patch-stamp 26 patch: deb-checkdir patch-stamp
29 patch-stamp: 27 patch-stamp:
30 for i in `ls -1 debian/diff/*.diff || :`; do \ 28 for i in `ls -1 debian/diff/*.diff || :`; do \
31 patch -p1 <$$i || exit 1; \ 29 patch -p1 <$$i || exit 1; \
43 build: deb-checkdir build-stamp 41 build: deb-checkdir build-stamp
44 build-stamp: config.status 42 build-stamp: config.status
45 $(MAKE) CC='$(CC)' LD='$(CC)' 43 $(MAKE) CC='$(CC)' LD='$(CC)'
46 touch build-stamp 44 touch build-stamp
47 45
48 clean: deb-checkdir deb-checkuid 46 clean: DIR=$(shell pwd)/debian/dropbear
47 clean: deb-checkdir deb-checkuid
49 test ! -r Makefile || $(MAKE) distclean 48 test ! -r Makefile || $(MAKE) distclean
50 rm -f libtomcrypt/Makefile libtommath/Makefile 49 rm -f libtomcrypt/Makefile libtommath/Makefile
51 test ! -e patch-stamp || \ 50 test ! -e patch-stamp || \
52 for i in `ls -1r debian/diff/*.diff || :`; do \ 51 for i in `ls -1r debian/diff/*.diff || :`; do \
53 patch -p1 -R <$$i; \ 52 patch -p1 -R <$$i; \
54 done 53 done
55 rm -f patch-stamp build-stamp config.log config.status 54 rm -f patch-stamp build-stamp config.log config.status
56 rm -rf '$(DIR)' 55 rm -rf '$(DIR)'
56 rm -rf '$(DIR)'-client
57 rm -rf '$(DIR)'-server
58 rm -rf '$(DIR)'-common
59 rm -rf '$(DIR)'-scp
57 rm -f debian/files debian/substvars debian/copyright changelog 60 rm -f debian/files debian/substvars debian/copyright changelog
58 61
59 install: deb-checkdir deb-checkuid build-stamp 62 install-server: DIR=$(shell pwd)/debian/dropbear-server
60 rm -rf '$(DIR)' 63 install-server: deb-checkdir deb-checkuid config.status
64 rm -f '$(DIR)'
65 $(MAKE) clean
66 $(MAKE) CC='$(CC)' LD='$(LD)' PROGRAMS=dropbear dropbear
61 install -d -m0755 '$(DIR)'/etc/dropbear 67 install -d -m0755 '$(DIR)'/etc/dropbear
62 # programs 68 # programs
63 install -d -m0755 '$(DIR)'/usr/sbin 69 install -d -m0755 '$(DIR)'/usr/sbin
64 install -m0755 dropbear '$(DIR)'/usr/sbin/dropbear 70 install -m0755 dropbear '$(DIR)'/usr/sbin/dropbear
65 install -d -m0755 '$(DIR)'/usr/bin
66 install -m0755 dbclient '$(DIR)'/usr/bin/dbclient
67 install -m0755 dropbearkey '$(DIR)'/usr/bin/dropbearkey
68 install -d -m0755 '$(DIR)'/usr/lib/dropbear
69 install -m0755 dropbearconvert \
70 '$(DIR)'/usr/lib/dropbear/dropbearconvert
71 $(STRIP) -R .comment -R .note '$(DIR)'/usr/sbin/* \
72 '$(DIR)'/usr/bin/* '$(DIR)'/usr/lib/dropbear/*
73 # init and run scripts 71 # init and run scripts
74 install -d -m0755 '$(DIR)'/etc/init.d 72 install -d -m0755 '$(DIR)'/etc/init.d
75 install -m0755 debian/dropbear.init '$(DIR)'/etc/init.d/dropbear 73 install -m0755 debian/dropbear.init '$(DIR)'/etc/init.d/dropbear
76 install -m0755 debian/service/run '$(DIR)'/etc/dropbear/run 74 install -m0755 debian/service/run '$(DIR)'/etc/dropbear/run
77 install -d -m0755 '$(DIR)'/etc/dropbear/log 75 install -d -m0755 '$(DIR)'/etc/dropbear/log
78 install -m0755 debian/service/log '$(DIR)'/etc/dropbear/log/run 76 install -m0755 debian/service/log '$(DIR)'/etc/dropbear/log/run
79 ln -s /var/log/dropbear '$(DIR)'/etc/dropbear/log/main 77 ln -s /var/log/dropbear '$(DIR)'/etc/dropbear/log/main
80 # man pages 78 install -d -m0755 '$(DIR)'/usr/share/man/man8
79 for i in dropbear.8 ; do \
80 install -m644 $$i '$(DIR)'/usr/share/man/man8/ || exit 1; \
81 done
82 gzip -9 '$(DIR)'/usr/share/man/man8/*.8
83 # copyright, changelog
84 cat debian/copyright.in LICENSE > debian/copyright
85 test -r changelog || ln -s CHANGES changelog
86 $(STRIP) -R .comment -R .note '$(DIR)'/usr/sbin/*
87
88 install -d -m0755 '$(DIR)'/DEBIAN
89 test '$(CC)' != 'gcc' || \
90 dpkg-shlibdeps '$(DIR)'/usr/sbin/* \
91 '$(DIR)'/usr/lib/dropbear/*
92 dpkg-gencontrol -isp -pdropbear-server -P'$(DIR)'
93 dpkg -b '$(DIR)' ..
94
95 install-client: DIR=$(shell pwd)/debian/dropbear-client
96 install-client: deb-checkdir deb-checkuid config.status
97 rm -f '$(DIR)'
98 $(MAKE) clean
99 $(MAKE) CC='$(CC)' LD='$(LD)' PROGRAMS=dbclient dbclient
100 install -d -m0755 '$(DIR)'/usr/bin
101 install -m0755 dbclient '$(DIR)'/usr/bin/dbclient
102 install -d -m0755 '$(DIR)'/usr/share/man/man1
103 install -m644 dbclient.1 '$(DIR)'/usr/share/man/man1/
104 gzip -9 '$(DIR)'/usr/share/man/man1/*.1
105 $(STRIP) -R .comment -R .note '$(DIR)'/usr/bin/*
106
107 install -d -m0755 '$(DIR)'/DEBIAN
108 test '$(CC)' != 'gcc' || \
109 dpkg-shlibdeps '$(DIR)'/usr/bin/*
110 dpkg-gencontrol -isp -pdropbear-client -P'$(DIR)'
111 dpkg -b '$(DIR)' ..
112
113 install-common: DIR=$(shell pwd)/debian/dropbear-common
114 install-common: deb-checkdir deb-checkuid config.status
115 rm -f '$(DIR)'
116 $(MAKE) clean
117 $(MAKE) CC='$(CC)' LD='$(LD)' PROGRAMS="dropbearkey dropbearconvert" MULTI=1
118 install -d -m0755 '$(DIR)'/usr/bin
119 install -d -m0755 '$(DIR)'/usr/lib/dropbear
120 install -m0755 dropbearmulti \
121 '$(DIR)'/usr/lib/dropbear/dropbearmulti
122 ln -s ../lib/dropbear/dropbearmulti '$(DIR)'/usr/bin/dropbearkey
123 ln -s dropbearmulti '$(DIR)'/usr/lib/dropbear/dropbearconvert
124 install -d -m0755 '$(DIR)'/usr/share/man/man8
125 for i in dropbearkey.8; do \
126 install -m644 $$i '$(DIR)'/usr/share/man/man8/ || exit 1; \
127 done
128 gzip -9 '$(DIR)'/usr/share/man/man8/*.8
129 $(STRIP) -R .comment -R .note \
130 '$(DIR)'/usr/bin/* '$(DIR)'/usr/lib/dropbear/*
131
132 install -d -m0755 '$(DIR)'/DEBIAN
133 test '$(CC)' != 'gcc' || \
134 dpkg-shlibdeps '$(DIR)'/usr/bin/* '$(DIR)'/usr/lib/dropbear/*
135 dpkg-gencontrol -isp -pdropbear-common -P'$(DIR)'
136 dpkg -b '$(DIR)' ..
137
138 install-scp: DIR=$(shell pwd)/debian/dropbear-scp
139 install-scp: deb-checkdir deb-checkuid config.status
140 rm -f '$(DIR)'
141 $(MAKE) clean
142 $(MAKE) CC='$(CC)' LD='$(LD)' PROGRAMS="scp" scp
143 install -d -m0755 '$(DIR)'/usr/bin
144 install -m0755 scp '$(DIR)'/usr/bin/scp
145 $(STRIP) -R .comment -R .note '$(DIR)'/usr/bin/*
146
147 install -d -m0755 '$(DIR)'/DEBIAN
148 test '$(CC)' != 'gcc' || \
149 dpkg-shlibdeps '$(DIR)'/usr/bin/*
150 dpkg-gencontrol -isp -pdropbear-scp -P'$(DIR)'
151 dpkg -b '$(DIR)' ..
152
153 install-multi: DIR=$(shell pwd)/debian/dropbear
154 install-multi: deb-checkdir deb-checkuid config.status
155 rm -f '$(DIR)'
156 $(MAKE) clean
157 $(MAKE) CC='$(CC)' LD='$(LD)' PROGRAMS="dropbearkey dropbearconvert scp dropbear dbclient" MULTI=1
158 install -d -m0755 '$(DIR)'/etc/dropbear
159 # programs
160 install -d -m0755 '$(DIR)'/usr/bin
161 install -d -m0755 '$(DIR)'/usr/sbin
162 install -d -m0755 '$(DIR)'/usr/lib/dropbear
163 install -m0755 dropbearmulti \
164 '$(DIR)'/usr/lib/dropbear/dropbearmulti
165 ln -s ../lib/dropbear/dropbearmulti '$(DIR)'/usr/bin/dropbearkey
166 ln -s ../lib/dropbear/dropbearmulti '$(DIR)'/usr/bin/dbclient
167 ln -s ../lib/dropbear/dropbearmulti '$(DIR)'/usr/bin/scp
168 ln -s ../lib/dropbear/dropbearmulti '$(DIR)'/usr/sbin/dropbear
169 ln -s dropbearmulti '$(DIR)'/usr/lib/dropbear/dropbearconvert
170 # init and run scripts
171 install -d -m0755 '$(DIR)'/etc/init.d
172 install -m0755 debian/dropbear.init '$(DIR)'/etc/init.d/dropbear
173 install -m0755 debian/service/run '$(DIR)'/etc/dropbear/run
174 install -d -m0755 '$(DIR)'/etc/dropbear/log
175 install -m0755 debian/service/log '$(DIR)'/etc/dropbear/log/run
176 ln -s /var/log/dropbear '$(DIR)'/etc/dropbear/log/main
81 install -d -m0755 '$(DIR)'/usr/share/man/man8 177 install -d -m0755 '$(DIR)'/usr/share/man/man8
82 for i in dropbear.8 dropbearkey.8; do \ 178 for i in dropbear.8 dropbearkey.8; do \
83 install -m644 $$i '$(DIR)'/usr/share/man/man8/ || exit 1; \ 179 install -m644 $$i '$(DIR)'/usr/share/man/man8/ || exit 1; \
84 done 180 done
85 gzip -9 '$(DIR)'/usr/share/man/man8/*.8 181 gzip -9 '$(DIR)'/usr/share/man/man8/*.8
86 install -d -m0755 '$(DIR)'/usr/share/man/man1 182 install -d -m0755 '$(DIR)'/usr/share/man/man1
87 install -m644 dbclient.1 '$(DIR)'/usr/share/man/man1/ 183 install -m644 dbclient.1 '$(DIR)'/usr/share/man/man1/
88 gzip -9 '$(DIR)'/usr/share/man/man1/*.1 184 gzip -9 '$(DIR)'/usr/share/man/man1/*.1
89 # copyright, changelog 185 $(STRIP) -R .comment -R .note '$(DIR)'/usr/sbin/* \
90 cat debian/copyright.in LICENSE >debian/copyright 186 '$(DIR)'/usr/bin/* '$(DIR)'/usr/lib/dropbear/*
91 test -r changelog || ln -s CHANGES changelog 187
92 188 install -d -m0755 '$(DIR)'/DEBIAN
93 binary-indep:
94
95 binary-arch: install dropbear.deb
96 test '$(CC)' != 'gcc' || \ 189 test '$(CC)' != 'gcc' || \
97 dpkg-shlibdeps '$(DIR)'/usr/sbin/* '$(DIR)'/usr/bin/* \ 190 dpkg-shlibdeps '$(DIR)'/usr/sbin/* '$(DIR)'/usr/bin/* \
98 '$(DIR)'/usr/lib/dropbear/* 191 '$(DIR)'/usr/lib/dropbear/*
99 dpkg-gencontrol -isp -pdropbear -P'$(DIR)' 192 dpkg-gencontrol -isp -pdropbear -P'$(DIR)'
100 dpkg -b '$(DIR)' .. 193 dpkg -b '$(DIR)' ..
101 194
195 install: install-client install-server install-common install-multi install-scp
196 binary-indep:
197
198 binary-arch: install dropbear.deb
199
102 binary: binary-arch binary-indep 200 binary: binary-arch binary-indep
103 201
104 .PHONY: patch build clean install binary-indep binary-arch binary 202 .PHONY: patch build clean install binary-indep binary-arch binary
105 203
106 include debian/implicit 204 include debian/implicit