3 ARCH ?
=$(shell dpkg-architecture
-qDEB_HOST_ARCH
)
4 BUILD_DOCS
=$(shell if type asciidoc
>/dev
/null
2>&1; then echo
1; fi
)
10 OPTS
=NO_OPENSSL
=1 prefix=/usr gitexecdir
=/usr
/lib
/git-core \
11 mandir=/usr
/share
/man INSTALLDIRS
=vendor \
13 THREADED_DELTA_SEARCH
=1 NO_CROSS_DIRECTORY_HARDLINKS
=1 \
14 DEFAULT_PAGER
=pager DEFAULT_EDITOR
=editor
15 DOC_OPTS
=prefix=/usr ASCIIDOC8
=1 ASCIIDOC_NO_ROFF
=1
17 ifneq (,$(findstring nostrip
,$(DEB_BUILD_OPTIONS
)))
20 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
30 ifneq (,$(findstring nocheck
,$(DEB_BUILD_OPTIONS
)))
35 GIT
=$(shell pwd
)/debian
/git
37 patch
: deb-checkdir patch-stamp
39 for i in
`ls -1 debian/diff/*.diff debian/diff/*.patch \
40 2>/dev/null || :`; do \
41 patch
-p1
-N
-r-
<$$i ||
test $$?
= 1 || exit
1; \
45 build
: deb-checkdir build-arch-stamp build-indep-stamp
46 build-arch-stamp
: patch-stamp
48 DESTDIR
='$(GIT)' $(MAKE
) all \
49 CC
='$(CC)' CFLAGS
='$(CFLAGS)' $(OPTS
)
50 test -z
'$(TEST)' || \
51 DESTDIR
='$(GIT)' $(MAKE
) $(TEST
) \
52 CC
='$(CC)' CFLAGS
='$(CFLAGS)' $(OPTS
) || \
53 GIT_TEST_OPTS
=--verbose DESTDIR
='$(GIT)' \
54 $(MAKE
) $(TEST
) CC
='$(CC)' CFLAGS
='$(CFLAGS)' $(OPTS
)
55 touch build-arch-stamp
56 build-indep-stamp
: patch-stamp build-arch-stamp
57 : 'Work around bug #478524'
58 set
-e
; if
test '$(BUILD_DOCS)' = 1; \
60 $(MAKE
) -CDocumentation man html
$(DOC_OPTS
); \
62 touch build-indep-stamp
66 ! test -e patch-stamp || \
67 for i in
`ls -1r debian/diff/*.diff debian/diff/*.patch \
68 2>/dev/null || :`; do \
69 patch
-p1
-NR
-r-
<$$i ||
test $$?
= 1 || exit
1; \
72 rm -f patch-stamp build-arch-stamp build-indep-stamp
73 rm -rf
'$(GIT)' '$(GIT)'-doc
'$(GIT)'-arch
'$(GIT)'-cvs
74 rm -rf
'$(GIT)'-svn
'$(GIT)'-email
'$(GIT)'-daemon-run
'$(GIT)'-gui
75 rm -rf
'$(GIT)'k
'$(GIT)'web
'$(GIT)'-all '$(GIT)'-man
'$(GIT)'-core
77 rm -f debian
/files debian
/substvars changelog
79 install: install-arch install-indep
80 install-arch
: deb-checkdir deb-checkuid build-arch-stamp
83 install -d
-m0755
'$(GIT)'/usr
/bin
84 DESTDIR
='$(GIT)' $(MAKE
) install \
85 CC
='$(CC)' CFLAGS
='$(CFLAGS)' $(OPTS
)
86 install -d
-m0755
'$(GIT)'/var
/cache
/git
87 rm -f
'$(GIT)'/usr
/share
/perl5
/Error.pm
88 rm -rf
'$(GIT)'/usr
/share
/man
89 chmod
644 '$(GIT)'/usr
/share
/perl5
/Git.pm
90 # don't include arch, cvs, svn, email, gui tools, and gitk program
91 for i in git-archimport git-cvs git-svn git-send-email \
92 git-gui git-citool
; do \
93 rm -f
'$(GIT)'/usr
/lib
/git-core
/$$i*; \
95 rm -f
'$(GIT)'/usr
/bin
/git-cvsserver
96 rm -f
'$(GIT)'/usr
/bin
/gitk
97 for i in
'$(GIT)'/usr
/bin
/* '$(GIT)'/usr
/lib
/git-core
/*; do \
98 test "`head -c2 $$i`" = '#!' || \
99 test "`head -c2 $$i`" = '# ' || \
100 $(STRIP
) -R .comment
-R .note
$$i; \
102 # don't include git-gui's lib
103 rm -rf
'$(GIT)'/usr
/share
/git-gui
/
104 # don't include gitk's lib
105 rm -rf
'$(GIT)'/usr
/share
/gitk
/
107 install -d
-m0755
'$(GIT)'/etc
/bash_completion.d
108 install -m0644 contrib
/completion
/git-completion.bash \
109 '$(GIT)'/etc
/bash_completion.d
/git
111 install -d
-m0755
'$(GIT)'/usr
/share
/gitweb
112 ln
-s gitweb.cgi
'$(GIT)'/usr
/share
/gitweb
/index.cgi
114 install -d
-m0755
'$(GIT)'/usr
/share
/doc
/git
115 cp
-R contrib
'$(GIT)'/usr
/share
/doc
/git
/
116 rm -rf
'$(GIT)'/usr
/share
/doc
/git
/contrib
/completion
117 rm -rf
'$(GIT)'/usr
/share
/doc
/git
/contrib
/emacs
118 find
'$(GIT)'/usr
/share
/doc
/git
/contrib
-type f | xargs chmod
0644
119 find
'$(GIT)'/usr
/share
/doc
/git
/contrib
-type d | xargs chmod
0755
120 find
'$(GIT)'/usr
/share
/doc
/git
/ -name .gitignore | xargs
rm -f
122 test -r changelog || ln
-s debian
/changelog.upstream changelog
125 : 'Work around bug #478524'
126 set
-e
; if
test '$(BUILD_DOCS)' = 1; \
128 $(MAKE
) -f debian
/rules install-indep-real
; \
130 install-indep-real
: build-arch-stamp build-indep-stamp
132 install -d
-m0755
'$(TMP)'
133 DESTDIR
='$(TMP)' $(MAKE
) install install-doc \
134 CC
='$(CC)' CFLAGS
='$(CFLAGS)' $(OPTS
)
135 $(MAKE
) -CDocumentation install-webdoc WEBDOC_DEST
='$(TMP)'/html \
137 # RelNotes are shipped in git
138 rm -rf
'$(TMP)'/html
/RelNotes
141 install -d
-m0755
'$(GIT)'-man
/usr
/share
/man
/man3
142 DESTDIR
='$(GIT)'-man
$(MAKE
) install-doc \
143 CC
='$(CC)' CFLAGS
='$(CFLAGS)' $(OPTS
)
144 install -m
0644 '$(TMP)'/usr
/share
/man
/man3
/Git
.3pm \
145 '$(GIT)'-man
/usr
/share
/man
/man3
/Git
.3pm
146 rm -f
'$(GIT)'-man
/usr
/share
/man
/man3
/private-Error
.3pm
147 # don't include arch, cvs, svn, email, gui, and gitk man pages
148 for i in git-archimport git-cvs git-svn git-send-email gitk \
149 git-gui git-citool
; do \
150 rm -f
'$(GIT)'-man
/usr
/share
/man
/man1
/$$i*; \
152 chmod
0644 '$(GIT)'-man
/usr
/share
/man
/man?
/*.
[0-9]*
153 gzip
-9 '$(GIT)'-man
/usr
/share
/man
/man?
/*.
[0-9]*
156 install -d
-m0755
'$(GIT)'-doc
/usr
/share
/doc
/git
157 ln
-s ..
/git-doc
'$(GIT)'-doc
/usr
/share
/doc
/git
/html
159 for i in cvs svn
; do \
160 rm -rf
'$(GIT)'-$$i && \
161 install -d
-m0755
'$(GIT)'-$$i/usr
/lib
/git-core
&& \
162 install -m0755
'$(TMP)'/usr
/lib
/git-core
/git-
$$i* \
163 '$(GIT)'-$$i/usr
/lib
/git-core
/ && \
164 install -d
-m0755
'$(GIT)'-$$i/usr
/share
/man
/man1
&& \
165 install -m0644
'$(TMP)'/usr
/share
/man
/man1
/git-
$$i* \
166 '$(GIT)'-$$i/usr
/share
/man
/man1
/ && \
167 gzip
-9 '$(GIT)'-$$i/usr
/share
/man
/man1
/*.1 || exit
1; \
170 install -d
-m0755
'$(GIT)'-cvs
/usr
/bin
171 install -m0755
'$(TMP)'/usr
/bin
/git-cvsserver
'$(GIT)'-cvs
/usr
/bin
/
174 install -d
-m0755
'$(GIT)'-arch
/usr
/lib
/git-core
175 install -m0755
'$(TMP)'/usr
/lib
/git-core
/git-archimport \
176 '$(GIT)'-arch
/usr
/lib
/git-core
/
177 install -d
-m0755
'$(GIT)'-arch
/usr
/share
/man
/man1
178 install -m0644
'$(TMP)'/usr
/share
/man
/man1
/git-archimport
.1 \
179 '$(GIT)'-arch
/usr
/share
/man
/man1
/
180 gzip
-9 '$(GIT)'-arch
/usr
/share
/man
/man1
/*.1
182 rm -rf
'$(GIT)'-email
183 install -d
-m0755
'$(GIT)'-email
/usr
/lib
/git-core
184 install -m0755
'$(TMP)'/usr
/lib
/git-core
/git-send-email \
185 '$(GIT)'-email
/usr
/lib
/git-core
/
186 install -d
-m0755
'$(GIT)'-email
/usr
/share
/man
/man1
187 install -m0644
'$(TMP)'/usr
/share
/man
/man1
/git-send-email
.1 \
188 '$(GIT)'-email
/usr
/share
/man
/man1
/
189 gzip
-9 '$(GIT)'-email
/usr
/share
/man
/man1
/*.1
191 rm -rf
'$(GIT)'-daemon-run
192 install -d
-m0755
'$(GIT)'-daemon-run
/etc
/sv
/git-daemon
/log
193 install -m0755 debian
/git-daemon
/run \
194 '$(GIT)'-daemon-run
/etc
/sv
/git-daemon
/run
195 install -m0755 debian
/git-daemon
/log
/run \
196 '$(GIT)'-daemon-run
/etc
/sv
/git-daemon
/log
/run
199 install -m0644
-D debian
/git-el.emacsen-startup \
200 '$(GIT)'-el
/etc
/emacs
/site-start.d
/50git-core.el
201 install -m0755
-D debian
/git-el.emacsen-install \
202 '$(GIT)'-el
/usr
/lib
/emacsen-common
/packages
/install/git
203 install -m0755
-D debian
/git-el.emacsen-remove \
204 '$(GIT)'-el
/usr
/lib
/emacsen-common
/packages
/remove
/git
205 install -d
-m0755
'$(GIT)'-el
/usr
/share
/git-core
/emacs
206 install -m0644 contrib
/emacs
/git-blame.el \
207 '$(GIT)'-el
/usr
/share
/git-core
/emacs
/git-blame.el
208 install -m0644 contrib
/emacs
/git.el \
209 '$(GIT)'-el
/usr
/share
/git-core
/emacs
/git.el
210 install -d
-m0755
'$(GIT)'-el
/usr
/share
/doc
/git-el
211 ln
-s ..
/git
/README.emacs \
212 '$(GIT)'-el
/usr
/share
/doc
/git-el
/README.Debian
213 install -d
-m0755
'$(GIT)'-el
/usr
/share
/doc
/git
/contrib
214 ln
-s ..
/..
/..
/git-core
/emacs \
215 '$(GIT)'-el
/usr
/share
/doc
/git
/contrib
/emacs
218 install -d
-m0755
'$(GIT)'-gui
/usr
/lib
/git-core
219 install -m0755
'$(TMP)'/usr
/lib
/git-core
/git-gui \
220 '$(GIT)'-gui
/usr
/lib
/git-core
/
221 install -m0755
'$(TMP)'/usr
/lib
/git-core
/git-gui--askpass \
222 '$(GIT)'-gui
/usr
/lib
/git-core
/
223 install -m0755
'$(TMP)'/usr
/lib
/git-core
/git-citool \
224 '$(GIT)'-gui
/usr
/lib
/git-core
/
225 install -d
-m0755
'$(GIT)'-gui
/usr
/share
/man
/man1
226 for i in gui citool
; do \
227 install -m0644
'$(TMP)'/usr
/share
/man
/man1
/git-
$$i* \
228 '$(GIT)'-gui
/usr
/share
/man
/man1
/; \
230 gzip
-9 '$(GIT)'-gui
/usr
/share
/man
/man1
/*.1
231 install -d
-m0755
'$(GIT)'-gui
/usr
/share
/git-gui
232 cp
-a
'$(TMP)'/usr
/share
/git-gui
/lib
'$(GIT)'-gui
/usr
/share
/git-gui
/
235 install -d
-m0755
'$(GIT)'k
/usr
/bin
236 install -m0755
'$(TMP)'/usr
/bin
/gitk \
237 '$(GIT)'k
/usr
/bin
/gitk
238 install -d
-m0755
'$(GIT)'k
/usr
/share
/man
/man1
239 install -m0644
'$(TMP)'/usr
/share
/man
/man1
/gitk
.1 \
240 '$(GIT)'k
/usr
/share
/man
/man1
/
241 gzip
-9 '$(GIT)'k
/usr
/share
/man
/man1
/*.1
242 install -d
-m0755
'$(GIT)'k
/usr
/share
/gitk
243 cp
-a
'$(TMP)'/usr
/share
/gitk
/lib
'$(GIT)'k
/usr
/share
/gitk
/
246 install -d
-m0755
'$(GIT)'web
/usr
/lib
/cgi-bin
247 ln
-s ..
/..
/share
/gitweb
/gitweb.cgi \
248 '$(GIT)'web
/usr
/lib
/cgi-bin
/gitweb.cgi
249 install -d
-m0755
'$(GIT)'web
/etc
250 install -m0644 debian
/gitweb.conf
'$(GIT)'web
/etc
/gitweb.conf
251 install -d
-m0755
'$(GIT)'web
/etc
/apache2
/conf.d
252 install -m0644 debian
/gitweb.apache2.conf \
253 '$(GIT)'web
/etc
/apache2
/conf.d
/gitweb
256 install -d
-m0755
'$(GIT)'-all
259 install -d
-m0755
'$(GIT)'-core
/usr
/share
/doc
260 ln
-s git
'$(GIT)'-core
/usr
/share
/doc
/git-core
262 test -r changelog || ln
-s debian
/changelog.upstream changelog
264 binary
: binary-arch binary-indep
265 binary-arch
: install-arch git.deb
266 rm -f debian
/substvars
267 dpkg-shlibdeps
'$(GIT)'/usr
/bin
/* '$(GIT)'/usr
/lib
/git-core
/*
268 dpkg-gencontrol
-isp
-pgit
-P
'$(GIT)'
270 binary-indep
: install-indep git-doc.deb git-arch.deb git-cvs.deb git-svn.deb \
271 git-daemon-run.deb git-email.deb git-gui.deb gitk.deb gitweb.deb \
272 git-all.deb git-el.deb git-man.deb git-core.deb-DEBIAN
273 rm -f debian
/substvars
274 for i in
-doc
-arch
-cvs
-svn
-daemon-run
-email
-gui k web
-all \
276 dpkg-gencontrol
-isp
-pgit
$$i -P
'$(GIT)'$$i && \
277 dpkg
-b
'$(GIT)'$$i .. || exit
1; \
280 .PHONY
: patch build
clean install install-arch install-indep install-indep-real \
281 binary binary-arch binary-indep
283 include debian
/implicit