Skip to content

Commit

Permalink
add deb specs and rules in makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot committed Aug 30, 2022
1 parent 3cff110 commit 76811f0
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
16 changes: 16 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]> $${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)
Expand Down
1 change: 1 addition & 0 deletions specs/deb/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## File should be updated by
12 changes: 12 additions & 0 deletions specs/deb/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Source: scw
Homepage: https://www.scaleway.com/
Maintainer: Scaleway Devtools <[email protected]>
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
10 changes: 10 additions & 0 deletions specs/deb/rules
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions specs/rpm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scaleway-cli.spec

0 comments on commit 76811f0

Please sign in to comment.