Compare commits

..

3 Commits

Author SHA1 Message Date
693ac6e677
Generate Debian package from template
Refs #7
2021-04-09 00:19:56 +00:00
953b1009d3
Fix PREFIX AND DESTDIR
Refs #7
2021-04-09 00:19:50 +00:00
11053571d5
Move debian files
Refs #7
2021-04-09 00:19:38 +00:00
7 changed files with 27 additions and 10 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

@ -1,7 +1,7 @@
V ?= 0 V ?= 0
Q = $(if $(filter 1, $V),, @) Q = $(if $(filter 1, $V),, @)
BINDIR=$(CURDIR)/bin BINDIR=$(CURDIR)/bin
PREFIX=/usr/bin PREFIX=/usr
DESTDIR=bin DESTDIR=bin
ifeq ($(OS), Windows_NT) ifeq ($(OS), Windows_NT)
@ -26,13 +26,26 @@ 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
install: install:
$(Q) install -p -D -m 0755 $(EXE) $(DESTDIR)${PREFIX}/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
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

5
debian/changelog vendored
View File

@ -1,5 +0,0 @@
lume (0.1.0) UNRELEASED; urgency=medium
* Fake entry.
-- Ryan Cavicchioni <ryan@cavi.cc> Thu, 08 Apr 2021 02:14:36 +0000

View File

@ -0,0 +1,5 @@
lume (__VERSION__) UNRELEASED; urgency=medium
* Package generated with make deb
-- Ryan Cavicchioni <ryan@cavi.cc> __DATE__

View File

@ -3,4 +3,5 @@ Maintainer: Ryan Cavicchioni <ryan@cavi.cc>
Package: lume Package: lume
Architecture: any Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: A CLI tool for the LIFX HTTP API Description: A CLI tool for the LIFX HTTP API

View File

@ -1,8 +1,8 @@
#!/usr/bin/make -f #!/usr/bin/make -f
DISTRIBUTION = $(shell lsb_release -sr) DISTRIBUTION = $(shell lsb_release -sr)
VERSION = 0.1.0 VERSION = __VERSION__
PACKAGEVERSION = $(VERSION)-0~$(DISTRIBUTION)0 PACKAGEVERSION = $(VERSION)
%: %:
dh $@ dh $@