Mise à jour règles packaging Debian

This commit is contained in:
wpetit 2020-07-16 22:33:51 +02:00
parent 1d526a37d0
commit 7122677351
3 changed files with 34 additions and 18 deletions

10
debian/control vendored
View File

@ -1,14 +1,14 @@
Source: daddy Source: daddy
Section: unknown Section: unknown
Priority: optional Priority: optional
Maintainer: Cadoles <contanct@cadoles.com> Maintainer: Cadoles <contact@cadoles.com>
Build-Depends: debhelper (>= 8.0.0), wget, ca-certificates, tar, curl Build-Depends: debhelper (>= 8.0.0), wget, ca-certificates, tar
Standards-Version: 3.9.4 Standards-Version: 3.9.4
Homepage: http://forge.cadoles.com/Cadoles/daddy Homepage: http://forge.cadoles.com/Cadoles/daddy
Vcs-Git: http://forge.cadoles.com/Cadoles/daddy.git Vcs-Git: http://forge.cadoles.com/Cadoles/daddy.git
Vcs-Browser: http://forge.cadoles.com/Cadoles/daddy Vcs-Browser: http://forge.cadoles.com/Cadoles/daddy
Package: daddy Package: daddy
Architecture: any Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, nginx-full, super-graph, postgresql Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Application de gestion des DADs à Cadoles Description: Daddy app

View File

@ -1,11 +1,10 @@
[Unit] [Unit]
Description=Service "super-graph" pour l'application Daddy Description=Daddy app
After=network-online.target After=network-online.target
[Service] [Service]
Type=simple Type=simple
EnvironmentFile=/etc/systemd/system/daddy.env ExecStart=/usr/bin/daddy -workdir /usr/share/daddy -config /etc/daddy/config.yml
ExecStart=/usr/bin/super-graph serv --path /usr/share/daddy/server/config
Restart=on-failure Restart=on-failure
[Install] [Install]

37
debian/rules vendored
View File

@ -4,6 +4,15 @@
# Uncomment this to turn on verbose mode. # Uncomment this to turn on verbose mode.
export DH_VERBOSE=1 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)) ifeq (, $(shell which node 2>/dev/null))
override_dh_auto_build: install-nodejs override_dh_auto_build: install-nodejs
endif endif
@ -11,23 +20,31 @@ endif
%: %:
dh $@ --with systemd dh $@ --with systemd
override_dh_auto_build: override_dh_auto_build: $(GOPATH)
cd frontend && npm install && npm run build 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: install-nodejs:
wget -O- https://deb.nodesource.com/setup_12.x | bash - wget -O- https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs apt-get install -y nodejs
override_dh_auto_install: override_dh_auto_install:
mkdir -p debian/daddy/usr/share/daddy/client/public
mkdir -p debian/daddy/usr/share/daddy/server/config
mkdir -p debian/daddy/etc/nginx/sites-available
mkdir -p debian/daddy/etc/systemd/system
cp -r frontend/dist/* debian/daddy/usr/share/daddy/client/public/ mkdir -p debian/daddy/usr/share/daddy
cp -r backend/config/* debian/daddy/usr/share/daddy/server/config/ mkdir -p debian/daddy/etc/daddy
cp misc/debian/nginx/daddy.conf debian/daddy/etc/nginx/sites-available/ mkdir -p debian/daddy/usr/bin
cp misc/debian/systemd/daddy.env debian/daddy/etc/systemd/system/
cp -r release/server-$(OS)-$(ARCH)/* debian/daddy/usr/share/daddy/
mv debian/daddy/usr/share/daddy/bin/server debian/daddy/usr/bin/daddy
mv debian/daddy/usr/share/daddy/server.conf debian/daddy/etc/daddy/config.yml
install -d debian/daddy install -d debian/daddy