| #!/usr/bin/make -f |
| |
| CC =gcc |
| CPPFLAGS :=$(shell dpkg-buildflags --get CPPFLAGS) |
| CFLAGS :=-Wall $(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS) |
| LDFLAGS :=$(shell dpkg-buildflags --get LDFLAGS) |
| TEST =test |
| OPTS =NO_OPENSSL=1 prefix=/usr gitexecdir=/usr/lib/git-core \ |
| libexecdir=/usr/lib/git-core \ |
| mandir=/usr/share/man htmldir=/usr/share/doc/git/html \ |
| INSTALLDIRS=vendor \ |
| USE_LIBPCRE=1 \ |
| SANE_TOOL_PATH= INSTALL=install TAR=tar \ |
| NO_CROSS_DIRECTORY_HARDLINKS=1 NO_INSTALL_HARDLINKS=1 \ |
| DEFAULT_PAGER=pager DEFAULT_EDITOR=editor \ |
| V=1 \ |
| CC='$(CC)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' |
| DOC_OPTS =prefix=/usr htmldir=/usr/share/doc/git/html \ |
| V=1 \ |
| ASCIIDOC8=1 ASCIIDOC_NO_ROFF=1 |
| |
| # https://wiki.debian.org/ReproducibleBuilds/TimestampsInDocumentationGeneratedByAsciidoc |
| DOC_OPTS += ASCIIDOC='TZ=UTC asciidoc' |
| |
| ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) |
| TEST = |
| endif |
| ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) |
| NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) |
| MAKEFLAGS += -j$(NUMJOBS) |
| # Setting this with a pattern-specific rule prevents -O from |
| # affecting the top-level make, which would break realtime build |
| # output (unless dh is run as +dh, which causes other problems). |
| %: MAKEFLAGS += -O |
| endif |
| |
| TMP = $(CURDIR)/debian/tmp |
| GIT = $(CURDIR)/debian/git |
| |
| %: |
| dh $@ --with apache2 |
| |
| override_dh_auto_configure: |
| |
| build-stamp: |
| -$(CC) -v |
| $(MAKE) all $(OPTS) |
| touch $@ |
| |
| override_dh_auto_build-arch: build-stamp |
| $(MAKE) -C contrib/subtree all $(OPTS) |
| ln -s contrib/subtree/git-subtree |
| |
| override_dh_auto_test-arch: |
| chmod +x t/t[0-9]*.sh |
| test -z '$(TEST)' || \ |
| $(MAKE) $(TEST) $(OPTS) || \ |
| GIT_TEST_OPTS=--verbose $(MAKE) $(TEST) $(OPTS) |
| test -z '$(TEST)' || \ |
| $(MAKE) -C contrib/subtree $(TEST) $(OPTS) || \ |
| GIT_TEST_OPTS=--verbose $(MAKE) -C contrib/subtree $(TEST) $(OPTS) |
| |
| override_dh_auto_build-indep: build-stamp |
| # git-man, git-doc |
| $(MAKE) -CDocumentation man html $(DOC_OPTS) |
| # git-mediawiki |
| $(MAKE) -Ccontrib/mw-to-git all $(OPTS) |
| |
| override_dh_auto_test-indep: |
| |
| override_dh_auto_clean: |
| $(MAKE) -C contrib/mw-to-git clean $(OPTS) |
| $(MAKE) -C contrib/subtree clean $(OPTS) |
| $(MAKE) clean $(OPTS) |
| rm -f git-subtree |
| |
| override_dh_auto_install-arch: |
| # git |
| DESTDIR='$(GIT)' $(MAKE) install $(OPTS) |
| DESTDIR='$(GIT)' $(MAKE) -C contrib/subtree install $(OPTS) |
| install -d -m0755 '$(GIT)'/var/lib/git |
| rm -f '$(GIT)'/usr/share/perl5/Error.pm |
| rm -rf '$(GIT)'/usr/share/man |
| # don't include arch, cvs, p4, svn, email, gui tools, and gitk program |
| for i in git-archimport git-cvs git-p4 git-svn git-send-email \ |
| git-gui git-citool; do \ |
| rm -f '$(GIT)'/usr/lib/git-core/$$i*; \ |
| done |
| rm -f '$(GIT)'/usr/bin/git-cvsserver |
| rm -f '$(GIT)'/usr/bin/gitk |
| # don't include git-gui's lib |
| rm -rf '$(GIT)'/usr/share/git-gui/ |
| # don't include gitk's lib |
| rm -rf '$(GIT)'/usr/share/gitk/ |
| # don't include git-svn's lib |
| rm -rf '$(GIT)'/usr/share/perl5/Git/SVN* |
| # sanity check that #642603 fix is still in place |
| test $$(stat -c%h \ |
| '$(GIT)'/usr/lib/git-core/git-branch) -le 10 |
| |
| override_dh_auto_install-indep: |
| DESTDIR='$(TMP)' $(MAKE) install install-doc $(OPTS) |
| DESTDIR='$(TMP)' $(MAKE) -Ccontrib/mw-to-git install $(OPTS) \ |
| INSTLIBDIR=/usr/share/perl5 |
| $(MAKE) -CDocumentation install-webdoc WEBDOC_DEST='$(TMP)'/html \ |
| 2>/dev/null |
| DESTDIR='$(TMP)' $(MAKE) -Ccontrib/subtree install-doc $(OPTS) |
| install -m 0644 contrib/subtree/git-subtree.txt '$(TMP)'/html |
| # RelNotes are shipped in git |
| rm -rf '$(TMP)'/html/RelNotes |
| # don't include git-p4 man page |
| rm -f '$(TMP)'/html/git-p4.* |
| |
| override_dh_install-arch: |
| dh_install --arch |
| rm -rf '$(GIT)'/usr/share/git-core/contrib/hooks/multimail |
| |
| override_dh_install-indep: |
| dh_install --indep |
| for i in git-archimport git-cvs git-p4 git-svn git-send-email gitk \ |
| git-gui git-citool; do \ |
| rm -f '$(GIT)'-man/usr/share/man/man1/$$i*; \ |
| done |
| rm -f '$(GIT)'-man/usr/share/man/man3/Git::SVN*.3pm |
| |
| override_dh_installdocs-arch: |
| dh_installdocs --arch -X.gitignore |
| # These licenses are replaced with symlinks in git.links. |
| diff -q '$(GIT)'/usr/share/doc/git/contrib/persistent-https/LICENSE /usr/share/common-licenses/Apache-2.0 |
| diff -bq '$(GIT)'/usr/share/doc/git/contrib/subtree/COPYING /usr/share/common-licenses/GPL-2 |
| rm -rf '$(GIT)'/usr/share/doc/git/contrib/completion |
| rm -rf '$(GIT)'/usr/share/doc/git/contrib/emacs |
| rm -rf '$(GIT)'/usr/share/doc/git/contrib/hooks |
| rm -rf '$(GIT)'/usr/share/doc/git/contrib/mw-to-git |
| rm -f '$(GIT)'/usr/share/doc/git/contrib/subtree/git-subtree.1 |
| rm -f '$(GIT)'/usr/share/doc/git/contrib/subtree/git-subtree.html |
| rm -f '$(GIT)'/usr/share/doc/git/contrib/subtree/git-subtree.xml |
| find '$(GIT)'/usr/share/doc/git/ -name .gitignore | xargs rm -f |
| |
| override_dh_installdocs-indep: |
| install -d -m0755 '$(GIT)'-core/usr/share/doc |
| ln -s git '$(GIT)'-core/usr/share/doc/git-core |
| dh_installdocs --indep -X.gitignore |
| |
| override_dh_installchangelogs: |
| dh_installchangelogs debian/changelog.upstream |
| |
| override_dh_installinit: |
| dh_installinit -pgit-daemon-sysvinit --name=git-daemon |
| dh_installinit |
| |
| # Skip dh_installemacsen to avoid having to rename |
| # /etc/emacs/site-start.d/50git-core.el to |
| # /etc/emacs/site-start.d/50git-el.el. |
| override_dh_installemacsen: |
| |
| override_dh_compress: |
| dh_compress -X.txt -Xcontrib |