From f54b579ae3f891158d3e5d3072f6306c496901d3 Mon Sep 17 00:00:00 2001 From: William Petit Date: Thu, 5 Dec 2019 13:10:02 +0100 Subject: [PATCH] Add Debian packaging recipe --- debian/compat | 1 + debian/control | 14 +++++++++++ debian/gitea-kan.service | 11 ++++++++ debian/rules | 54 ++++++++++++++++++++++++++++++++++++++++ debian/source/format | 1 + 5 files changed, 81 insertions(+) create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/gitea-kan.service create mode 100644 debian/rules create mode 100644 debian/source/format diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..725ae2c --- /dev/null +++ b/debian/control @@ -0,0 +1,14 @@ +Source: gitea-kan +Section: unknown +Priority: optional +Maintainer: William Petit +Build-Depends: debhelper (>= 8.0.0), wget, ca-certificates, tar +Standards-Version: 3.9.4 +Homepage: http://forge.cadoles.com/wpetit/gitea-kan +Vcs-Git: http://forge.cadoles.com/wpetit/gitea-kan.git +Vcs-Browser: http://forge.cadoles.com/wpetit/gitea-kan + +Package: gitea-kan +Architecture: amd64 +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Application type "Kanboard" connectée à Gitea diff --git a/debian/gitea-kan.service b/debian/gitea-kan.service new file mode 100644 index 0000000..3ef1a42 --- /dev/null +++ b/debian/gitea-kan.service @@ -0,0 +1,11 @@ +[Unit] +Description=Application type "Kanboard" connectée à Gitea +After=network-online.target + +[Service] +Type=simple +ExecStart=/usr/bin/gitea-kan -workdir /usr/share/gitea-kan -config /etc/gitea-kan/server.conf +Restart=on-failure + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/debian/rules b/debian/rules new file mode 100644 index 0000000..5f2ddda --- /dev/null +++ b/debian/rules @@ -0,0 +1,54 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +GO_VERSION := 1.13.5 +OS := linux +ARCH := amd64 +GOPATH=$(HOME)/go + +ifeq (, $(shell which go 2>/dev/null)) +override_dh_auto_build: install-go +endif + +ifeq (, $(shell which node 2>/dev/null)) +override_dh_auto_build: install-nodejs +endif + +%: + dh $@ --with systemd + +override_dh_auto_build: $(GOPATH) + cd client && npm install + GOPATH=$(GOPATH) PATH="$(PATH):/usr/local/go/bin:$(GOPATH)/bin" go mod vendor + GOPATH=$(GOPATH) PATH="$(PATH):/usr/local/go/bin:$(GOPATH)/bin" ARCH_TARGETS=$(ARCH) make release + +$(GOPATH): + mkdir -p $(GOPATH) + +install-go: + wget https://dl.google.com/go/go$(GO_VERSION).$(OS)-$(ARCH).tar.gz + tar -C /usr/local -xzf go$(GO_VERSION).$(OS)-$(ARCH).tar.gz + +install-nodejs: + wget -O- https://deb.nodesource.com/setup_12.x | bash - + apt-get install -y nodejs + +override_dh_auto_install: + + mkdir -p debian/gitea-kan/usr/share/gitea-kan + mkdir -p debian/gitea-kan/etc/gitea-kan + mkdir -p debian/gitea-kan/usr/bin + + cp -r release/server-$(OS)-$(ARCH)/* debian/gitea-kan/usr/share/gitea-kan/ + + mv debian/gitea-kan/usr/share/gitea-kan/bin/server debian/gitea-kan/usr/bin/gitea-kan + mv debian/gitea-kan/usr/share/gitea-kan/server.conf debian/gitea-kan/etc/gitea-kan/server.conf + + install -d debian/gitea-kan + +override_dh_strip: + +override_dh_auto_test: \ No newline at end of file diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..9f67427 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) \ No newline at end of file