Skip to content

Commit 76811f0

Browse files
committed
add deb specs and rules in makefile
1 parent 3cff110 commit 76811f0

File tree

5 files changed

+40
-0
lines changed

5 files changed

+40
-0
lines changed

GNUmakefile

+16
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ rpm-build: srpm-build
2323
cd ~/rpmbuild/
2424
rpmbuild -bs
2525

26+
template-deb:
27+
RELEASE_JSON="$$(curl https://api.github.com/repos/scaleway/scaleway-cli/releases/tags/v${VERSION})"; \
28+
CHANGELOG="$$(echo $${RELEASE_JSON} | jq ."body" -r | grep '^*' | sed s/^\*/\ \ \*/g)"; \
29+
DATE=$$(date -d "$$(echo $${RELEASE_JSON} | jq ."created_at" -r)" -R) ; \
30+
echo -e "scw (${VERSION}) focal; urgency=medium\n" > specs/deb/changelog; \
31+
echo "$${CHANGELOG}" >> specs/deb/changelog; \
32+
echo -e "\n -- Scaleway Devtools <[email protected]> $${DATE}" >> specs/deb/changelog
33+
34+
deb-setup:
35+
apt install devscripts equivs jq -y
36+
mk-build-deps --install debian/control
37+
go mod vendor
38+
39+
deb-source-build: deb-setup template-deb
40+
debuild -S -k524A68BAB1A91B2F74DCEC3B31F9FBCA5BD8707C
41+
2642
require-version:
2743
ifndef VERSION
2844
$(error VERSION is undefined)

specs/deb/changelog

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## File should be updated by

specs/deb/control

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Source: scw
2+
Homepage: https://www.scaleway.com/
3+
Maintainer: Scaleway Devtools <[email protected]>
4+
Rules-Requires-Root: no
5+
Build-Depends: debhelper-compat (= 13),
6+
dh-golang,
7+
golang-any,
8+
9+
Package: scw
10+
Architecture: all
11+
Description: Scaleway CLI
12+
XS-Go-Import-Path: github.com/scaleway/scaleway-cli/v2/cmd/scw

specs/deb/rules

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/make -f
2+
3+
export DH_GOPKG := github.com/scaleway/scaleway-cli/v2
4+
export DH_GOLANG_BUILDPKG := ${DH_GOPKG}/cmd/scw
5+
6+
%:
7+
dh $@ --builddirectory=_build
8+
9+
override_dh_auto_install:
10+
dh_auto_install -- --no-source

specs/rpm/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
scaleway-cli.spec

0 commit comments

Comments
 (0)