Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 include /usr/share/dpkg/pkg-info.mk
4 export GOFLAGS = -ldflags=-X=main.Version=$(DEB_VERSION_UPSTREAM)
5
6 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
7
8 %:
9 dh $@ --buildsystem=golang
10
11 # the source's root is a library that includes subdirectories that are
12 # sub-packages, such as "ct" (Google's CT code) and "cmd/certspotter" and
13 # "cmd/ctparsewatch" for the actual resulting binaries. We actually want to
14 # package mostly "cmd/certspotter" in this package and it's hard but pointless
15 # to package the library into a separate source/binary package. Force the
16 # golang dh buildsystem to actually produce a "program", and forcibly exclude
17 # the binaries that which we don't want to ship (such as ctparsewatch).
18 override_dh_auto_install:
19 dh_auto_install -- --no-source
20 rm -f debian/certspotter/usr/bin/ctparsewatch debian/certspotter/usr/bin/submitct
21
22 ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
23 MANPAGES = debian/certspotter.8 debian/certspotter-script.8
24
25 debian/%.8: man/%.md debian/changelog
26 lowdown -s -Tman \
27 -M title:$(basename $(notdir $@)) \
28 -M section:$(subst .,,$(suffix $@)) \
29 -M date:$(if $(SOURCE_DATE_EPOCH),$(shell date -I -u -d "@$(SOURCE_DATE_EPOCH)"),$(shell date -I -u)) \
30 -o $@ $<
31
32 execute_after_dh_auto_build: $(MANPAGES)
33
34 execute_after_dh_installman:
35 dh_installman $(MANPAGES)
36
37 execute_after_dh_auto_clean:
38 dh_clean $(MANPAGES)
39 endif