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