* debian/rules: add -DTHREADED_DELTA_SEARCH to OPTS (closes: #483534).
[debian-git.git] / debian / rules
blobb62bd6017dc527f7ac9d95b587b63b9818fe0085
1 #!/usr/bin/make -f
3 ARCH ?=$(shell dpkg-architecture -qDEB_HOST_ARCH)
5 CC =gcc
6 CFLAGS =-g -Wall
7 STRIP =strip
8 TEST =test
9 OPTS =NO_OPENSSL=1 prefix=/usr mandir=/usr/share/man INSTALLDIRS=vendor \
10 WITH_P4IMPORT=1 PYTHON_PATH=/usr/bin/python TCLTK_PATH=/usr/bin/wish8.5 \
11 THREADED_DELTA_SEARCH=1
13 ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
14 STRIP =: strip
15 endif
16 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
17 CFLAGS +=-O0
18 else
19 # workaround #427907
20 ifeq (hppa,$(ARCH))
21 CFLAGS +=-O0
22 else
23 CFLAGS +=-O2
24 endif
25 endif
26 ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
27 TEST =
28 endif
30 ifeq (powerpc,$(ARCH))
31 OPTS +=PPC_SHA1=1
32 else
33 ifeq (arm,$(ARCH))
34 OPTS +=ARM_SHA1=1
35 endif
36 endif
38 TMP =$(shell pwd)/tmp
39 GIT =$(shell pwd)/debian/git
41 patch: deb-checkdir patch-stamp
42 patch-stamp:
43 for i in `ls -1 debian/diff/*.diff || :`; do \
44 patch -p1 <$$i || exit 1; \
45 done
46 touch patch-stamp
48 build: deb-checkdir build-arch-stamp build-indep-stamp
49 build-arch-stamp: patch-stamp
50 -gcc -v
51 DESTDIR='$(GIT)'-core $(MAKE) all \
52 CC='$(CC)' CFLAGS='$(CFLAGS)' $(OPTS)
53 test -z '$(TEST)' || \
54 DESTDIR='$(GIT)'-core $(MAKE) $(TEST) \
55 CC='$(CC)' CFLAGS='$(CFLAGS)' $(OPTS) || \
56 GIT_TEST_OPTS=--verbose DESTDIR='$(GIT)'-core $(MAKE) $(TEST) \
57 CC='$(CC)' CFLAGS='$(CFLAGS)' $(OPTS)
58 $(MAKE) -CDocumentation man ASCIIDOC8=YesPlease
59 touch build-arch-stamp
60 build-indep-stamp: build-arch-stamp
61 $(MAKE) -CDocumentation man html ASCIIDOC8=YesPlease
62 touch build-indep-stamp
64 clean: deb-checkdir deb-checkuid
65 $(MAKE) clean $(OPTS)
66 ! test -e patch-stamp || \
67 for i in `ls -1r debian/diff/*.diff || :`; do patch -p1 -R <$$i; done
68 rm -rf '$(TMP)'
69 rm -f patch-stamp build-arch-stamp build-indep-stamp
70 rm -rf '$(GIT)'-core '$(GIT)'-doc '$(GIT)'-arch '$(GIT)'-cvs \
71 '$(GIT)'-svn '$(GIT)'-email '$(GIT)'-daemon-run '$(GIT)'-gui \
72 '$(GIT)'k '$(GIT)'web
73 rm -f debian/files debian/substvars changelog
75 install: install-arch install-indep
76 install-arch: deb-checkdir deb-checkuid build-arch-stamp
77 # git-core
78 rm -rf '$(GIT)-core'
79 install -d -m0755 '$(GIT)'-core/usr/bin
80 DESTDIR='$(GIT)'-core $(MAKE) install install-doc \
81 CC='$(CC)' CFLAGS='$(CFLAGS)' $(OPTS)
82 install -d -m0755 '$(GIT)'-core/var/cache/git
83 rm -f '$(GIT)'-core/usr/share/perl5/Error.pm
84 rm -f '$(GIT)'-core/usr/share/man/man3/private-Error.3pm
85 rm -rf '$(GIT)'-core/usr/lib
86 chmod 644 '$(GIT)'-core/usr/share/perl5/Git.pm
87 # don't include arch, cvs, svn, email, gui tools, and gitk program
88 for i in git-archimport git-cvs git-svn git-send-email gitk \
89 git-gui git-citool; do \
90 rm -f '$(GIT)'-core/usr/bin/$$i*; \
91 done
92 for i in '$(GIT)'-core/usr/bin/*; do \
93 test "`head -c2 $$i`" = '#!' || $(STRIP) -R .comment -R .note $$i; \
94 done
95 # don't include git-gui's lib
96 rm -rf '$(GIT)'-core/usr/share/git-gui/
97 # don't include gitk's lib
98 rm -rf '$(GIT)'-core/usr/share/gitk/
99 # don't include arch, cvs, svn, email, gui, and gitk man pages
100 for i in git-archimport git-cvs git-svn git-send-email gitk \
101 git-gui git-citool; do \
102 rm -f '$(GIT)'-core/usr/share/man/man1/$$i*; \
103 done
104 chmod 0644 '$(GIT)'-core/usr/share/man/man?/*.[0-9]*
105 gzip -9 '$(GIT)'-core/usr/share/man/man?/*.[0-9]*
106 # bash completion
107 install -d -m0755 '$(GIT)'-core/etc/bash_completion.d
108 install -m0644 contrib/completion/git-completion.bash \
109 '$(GIT)'-core/etc/bash_completion.d/git
110 # contrib
111 install -d -m0755 '$(GIT)'-core/usr/share/doc/git-core
112 cp -R contrib '$(GIT)'-core/usr/share/doc/git-core/
113 rm -rf '$(GIT)'-core/usr/share/doc/git-core/contrib/completion
114 find '$(GIT)'-core/usr/share/doc/git-core/contrib -type f | \
115 xargs chmod 0644
116 find '$(GIT)'-core/usr/share/doc/git-core/contrib -type d | \
117 xargs chmod 0755
118 find '$(GIT)'-core/usr/share/doc/git-core/ -name .gitignore | \
119 xargs rm -f
120 # upstream changelog
121 test -r changelog || ln -s debian/changelog.upstream changelog
123 install-indep: build-arch-stamp build-indep-stamp
124 rm -rf '$(TMP)'
125 install -d -m0755 '$(TMP)'
126 DESTDIR='$(TMP)' $(MAKE) install install-doc \
127 CC='$(CC)' CFLAGS='$(CFLAGS)' $(OPTS)
128 $(MAKE) -CDocumentation install-webdoc WEBDOC_DEST='$(TMP)'/html \
129 2>/dev/null
130 # git-doc
131 rm -rf '$(GIT)'-doc
132 install -d -m0755 '$(GIT)'-doc
133 # git-cvs, git-svn
134 for i in cvs svn; do \
135 rm -rf '$(GIT)'-$$i && \
136 install -d -m0755 '$(GIT)'-$$i/usr/bin && \
137 install -m0755 '$(TMP)'/usr/bin/git-$$i* '$(GIT)'-$$i/usr/bin/ && \
138 install -d -m0755 '$(GIT)'-$$i/usr/share/man/man1 && \
139 install -m0644 '$(TMP)'/usr/share/man/man1/git-$$i* \
140 '$(GIT)'-$$i/usr/share/man/man1/ && \
141 gzip -9 '$(GIT)'-$$i/usr/share/man/man1/*.1 || exit 1; \
142 done
143 # git-arch
144 rm -rf '$(GIT)'-arch
145 install -d -m0755 '$(GIT)'-arch/usr/bin
146 install -m0755 '$(TMP)'/usr/bin/git-archimport '$(GIT)'-arch/usr/bin/
147 install -d -m0755 '$(GIT)'-arch/usr/share/man/man1
148 install -m0644 '$(TMP)'/usr/share/man/man1/git-archimport.1 \
149 '$(GIT)'-arch/usr/share/man/man1/
150 gzip -9 '$(GIT)'-arch/usr/share/man/man1/*.1
151 # git-email
152 rm -rf '$(GIT)'-email
153 install -d -m0755 '$(GIT)'-email/usr/bin
154 install -m0755 '$(TMP)'/usr/bin/git-send-email '$(GIT)'-email/usr/bin/
155 install -d -m0755 '$(GIT)'-email/usr/share/man/man1
156 install -m0644 '$(TMP)'/usr/share/man/man1/git-send-email.1 \
157 '$(GIT)'-email/usr/share/man/man1/
158 gzip -9 '$(GIT)'-email/usr/share/man/man1/*.1
159 # git-daemon-run
160 rm -rf '$(GIT)'-daemon-run
161 install -d -m0755 '$(GIT)'-daemon-run/etc/sv/git-daemon/log
162 install -m0755 debian/git-daemon/run \
163 '$(GIT)'-daemon-run/etc/sv/git-daemon/run
164 install -m0755 debian/git-daemon/log/run \
165 '$(GIT)'-daemon-run/etc/sv/git-daemon/log/run
166 install -d -m0755 '$(GIT)'-daemon-run/etc/init.d
167 ln -s /usr/bin/sv '$(GIT)'-daemon-run/etc/init.d/git-daemon
168 # git-gui
169 rm -rf '$(GIT)'-gui
170 install -d -m0755 '$(GIT)'-gui/usr/bin
171 install -m0755 '$(TMP)'/usr/bin/git-gui '$(GIT)'-gui/usr/bin/
172 install -m0755 '$(TMP)'/usr/bin/git-citool '$(GIT)'-gui/usr/bin/
173 install -d -m0755 '$(GIT)'-gui/usr/share/man/man1
174 for i in gui citool; do \
175 install -m0644 '$(TMP)'/usr/share/man/man1/git-$$i* \
176 '$(GIT)'-gui/usr/share/man/man1/; \
177 done
178 gzip -9 '$(GIT)'-gui/usr/share/man/man1/*.1
179 install -d -m0755 '$(GIT)'-gui/usr/share/git-gui
180 cp -a '$(TMP)'/usr/share/git-gui/lib '$(GIT)'-gui/usr/share/git-gui/
181 # gitk
182 rm -rf '$(GIT)'k
183 install -d -m0755 '$(GIT)'k/usr/bin
184 install -m0755 '$(TMP)'/usr/bin/gitk '$(GIT)'k/usr/bin/gitk
185 install -d -m0755 '$(GIT)'k/usr/share/man/man1
186 install -m0644 '$(TMP)'/usr/share/man/man1/gitk.1 \
187 '$(GIT)'k/usr/share/man/man1/
188 gzip -9 '$(GIT)'k/usr/share/man/man1/*.1
189 install -d -m0755 '$(GIT)'k/usr/share/gitk
190 cp -a '$(TMP)'/usr/share/gitk/lib '$(GIT)'k/usr/share/gitk/
191 # gitweb
192 rm -rf '$(GIT)'web
193 install -d -m0755 '$(GIT)'web/usr/lib/cgi-bin
194 install -m0755 gitweb/gitweb.cgi '$(GIT)'web/usr/lib/cgi-bin/gitweb.cgi
195 install -d -m0755 '$(GIT)'web/var/www
196 install -m0644 gitweb/gitweb.css '$(GIT)'web/var/www/gitweb.css
197 install -m0644 gitweb/git-favicon.png \
198 '$(GIT)'web/var/www/git-favicon.png
199 install -m0644 gitweb/git-logo.png '$(GIT)'web/var/www/git-logo.png
200 install -d -m0755 '$(GIT)'web/etc
201 install -m0644 debian/gitweb.conf '$(GIT)'web/etc/gitweb.conf
202 install -d -m0755 '$(GIT)'web/var/cache/git/
203 # upstream changelog
204 test -r changelog || ln -s debian/changelog.upstream changelog
206 binary: binary-arch binary-indep
207 binary-arch: install-arch git-core.deb
208 rm -f debian/substvars
209 dpkg-shlibdeps '$(GIT)'-core/usr/bin/*
210 dpkg-gencontrol -isp -pgit-core -P'$(GIT)'-core
211 dpkg -b '$(GIT)'-core ..
212 binary-indep: install-indep git-doc.deb git-arch.deb git-cvs.deb git-svn.deb \
213 git-daemon-run.deb git-email.deb git-gui.deb gitk.deb gitweb.deb
214 rm -f debian/substvars
215 for i in -doc -arch -cvs -svn -daemon-run -email -gui k web; do \
216 dpkg-gencontrol -isp -pgit$$i -P'$(GIT)'$$i && \
217 dpkg -b '$(GIT)'$$i .. || exit 1; \
218 done
220 .PHONY: patch build clean install install-arch install-indep binary \
221 binary-arch binary-indep
223 include debian/implicit