From 76811f0d89c2f6adf8076560648b541cf31b63c0 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Tue, 30 Aug 2022 11:39:46 +0200 Subject: [PATCH] add deb specs and rules in makefile --- GNUmakefile | 16 ++++++++++++++++ specs/deb/changelog | 1 + specs/deb/control | 12 ++++++++++++ specs/deb/rules | 10 ++++++++++ specs/rpm/.gitignore | 1 + 5 files changed, 40 insertions(+) create mode 100644 specs/deb/changelog create mode 100644 specs/deb/control create mode 100755 specs/deb/rules create mode 100644 specs/rpm/.gitignore diff --git a/GNUmakefile b/GNUmakefile index 0831fd3802..fdb43b7afc 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -23,6 +23,22 @@ rpm-build: srpm-build cd ~/rpmbuild/ rpmbuild -bs +template-deb: + RELEASE_JSON="$$(curl https://api.github.com/repos/scaleway/scaleway-cli/releases/tags/v${VERSION})"; \ + CHANGELOG="$$(echo $${RELEASE_JSON} | jq ."body" -r | grep '^*' | sed s/^\*/\ \ \*/g)"; \ + DATE=$$(date -d "$$(echo $${RELEASE_JSON} | jq ."created_at" -r)" -R) ; \ + echo -e "scw (${VERSION}) focal; urgency=medium\n" > specs/deb/changelog; \ + echo "$${CHANGELOG}" >> specs/deb/changelog; \ + echo -e "\n -- Scaleway Devtools $${DATE}" >> specs/deb/changelog + +deb-setup: + apt install devscripts equivs jq -y + mk-build-deps --install debian/control + go mod vendor + +deb-source-build: deb-setup template-deb + debuild -S -k524A68BAB1A91B2F74DCEC3B31F9FBCA5BD8707C + require-version: ifndef VERSION $(error VERSION is undefined) diff --git a/specs/deb/changelog b/specs/deb/changelog new file mode 100644 index 0000000000..9fad0afc72 --- /dev/null +++ b/specs/deb/changelog @@ -0,0 +1 @@ +## File should be updated by \ No newline at end of file diff --git a/specs/deb/control b/specs/deb/control new file mode 100644 index 0000000000..d7fad1b179 --- /dev/null +++ b/specs/deb/control @@ -0,0 +1,12 @@ +Source: scw +Homepage: https://www.scaleway.com/ +Maintainer: Scaleway Devtools +Rules-Requires-Root: no +Build-Depends: debhelper-compat (= 13), + dh-golang, + golang-any, + +Package: scw +Architecture: all +Description: Scaleway CLI +XS-Go-Import-Path: github.com/scaleway/scaleway-cli/v2/cmd/scw diff --git a/specs/deb/rules b/specs/deb/rules new file mode 100755 index 0000000000..dfc84ad181 --- /dev/null +++ b/specs/deb/rules @@ -0,0 +1,10 @@ +#!/usr/bin/make -f + +export DH_GOPKG := github.com/scaleway/scaleway-cli/v2 +export DH_GOLANG_BUILDPKG := ${DH_GOPKG}/cmd/scw + +%: + dh $@ --builddirectory=_build + +override_dh_auto_install: + dh_auto_install -- --no-source \ No newline at end of file diff --git a/specs/rpm/.gitignore b/specs/rpm/.gitignore new file mode 100644 index 0000000000..e2c466f3da --- /dev/null +++ b/specs/rpm/.gitignore @@ -0,0 +1 @@ +scaleway-cli.spec \ No newline at end of file