Skip to content

Commit 5571121

Browse files
committed
build: add install and docs targets
Add a make install target that puts the binary in /usr/bin, the systemd units in /usr/lib/systemd/system and generates a default configuration file in /etc. Add a docs target that builds the Sphinx documentation through a Python virtualenv. Signed-off-by: Robin Jarry <robin@jarry.cc>
1 parent 201bb29 commit 5571121

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎Makefile‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ pw: $(src)
2222
$(GO) generate ./...
2323
$(GO) build -trimpath -o pw ./cmd/pw
2424

25+
prefix ?= /usr
26+
sysconfdir ?= /etc
27+
unitdir ?= /usr/lib/systemd/system
28+
29+
.PHONY: install
30+
install: pw
31+
install -Dm755 pw $(DESTDIR)$(prefix)/bin/pw
32+
install -Dm644 etc/pw-http.service $(DESTDIR)$(unitdir)/pw-http.service
33+
install -Dm644 etc/pw-ingress.service $(DESTDIR)$(unitdir)/pw-ingress.service
34+
install -Dm644 etc/nginx.conf $(DESTDIR)$(sysconfdir)/nginx/conf.d/patchwork.conf
35+
$(DESTDIR)$(prefix)/bin/pw config > $(DESTDIR)$(sysconfdir)/patchwork.toml
36+
2537
import_reviser ?= github.com/incu6us/goimports-reviser/v3@v3.12.6
2638
import_reviser_flags ?= -rm-unused -project-name github.com/getpatchwork/patchwork
2739
gofumpt ?= mvdan.cc/gofumpt@v0.9.2

0 commit comments

Comments
 (0)