debian: Run make all from both build-arch and build-indep
[git/debian.git] / debian / rules
blob142c8e7b415218c6591dbdfd51633bb0df2faf73
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 USE_LIBPCRE=1 \
13 SANE_TOOL_PATH= INSTALL=install TAR=tar \
14 NO_CROSS_DIRECTORY_HARDLINKS=1 NO_INSTALL_HARDLINKS=1 \
15 DEFAULT_PAGER=pager DEFAULT_EDITOR=editor \
16 V=1 \
17 CC='$(CC)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)'
18 DOC_OPTS =prefix=/usr htmldir=/usr/share/doc/git/html \
19 V=1 \
20 ASCIIDOC8=1 ASCIIDOC_NO_ROFF=1
22 ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
23 TEST =
24 endif
25 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
26 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
27 MAKEFLAGS += -j$(NUMJOBS)
28 # Setting this with a pattern-specific rule prevents -O from
29 # affecting the top-level make, which would break realtime build
30 # output (unless dh is run as +dh, which causes other problems).
31 %: MAKEFLAGS += -O
32 endif
34 TMP = $(CURDIR)/debian/tmp
35 GIT = $(CURDIR)/debian/git
38 dh $@ --with apache2
40 override_dh_auto_configure:
42 build-stamp:
43 -$(CC) -v
44 DESTDIR='$(GIT)' $(MAKE) all $(OPTS)
45 touch $@
47 override_dh_auto_build-arch: build-stamp
48 DESTDIR='$(GIT)' $(MAKE) -C contrib/subtree all $(OPTS)
49 ln -s contrib/subtree/git-subtree
51 override_dh_auto_test-arch:
52 test -z '$(TEST)' || \
53 DESTDIR='$(GIT)' $(MAKE) $(TEST) $(OPTS) || \
54 GIT_TEST_OPTS=--verbose DESTDIR='$(GIT)' $(MAKE) $(TEST) $(OPTS)
55 test -z '$(TEST)' || \
56 DESTDIR='$(GIT)' $(MAKE) -C contrib/subtree $(TEST) $(OPTS) || \
57 GIT_TEST_OPTS=--verbose DESTDIR='$(GIT)' $(MAKE) -C contrib/subtree $(TEST) $(OPTS)
59 override_dh_auto_build-indep: build-stamp
60 # git-man, git-doc
61 $(MAKE) -CDocumentation man html $(DOC_OPTS)
62 # git-mediawiki
63 $(MAKE) -Ccontrib/mw-to-git all $(OPTS)
65 override_dh_auto_test-indep:
67 override_dh_auto_clean:
68 $(MAKE) -C contrib/mw-to-git clean $(OPTS)
69 $(MAKE) -C contrib/subtree clean $(OPTS)
70 $(MAKE) clean $(OPTS)
71 rm -f git-subtree
73 override_dh_auto_install-arch:
74 # git
75 DESTDIR='$(GIT)' $(MAKE) install $(OPTS)
76 DESTDIR='$(GIT)' $(MAKE) -C contrib/subtree install $(OPTS)
77 install -d -m0755 '$(GIT)'/var/lib/git
78 rm -f '$(GIT)'/usr/share/perl5/Error.pm
79 rm -rf '$(GIT)'/usr/share/man
80 # don't include arch, cvs, p4, svn, email, gui tools, and gitk program
81 for i in git-archimport git-cvs git-p4 git-svn git-send-email \
82 git-gui git-citool; do \
83 rm -f '$(GIT)'/usr/lib/git-core/$$i*; \
84 done
85 rm -f '$(GIT)'/usr/bin/git-cvsserver
86 rm -f '$(GIT)'/usr/bin/gitk
87 # don't include git-gui's lib
88 rm -rf '$(GIT)'/usr/share/git-gui/
89 # don't include gitk's lib
90 rm -rf '$(GIT)'/usr/share/gitk/
91 # don't include git-svn's lib
92 rm -rf '$(GIT)'/usr/share/perl5/Git/SVN*
93 # sanity check that #642603 fix is still in place
94 test $$(stat -c%h \
95 '$(GIT)'/usr/lib/git-core/git-branch) -le 10
97 override_dh_auto_install-indep:
98 DESTDIR='$(TMP)' $(MAKE) install install-doc $(OPTS)
99 DESTDIR='$(TMP)' $(MAKE) -Ccontrib/mw-to-git install $(OPTS) \
100 INSTLIBDIR=/usr/share/perl5
101 $(MAKE) -CDocumentation install-webdoc WEBDOC_DEST='$(TMP)'/html \
102 2>/dev/null
103 DESTDIR='$(TMP)' $(MAKE) -Ccontrib/subtree install-doc $(OPTS)
104 install -m 0644 contrib/subtree/git-subtree.txt '$(TMP)'/html
105 # RelNotes are shipped in git
106 rm -rf '$(TMP)'/html/RelNotes
107 # don't include git-p4 man page
108 rm -f '$(TMP)'/html/git-p4.*
110 override_dh_install-arch:
111 dh_install --arch
112 rm -rf '$(GIT)'/usr/share/git-core/contrib/hooks/multimail
114 override_dh_install-indep:
115 dh_install --indep
116 for i in git-archimport git-cvs git-p4 git-svn git-send-email gitk \
117 git-gui git-citool; do \
118 rm -f '$(GIT)'-man/usr/share/man/man1/$$i*; \
119 done
120 rm -f '$(GIT)'-man/usr/share/man/man3/Git::SVN*.3pm
122 override_dh_installdocs:
123 install -d -m0755 '$(GIT)'-core/usr/share/doc
124 ln -s git '$(GIT)'-core/usr/share/doc/git-core
125 dh_installdocs -X.gitignore
126 rm -rf '$(GIT)'/usr/share/doc/git/contrib/completion
127 rm -rf '$(GIT)'/usr/share/doc/git/contrib/emacs
128 rm -rf '$(GIT)'/usr/share/doc/git/contrib/hooks
129 rm -rf '$(GIT)'/usr/share/doc/git/contrib/mw-to-git
130 rm -f '$(GIT)'/usr/share/doc/git/contrib/subtree/git-subtree.1
131 rm -f '$(GIT)'/usr/share/doc/git/contrib/subtree/git-subtree.html
132 rm -f '$(GIT)'/usr/share/doc/git/contrib/subtree/git-subtree.xml
133 find '$(GIT)'/usr/share/doc/git/ -name .gitignore | xargs rm -f
135 override_dh_installchangelogs:
136 dh_installchangelogs debian/changelog.upstream
138 override_dh_installinit:
139 dh_installinit -pgit-daemon-sysvinit --name=git-daemon
140 dh_installinit
142 # Skip dh_installemacsen to avoid having to rename
143 # /etc/emacs/site-start.d/50git-core.el to
144 # /etc/emacs/site-start.d/50git-el.el.
145 override_dh_installemacsen:
147 override_dh_compress:
148 dh_compress -X.txt -Xcontrib