Generate Debian package from template

Refs #7
This commit is contained in:
Ryan Cavicchioni 2021-04-09 00:06:28 +00:00
parent 953b1009d3
commit 693ac6e677
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D
2 changed files with 16 additions and 1 deletions

3
.gitignore vendored
View File

@ -21,3 +21,6 @@
.vscode/configurationCache.log .vscode/configurationCache.log
.vscode/dryrun.log .vscode/dryrun.log
.vscode/targets.log .vscode/targets.log
# packaging
/debian

View File

@ -26,7 +26,7 @@ build:
$(Q) go build -o $(EXE) -ldflags="$(LDFLAGS)" ./cmd/lume $(Q) go build -o $(EXE) -ldflags="$(LDFLAGS)" ./cmd/lume
.PHONY: clean .PHONY: clean
clean: clean: deb-clean
$(Q) $(RM) $(EXE) $(Q) $(RM) $(EXE)
.PHONY: install .PHONY: install
@ -34,6 +34,18 @@ install:
$(Q) install -p -D -m 0755 $(EXE) $(DESTDIR)${PREFIX}/bin/lume $(Q) install -p -D -m 0755 $(EXE) $(DESTDIR)${PREFIX}/bin/lume
$(Q) install -p -D -m 0644 .lumerc.sample $(DESTDIR)${PREFIX}/share/lume/lumerc $(Q) install -p -D -m 0644 .lumerc.sample $(DESTDIR)${PREFIX}/share/lume/lumerc
DEBDIR=$(CURDIR)/debian
TMPLDIR=$(CURDIR)/packaging/debian
DEBDATE=$(shell date -R)
.PHONY: deb .PHONY: deb
deb: deb:
$(Q) mkdir -p $(DEBDIR)
$(Q) sed -e 's/__VERSION__/$(LUME_VERSION)/g' $(TMPLDIR)/rules > $(DEBDIR)/rules
$(Q) sed -e 's/__VERSION__/$(LUME_VERSION)/g' -e 's/__DATE__/$(DEBDATE)/g' $(TMPLDIR)/changelog > $(DEBDIR)/changelog
$(Q) echo 9 > $(DEBDIR)/compat
$(Q) cp $(TMPLDIR)/control $(DEBDIR)/control
$(Q) dpkg-buildpackage -us -uc -b $(Q) dpkg-buildpackage -us -uc -b
deb-clean:
$(Q) rm -rf $(CURDIR)/debian