summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2018-11-27 01:00:31 +0100
committerYves Fischer <yvesf-git@xapek.org>2018-11-27 01:04:17 +0100
commit79beafcbe7dceee1d540d3522ebddd149f7e58be (patch)
tree28a55e9d8b34b73e242de48f7657c25da5dc5f16
parent17967ef2633dd5a4a9f9248f27e6163670e27347 (diff)
downloadgit-repo-79beafcbe7dceee1d540d3522ebddd149f7e58be.tar.gz
git-repo-79beafcbe7dceee1d540d3522ebddd149f7e58be.zip
debian packaging
-rw-r--r--Makefile17
-rw-r--r--Makefile.package29
2 files changed, 39 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 809f21d..295747e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,12 @@
-PREFIX=/usr/local
+PACKAGE_NAME=git-repo
+PACKAGE_VERSION=0.1+git-$(shell git describe --always HEAD)
+PREFIX=/usr/local/bin
-info:
- echo 'install'
+include Makefile.package
+
+
+work/data: work work/data/$(PREFIX)
+work/data/$(PREFIX):
+ mkdir -p "$@"
+ cp git-repo "$@"
-install:
- cp git-repo $(PREFIX)/bin
- chmod 0755 $(PREFIX)/bin/git-repo
- chown root:root $(PREFIX)/bin/git-repo
diff --git a/Makefile.package b/Makefile.package
new file mode 100644
index 0000000..ec1e4dd
--- /dev/null
+++ b/Makefile.package
@@ -0,0 +1,29 @@
+PACKAGE_DESCRIPTION ?= "Quick packaging for $(PACKAGE_NAME)"
+PACKAGE_MAINTAINER ?= "$(shell echo $USER)@$(shell hostname)"
+OUT_DEB=$(PACKAGE_NAME)-$(PACKAGE_VERSION).deb
+
+all: $(OUT_DEB)
+clean:
+ rm -rvf target work $(OUT_DEB)
+target:
+ mkdir $@
+target/debian-binary: | target
+ echo 2.0 > $@
+target/control.tar.gz: work/control/control
+ tar cvzf $@ -C work/control .
+target/data.tar.gz: work/data
+ tar cvzf $@ -C work/data .
+work:
+ mkdir $@
+work/control: work
+ mkdir $@
+work/data: work
+ mkdir -p $@
+work/control/control: work/control
+ echo "Package: $(PACKAGE_NAME)" >$@
+ echo "Version: $(PACKAGE_VERSION)" >>$@
+ echo "Architecture: amd64" >>$@
+ echo "Maintainer: $(PACKAGE_MAINTAINER)" >>$@
+ echo "Description: $(PACKAGE_DESCRIPTION)" >>$@
+$(OUT_DEB): target/debian-binary target/control.tar.gz target/data.tar.gz
+ ar q $@ $^