File: rules

package info (click to toggle)
ntfy 2.11.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 19,364 kB
  • sloc: javascript: 16,782; makefile: 282; sh: 105; php: 21; python: 19
file content (45 lines) | stat: -rwxr-xr-x 1,637 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

# bring in DEB_VERSION
include /usr/share/dpkg/default.mk

# export DH_VERBOSE = 1
export DH_GOLANG_EXCLUDES = ^\. assets/ docs/ examples/ scripts/ tools/ web/
export DH_GOLANG_INSTALL_EXTRA = server/mailer_emoji_map.json

%:
	dh $@ --builddirectory=_build --buildsystem=golang --with=golang

# 1. override version/commit/date, this way --help says something like:
#     ntfy 2.11.0-1 (debian-), runtime go1.23.5, built at 2024-12-15
# 2. show a message when accessing the ntfy web root
# 3. upstream Makefile uses these tags, but skipping:
#    sqlite_omit_load_extension,osusergo,netgo
override_dh_auto_build:
	mkdir -pv _build/src/heckel.io/ntfy/server/docs \
		_build/src/heckel.io/ntfy/server/site
	touch _build/src/heckel.io/ntfy/server/docs/index.html
	echo "<html><body>" \
		"ntfy web root: no web app is running in the debian version" \
		"</body></html>" > \
		_build/src/heckel.io/ntfy/server/site/app.html
	dh_auto_build -- \
		-ldflags "-X main.version=$(DEB_VERSION) -X main.commit=debian- \
			-X main.date=$(shell date -I --date='@$(SOURCE_DATE_EPOCH)')"

override_dh_auto_install:
	dh_auto_install -- --no-source

# install services without enabling or starting them as
# ntfy/ntfy-client are noisy and configured for port 80 by default
override_dh_installsystemd:
	dh_installsystemd --no-start --no-enable --restart-after-upgrade

# Call sysusers because it's not called by standard dh sequence in compat=13
execute_after_dh_installsystemd:
	dh_installsysusers


# Skip tests as they make requests to http://ntfy.sh
# Although they should run as the depends have been tagged
override_dh_auto_test: