debian/control: add Recommends against ca-certificates
[git/debian.git] / debian / rules
blobc594c326e409da3dfe5770708377c2ea12a4eafa
1 #!/usr/bin/make -f
3 CC =gcc
4 CPPFLAGS :=$(shell dpkg-buildflags --get CPPFLAGS)
5 CFLAGS :=-Wall $(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
6 LDFLAGS :=$(shell dpkg-buildflags --get LDFLAGS)
7 TEST =test
8 OPTS =NO_OPENSSL=1 prefix=/usr gitexecdir=/usr/lib/git-core \
9 libexecdir=/usr/lib/git-core \
10 mandir=/usr/share/man htmldir=/usr/share/doc/git/html \
11 INSTALLDIRS=vendor \
12 SANE_TOOL_PATH= INSTALL=install TAR=tar \
13 NO_CROSS_DIRECTORY_HARDLINKS=1 NO_INSTALL_HARDLINKS=1 \
14 NO_PERL_CPAN_FALLBACKS=1 \
15 DEFAULT_PAGER=pager DEFAULT_EDITOR=editor \
16 V=1 \
17 CC='$(CC)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)'
18 DOCS =html
19 DOC_OPTS =prefix=/usr htmldir=/usr/share/doc/git/html \
20 V=1 \
21 ASCIIDOC8=1 ASCIIDOC_NO_ROFF=1
23 # https://wiki.debian.org/ReproducibleBuilds/TimestampsInDocumentationGeneratedByAsciidoc
24 DOC_OPTS += ASCIIDOC='TZ=UTC asciidoc'
26 ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
27 TEST =
28 endif
29 ifneq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
30 DOCS =
31 endif
32 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
33 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
34 MAKEFLAGS += -j$(NUMJOBS)
35 # Setting this with a pattern-specific rule prevents -O from
36 # affecting the top-level make, which would break realtime build
37 # output (unless dh is run as +dh, which causes other problems).
38 %: MAKEFLAGS += -O
39 endif
40 ifneq (,$(shell dpkg-query -f '$${Version}' -W libpcre2-dev))
41 OPTS += USE_LIBPCRE2=1
42 else
43 OPTS += USE_LIBPCRE1=1
44 endif
46 TMP = $(CURDIR)/debian/tmp
47 GIT = $(CURDIR)/debian/git
50 dh $@ --with apache2
52 override_dh_auto_configure:
54 build-stamp:
55 -$(CC) -v
56 $(MAKE) all $(OPTS)
57 touch $@
59 override_dh_auto_build-arch: build-stamp
60 $(MAKE) -C contrib/subtree all $(OPTS)
61 ln -s contrib/subtree/git-subtree
63 override_dh_auto_test-arch:
64 test -z '$(TEST)' || \
65 GIT_SKIP_TESTS="t9128 t9167" \
66 GIT_TEST_OPTS=--verbose $(MAKE) $(TEST) $(OPTS)
67 test -z '$(TEST)' || \
68 GIT_TEST_OPTS=--verbose \
69 $(MAKE) -C t \
70 t9128-git-svn-cmd-branch.sh \
71 t9167-git-svn-cmd-branch-subproject.sh \
72 $(OPTS) || :
73 test -z '$(TEST)' || \
74 GIT_TEST_OPTS=--verbose $(MAKE) -C contrib/subtree $(TEST) $(OPTS)
76 override_dh_auto_build-indep: build-stamp
77 # git-man, git-doc
78 $(MAKE) -CDocumentation man $(DOCS) $(DOC_OPTS)
79 # git-mediawiki
80 $(MAKE) -Ccontrib/mw-to-git all $(OPTS)
82 override_dh_auto_test-indep:
84 override_dh_auto_clean:
85 $(MAKE) -C contrib/mw-to-git clean $(OPTS)
86 $(MAKE) -C contrib/subtree clean $(OPTS)
87 $(MAKE) clean $(OPTS)
88 rm -f git-subtree
90 override_dh_clean:
91 dh_clean -Xmailinfo.c.orig
93 override_dh_auto_install-arch:
94 # git
95 DESTDIR='$(GIT)' $(MAKE) install $(OPTS)
96 DESTDIR='$(GIT)' $(MAKE) -C contrib/subtree install $(OPTS)
97 install -d -m0755 '$(GIT)'/var/lib/git
98 rm -rf '$(GIT)'/usr/share/man
99 # don't include arch, cvs, p4, svn, email, gui tools, and gitk program
100 for i in git-archimport git-cvs git-p4 git-svn git-send-email \
101 git-gui git-citool; do \
102 rm -f '$(GIT)'/usr/lib/git-core/$$i*; \
103 done
104 rm -f '$(GIT)'/usr/bin/git-cvsserver
105 rm -f '$(GIT)'/usr/bin/gitk
106 # don't include git-gui's lib
107 rm -rf '$(GIT)'/usr/share/git-gui/
108 # don't include gitk's lib
109 rm -rf '$(GIT)'/usr/share/gitk/
110 # don't include git-svn's lib
111 rm -rf '$(GIT)'/usr/share/perl5/Git/SVN*
112 # sanity check that #642603 fix is still in place
113 test $$(stat -c%h \
114 '$(GIT)'/usr/lib/git-core/git-branch) -le 10
116 override_dh_auto_install-indep:
117 DESTDIR='$(TMP)' $(MAKE) install install-doc $(OPTS)
118 DESTDIR='$(TMP)' $(MAKE) -Ccontrib/mw-to-git install $(OPTS) \
119 INSTLIBDIR=/usr/share/perl5
120 test -z '$(DOCS)' || \
121 $(MAKE) -CDocumentation install-webdoc WEBDOC_DEST='$(TMP)'/html \
122 2>/dev/null
123 test -z '$(DOCS)' || \
124 DESTDIR='$(TMP)' $(MAKE) -Ccontrib/subtree install-doc $(OPTS)
125 install -m 0644 contrib/subtree/git-subtree.txt '$(TMP)'/html
126 # RelNotes are shipped in git
127 rm -rf '$(TMP)'/html/RelNotes
128 # don't include git-p4 man page
129 rm -f '$(TMP)'/html/git-p4.*
131 override_dh_install-arch:
132 dh_install --arch
133 rm -rf '$(GIT)'/usr/share/git-core/contrib/hooks/multimail
135 override_dh_install-indep:
136 dh_install --indep
137 for i in git-archimport git-cvs git-p4 git-svn git-send-email gitk \
138 git-gui git-citool; do \
139 rm -f '$(GIT)'-man/usr/share/man/man1/$$i*; \
140 done
142 override_dh_installdocs-arch:
143 dh_installdocs --arch -X.gitignore
144 # These licenses are replaced with symlinks in git.links.
145 diff -q '$(GIT)'/usr/share/doc/git/contrib/persistent-https/LICENSE /usr/share/common-licenses/Apache-2.0
146 diff -bq '$(GIT)'/usr/share/doc/git/contrib/subtree/COPYING /usr/share/common-licenses/GPL-2
147 rm -rf '$(GIT)'/usr/share/doc/git/contrib/completion
148 rm -rf '$(GIT)'/usr/share/doc/git/contrib/emacs
149 rm -rf '$(GIT)'/usr/share/doc/git/contrib/hooks
150 rm -rf '$(GIT)'/usr/share/doc/git/contrib/mw-to-git
151 rm -f '$(GIT)'/usr/share/doc/git/contrib/subtree/git-subtree.1
152 rm -f '$(GIT)'/usr/share/doc/git/contrib/subtree/git-subtree.html
153 rm -f '$(GIT)'/usr/share/doc/git/contrib/subtree/git-subtree.xml
154 find '$(GIT)'/usr/share/doc/git/ -name .gitattributes | xargs rm -f
155 find '$(GIT)'/usr/share/doc/git/ -name .gitignore | xargs rm -f
157 override_dh_installdocs-indep:
158 dh_installdocs --indep -X.gitignore
160 override_dh_installchangelogs:
161 dh_installchangelogs debian/changelog.upstream
163 override_dh_installinit:
164 dh_installinit -pgit-daemon-sysvinit --name=git-daemon
165 dh_installinit
167 # Skip dh_installemacsen to avoid having to rename
168 # /etc/emacs/site-start.d/50git-core.el to
169 # /etc/emacs/site-start.d/50git-el.el.
170 override_dh_installemacsen:
172 override_dh_compress:
173 dh_compress -X.txt -Xcontrib