debian: New upstream release v2.9.3
[git/debian.git] / debian / rules
blob61c735b2dbeef8610c6265d5558ec064bc015fcf
1 #!/usr/bin/make -f
3 ARCH ?=$(shell dpkg-architecture -qDEB_HOST_ARCH)
5 CC =gcc
6 CPPFLAGS :=$(shell dpkg-buildflags --get CPPFLAGS)
7 CFLAGS :=-Wall $(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
8 LDFLAGS :=$(shell dpkg-buildflags --get LDFLAGS)
9 STRIP =strip
10 TEST =test
11 OPTS =NO_OPENSSL=1 prefix=/usr gitexecdir=/usr/lib/git-core \
12 libexecdir=/usr/lib/git-core \
13 mandir=/usr/share/man htmldir=/usr/share/doc/git/html \
14 INSTALLDIRS=vendor \
15 USE_SRV_RR=1 \
16 USE_LIBPCRE=1 \
17 SANE_TOOL_PATH= INSTALL=install TAR=tar \
18 NO_CROSS_DIRECTORY_HARDLINKS=1 NO_INSTALL_HARDLINKS=1 \
19 DEFAULT_PAGER=pager DEFAULT_EDITOR=editor \
20 CC='$(CC)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)'
21 DOC_OPTS =prefix=/usr htmldir=/usr/share/doc/git/html \
22 ASCIIDOC8=1 ASCIIDOC_NO_ROFF=1
24 ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
25 STRIP =: strip
26 endif
27 ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
28 TEST =
29 endif
30 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
31 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
32 MAKEFLAGS += -j$(NUMJOBS)
33 endif
35 PKG_INDEP =
36 PKG_INDEP += git-doc
37 PKG_INDEP += git-arch
38 PKG_INDEP += git-cvs
39 PKG_INDEP += git-svn
40 PKG_INDEP += git-mediawiki
41 PKG_INDEP += git-daemon-run
42 PKG_INDEP += git-daemon-sysvinit
43 PKG_INDEP += git-email
44 PKG_INDEP += git-gui
45 PKG_INDEP += gitk
46 PKG_INDEP += gitweb
47 PKG_INDEP += git-all
48 PKG_INDEP += git-el
49 PKG_INDEP += git-man
51 TMP =$(shell pwd)/tmp
52 GIT =$(shell pwd)/debian/git
54 patch: deb-checkdir patch-stamp
55 patch-stamp:
56 for i in `ls -1 debian/diff/*.diff debian/diff/*.patch \
57 2>/dev/null || :`; do \
58 patch -p1 -N -r- <$$i || test $$? = 1 || exit 1; \
59 done
60 touch patch-stamp
62 build: build-arch build-indep
64 build-arch: deb-checkdir build-arch-stamp
65 build-arch-stamp: patch-stamp
66 -$(CC) -v
67 DESTDIR='$(GIT)' $(MAKE) all $(OPTS)
68 DESTDIR='$(GIT)' $(MAKE) -C contrib/subtree all $(OPTS)
69 ln -s contrib/subtree/git-subtree
70 test -z '$(TEST)' || \
71 DESTDIR='$(GIT)' $(MAKE) $(TEST) $(OPTS) || \
72 GIT_TEST_OPTS=--verbose DESTDIR='$(GIT)' $(MAKE) $(TEST) $(OPTS)
73 test -z '$(TEST)' || \
74 DESTDIR='$(GIT)' $(MAKE) -C contrib/subtree $(TEST) $(OPTS) || \
75 GIT_TEST_OPTS=--verbose DESTDIR='$(GIT)' $(MAKE) -C contrib/subtree $(TEST) $(OPTS)
76 touch build-arch-stamp
78 build-indep: deb-checkdir build-indep-stamp
79 build-indep-stamp: patch-stamp build-arch-stamp
80 # git-man, git-doc
81 $(MAKE) -CDocumentation man html $(DOC_OPTS)
82 # git-mediawiki
83 $(MAKE) -Ccontrib/mw-to-git all $(OPTS)
84 touch build-indep-stamp
86 clean: deb-checkdir
87 $(MAKE) clean $(OPTS)
88 ! test -e patch-stamp || \
89 { \
90 set -e; \
91 $(MAKE) -Ccontrib/mw-to-git clean $(OPTS); \
92 for i in `ls -1r debian/diff/*.diff debian/diff/*.patch \
93 2>/dev/null || :`; do \
94 patch -p1 -NR -r- <$$i || test $$? = 1 || exit 1; \
95 done; \
97 rm -rf '$(TMP)'
98 rm -f patch-stamp build-arch-stamp build-indep-stamp
99 set -e; \
100 for i in '' $(patsubst git%,%,$(PKG_INDEP)) -core; do \
101 rm -rf '$(GIT)'$$i; \
102 done
103 rm -f debian/files debian/substvars
104 rm -f git-subtree
106 install: install-arch install-indep
107 git.install: install-arch
108 install-arch: deb-checkdir deb-checkuid build-arch-stamp
109 # git
110 rm -rf '$(GIT)'
111 install -d -m0755 '$(GIT)'/usr/bin
112 DESTDIR='$(GIT)' $(MAKE) install $(OPTS)
113 DESTDIR='$(GIT)' $(MAKE) -C contrib/subtree install $(OPTS)
114 install -d -m0755 '$(GIT)'/var/lib/git
115 rm -f '$(GIT)'/usr/share/perl5/Error.pm
116 rm -rf '$(GIT)'/usr/share/man
117 chmod 644 '$(GIT)'/usr/share/perl5/Git.pm
118 find '$(GIT)'/usr/share/perl5/Git -type d | xargs chmod 0755
119 find '$(GIT)'/usr/share/perl5/Git -type f | xargs chmod 0644
120 # don't include arch, cvs, p4, svn, email, gui tools, and gitk program
121 for i in git-archimport git-cvs git-p4 git-svn git-send-email \
122 git-gui git-citool; do \
123 rm -f '$(GIT)'/usr/lib/git-core/$$i*; \
124 done
125 rm -f '$(GIT)'/usr/bin/git-cvsserver
126 rm -f '$(GIT)'/usr/bin/gitk
127 for i in '$(GIT)'/usr/bin/* '$(GIT)'/usr/lib/git-core/*; do \
128 test -d $$i || \
129 test "`head -c2 $$i`" = '#!' || \
130 test "`head -c2 $$i`" = '# ' || \
131 $(STRIP) -R .comment -R .note $$i; \
132 done
133 # don't include git-gui's lib
134 rm -rf '$(GIT)'/usr/share/git-gui/
135 # don't include gitk's lib
136 rm -rf '$(GIT)'/usr/share/gitk/
137 # don't include git-svn's lib
138 rm -rf '$(GIT)'/usr/share/perl5/Git/SVN*
139 # bash completion
140 install -d -m0755 '$(GIT)'/usr/share/bash-completion/completions
141 install -m0644 contrib/completion/git-completion.bash \
142 '$(GIT)'/usr/share/bash-completion/completions/git
143 ln -s git '$(GIT)'/usr/share/bash-completion/completions/gitk
144 # bash prompt
145 install -m0644 contrib/completion/git-prompt.sh \
146 '$(GIT)'/usr/lib/git-core/git-sh-prompt
147 install -d -m0755 '$(GIT)'/etc/bash_completion.d
148 install -m0644 debian/git-prompt.completion \
149 '$(GIT)'/etc/bash_completion.d/git-prompt
150 # sanity check that #642603 fix is still in place
151 test $$(stat -c%h \
152 '$(GIT)'/usr/lib/git-core/git-branch) -le 10
153 # gitweb
154 install -d -m0755 '$(GIT)'/usr/share/gitweb
155 ln -s gitweb.cgi '$(GIT)'/usr/share/gitweb/index.cgi
156 # contrib hooks
157 install -d -m0755 '$(GIT)'/usr/share/git-core/contrib/hooks
158 set -e; for i in contrib/hooks/*; do \
159 test "$$i" != contrib/hooks/multimail || continue; \
160 install -m0755 "$$i" \
161 '$(GIT)'/usr/share/git-core/contrib/hooks/; \
162 done
163 # contrib
164 install -d -m0755 '$(GIT)'/usr/share/doc/git
165 cp -R contrib '$(GIT)'/usr/share/doc/git/
166 rm -rf '$(GIT)'/usr/share/doc/git/contrib/completion
167 rm -rf '$(GIT)'/usr/share/doc/git/contrib/emacs
168 rm -rf '$(GIT)'/usr/share/doc/git/contrib/mw-to-git
169 find '$(GIT)'/usr/share/doc/git/contrib -type f | xargs chmod 0644
170 find '$(GIT)'/usr/share/doc/git/contrib -type d | xargs chmod 0755
171 # remove contrib hooks, they are now installed in
172 # /usr/share/git-core/contrib, keep symlink for backward compatibility
173 rm -rf '$(GIT)'/usr/share/doc/git/contrib/hooks
174 ln -s ../../../git-core/contrib/hooks \
175 '$(GIT)'/usr/share/doc/git/contrib/
176 find '$(GIT)'/usr/share/doc/git/ -name .gitignore | xargs rm -f
178 $(patsubst %,%.install,$(PKG_INDEP)) git-core.install: install-indep
179 install-indep: build-arch-stamp build-indep-stamp
180 rm -rf '$(TMP)'
181 install -d -m0755 '$(TMP)'
182 DESTDIR='$(TMP)' $(MAKE) install install-doc $(OPTS)
183 install -d -m0755 '$(TMP)/usr/share/perl5/Git'
184 DESTDIR='$(TMP)' $(MAKE) -Ccontrib/mw-to-git install $(OPTS) \
185 INSTLIBDIR=/usr/share/perl5
186 $(MAKE) -CDocumentation install-webdoc WEBDOC_DEST='$(TMP)'/html \
187 2>/dev/null
188 DESTDIR='$(TMP)' $(MAKE) -Ccontrib/subtree install-doc $(OPTS)
189 install -m 0644 contrib/subtree/git-subtree.txt '$(TMP)'/html
190 # RelNotes are shipped in git
191 rm -rf '$(TMP)'/html/RelNotes
192 # git-man
193 rm -rf '$(GIT)'-man
194 install -d -m0755 '$(GIT)'-man/usr/share/man/man3
195 DESTDIR='$(GIT)'-man $(MAKE) install-doc $(OPTS)
196 DESTDIR='$(GIT)'-man $(MAKE) -Ccontrib/subtree install-man $(OPTS)
197 install -m 0644 '$(TMP)'/usr/share/man/man3/Git* \
198 '$(GIT)'-man/usr/share/man/man3/
199 # don't include arch, cvs, p4, svn, email, gui, and gitk man pages
200 for i in git-archimport git-cvs git-p4 git-svn git-send-email gitk \
201 git-gui git-citool; do \
202 rm -f '$(GIT)'-man/usr/share/man/man1/$$i*; \
203 done
204 rm -f '$(GIT)'-man/usr/share/man/man3/Git::SVN*.3pm
205 chmod 0644 '$(GIT)'-man/usr/share/man/man?/*.[0-9]*
206 gzip -9 '$(GIT)'-man/usr/share/man/man?/*.[0-9]*
207 # git-doc
208 rm -rf '$(GIT)'-doc
209 # don't include git-p4 man page
210 rm -f '$(TMP)'/html/git-p4.*
211 install -d -m0755 '$(GIT)'-doc/usr/share/doc/git
212 ln -s ../git-doc '$(GIT)'-doc/usr/share/doc/git/html
213 # git-cvs, git-svn
214 for i in cvs svn; do \
215 rm -rf '$(GIT)'-$$i && \
216 install -d -m0755 '$(GIT)'-$$i/usr/lib/git-core && \
217 install -m0755 '$(TMP)'/usr/lib/git-core/git-$$i* \
218 '$(GIT)'-$$i/usr/lib/git-core/ && \
219 install -d -m0755 '$(GIT)'-$$i/usr/share/man/man1 && \
220 install -m0644 '$(TMP)'/usr/share/man/man1/git-$$i* \
221 '$(GIT)'-$$i/usr/share/man/man1/ && \
222 gzip -9 '$(GIT)'-$$i/usr/share/man/man1/*.1 || exit 1; \
223 done
224 install -d -m0755 '$(GIT)'-svn/usr/share/perl5/Git
225 cp -R '$(TMP)'/usr/share/perl5/Git/SVN* \
226 '$(GIT)'-svn/usr/share/perl5/Git/
227 find '$(GIT)'-svn/usr/share/perl5/Git -type d | xargs chmod 0755
228 find '$(GIT)'-svn/usr/share/perl5/Git -type f | xargs chmod 0644
229 install -d -m0755 '$(GIT)'-svn/usr/share/man/man3
230 install -m 0644 '$(TMP)'/usr/share/man/man3/Git::SVN*.3pm \
231 '$(GIT)'-svn/usr/share/man/man3/
232 gzip -9 '$(GIT)'-svn/usr/share/man/man3/*.3pm
233 # git-cvs
234 install -d -m0755 '$(GIT)'-cvs/usr/bin
235 install -m0755 '$(TMP)'/usr/bin/git-cvsserver '$(GIT)'-cvs/usr/bin/
236 # git-arch
237 rm -rf '$(GIT)'-arch
238 install -d -m0755 '$(GIT)'-arch/usr/lib/git-core
239 install -m0755 '$(TMP)'/usr/lib/git-core/git-archimport \
240 '$(GIT)'-arch/usr/lib/git-core/
241 install -d -m0755 '$(GIT)'-arch/usr/share/man/man1
242 install -m0644 '$(TMP)'/usr/share/man/man1/git-archimport.1 \
243 '$(GIT)'-arch/usr/share/man/man1/
244 gzip -9 '$(GIT)'-arch/usr/share/man/man1/*.1
245 # git-mediawiki
246 rm -rf '$(GIT)'-mediawiki
247 install -d -m0755 '$(GIT)'-mediawiki/usr/share/perl5/Git
248 install -m0644 '$(TMP)'/usr/share/perl5/Git/Mediawiki.pm \
249 '$(GIT)'-mediawiki/usr/share/perl5/Git/
250 install -d -m0755 '$(GIT)'-mediawiki/usr/lib/git-core
251 install -m0755 '$(TMP)'/usr/lib/git-core/git-mw \
252 '$(GIT)'-mediawiki/usr/lib/git-core/
253 install -m0755 '$(TMP)'/usr/lib/git-core/git-remote-mediawiki \
254 '$(GIT)'-mediawiki/usr/lib/git-core/
255 # git-email
256 rm -rf '$(GIT)'-email
257 install -d -m0755 '$(GIT)'-email/usr/lib/git-core
258 install -m0755 '$(TMP)'/usr/lib/git-core/git-send-email \
259 '$(GIT)'-email/usr/lib/git-core/
260 install -d -m0755 '$(GIT)'-email/usr/share/man/man1
261 install -m0644 '$(TMP)'/usr/share/man/man1/git-send-email.1 \
262 '$(GIT)'-email/usr/share/man/man1/
263 gzip -9 '$(GIT)'-email/usr/share/man/man1/*.1
264 # git-daemon-run
265 rm -rf '$(GIT)'-daemon-run
266 install -d -m0755 '$(GIT)'-daemon-run/etc/sv/git-daemon/log
267 install -m0755 debian/git-daemon/run \
268 '$(GIT)'-daemon-run/etc/sv/git-daemon/run
269 install -m0755 debian/git-daemon/log/run \
270 '$(GIT)'-daemon-run/etc/sv/git-daemon/log/run
271 # git-daemon-sysvinit
272 rm -rf '$(GIT)'-daemon-sysvinit
273 install -d -m0755 '$(GIT)'-daemon-sysvinit/etc/init.d
274 install -m0755 debian/git-daemon.init \
275 '$(GIT)'-daemon-sysvinit/etc/init.d/git-daemon
276 install -d -m0755 '$(GIT)'-daemon-sysvinit/etc/default
277 install -m0644 debian/git-daemon.default \
278 '$(GIT)'-daemon-sysvinit/etc/default/git-daemon
279 install -d -m0755 '$(GIT)'-daemon-sysvinit/usr/share/git-core/sysvinit
280 >'$(GIT)'-daemon-sysvinit/usr/share/git-core/sysvinit/sentinel
281 chmod 0644 \
282 '$(GIT)'-daemon-sysvinit/usr/share/git-core/sysvinit/sentinel
283 # git-el
284 rm -rf '$(GIT)'-el
285 install -m0644 -D debian/git-el.emacsen-startup \
286 '$(GIT)'-el/etc/emacs/site-start.d/50git-core.el
287 install -m0755 -D debian/git-el.emacsen-install \
288 '$(GIT)'-el/usr/lib/emacsen-common/packages/install/git
289 install -m0755 -D debian/git-el.emacsen-remove \
290 '$(GIT)'-el/usr/lib/emacsen-common/packages/remove/git
291 install -d -m0755 '$(GIT)'-el/usr/share/git-core/emacs
292 install -m0644 contrib/emacs/git-blame.el \
293 '$(GIT)'-el/usr/share/git-core/emacs/git-blame.el
294 install -m0644 contrib/emacs/git.el \
295 '$(GIT)'-el/usr/share/git-core/emacs/git.el
296 install -d -m0755 '$(GIT)'-el/usr/share/doc/git-el
297 ln -s ../git/README.emacs \
298 '$(GIT)'-el/usr/share/doc/git-el/README.Debian
299 install -d -m0755 '$(GIT)'-el/usr/share/doc/git/contrib
300 ln -s ../../../git-core/emacs \
301 '$(GIT)'-el/usr/share/doc/git/contrib/emacs
302 # git-gui
303 rm -rf '$(GIT)'-gui
304 install -d -m0755 '$(GIT)'-gui/usr/lib/git-core
305 install -m0755 '$(TMP)'/usr/lib/git-core/git-gui \
306 '$(GIT)'-gui/usr/lib/git-core/
307 install -m0755 '$(TMP)'/usr/lib/git-core/git-gui--askpass \
308 '$(GIT)'-gui/usr/lib/git-core/
309 install -m0755 '$(TMP)'/usr/lib/git-core/git-citool \
310 '$(GIT)'-gui/usr/lib/git-core/
311 install -d -m0755 '$(GIT)'-gui/usr/share/man/man1
312 for i in gui citool; do \
313 install -m0644 '$(TMP)'/usr/share/man/man1/git-$$i* \
314 '$(GIT)'-gui/usr/share/man/man1/; \
315 done
316 gzip -9 '$(GIT)'-gui/usr/share/man/man1/*.1
317 install -d -m0755 '$(GIT)'-gui/usr/share/git-gui
318 cp -a '$(TMP)'/usr/share/git-gui/lib '$(GIT)'-gui/usr/share/git-gui/
319 # gitk
320 rm -rf '$(GIT)'k
321 install -d -m0755 '$(GIT)'k/usr/bin
322 install -m0755 '$(TMP)'/usr/bin/gitk \
323 '$(GIT)'k/usr/bin/gitk
324 install -d -m0755 '$(GIT)'k/usr/share/man/man1
325 install -m0644 '$(TMP)'/usr/share/man/man1/gitk.1 \
326 '$(GIT)'k/usr/share/man/man1/
327 gzip -9 '$(GIT)'k/usr/share/man/man1/*.1
328 install -d -m0755 '$(GIT)'k/usr/share/gitk
329 cp -a '$(TMP)'/usr/share/gitk/lib '$(GIT)'k/usr/share/gitk/
330 # gitweb
331 rm -rf '$(GIT)'web
332 install -d -m0755 '$(GIT)'web/usr/lib/cgi-bin
333 ln -s ../../share/gitweb/gitweb.cgi \
334 '$(GIT)'web/usr/lib/cgi-bin/gitweb.cgi
335 install -d -m0755 '$(GIT)'web/etc
336 install -m0644 debian/gitweb.conf '$(GIT)'web/etc/gitweb.conf
337 install -d -m0755 '$(GIT)'web/etc/apache2/conf-available
338 install -m0644 debian/gitweb.apache2.conf \
339 '$(GIT)'web/etc/apache2/conf-available/gitweb.conf
340 # git-all
341 rm -rf '$(GIT)'-all
342 install -d -m0755 '$(GIT)'-all
343 # git-core
344 rm -rf '$(GIT)'-core
345 install -d -m0755 '$(GIT)'-core/usr/share/doc
346 ln -s git '$(GIT)'-core/usr/share/doc/git-core
348 git-core.deb-docs:
349 : no doc dir
351 binary: binary-arch binary-indep
352 binary-arch: install-arch git.deb
353 rm -f debian/substvars
354 dpkg-shlibdeps '$(GIT)'/usr/bin/* '$(GIT)'/usr/lib/git-core/*
355 dpkg-gencontrol -isp -pgit -P'$(GIT)'
356 dpkg -b '$(GIT)' ..
357 binary-indep: install-indep $(patsubst %,%.deb,$(PKG_INDEP)) git-core.deb-DEBIAN
358 rm -f debian/substvars
359 for i in $(patsubst git%,%,$(PKG_INDEP)) -core; do \
360 dpkg-gencontrol -isp -pgit$$i -P'$(GIT)'$$i && \
361 dpkg -b '$(GIT)'$$i .. || exit 1; \
362 done
364 .PHONY: patch clean
365 .PHONY: build build-arch build-indep
366 .PHONY: install install-arch install-indep
367 .PHONY: binary binary-arch binary-indep
369 # Git's build system supports parallelism (-j) but does not handle
370 # multiple concurrent "make" invocations.
371 .NOTPARALLEL:
373 include debian/implicit