prep for debian packaging
This commit is contained in:
parent
43e413c733
commit
e20737d48b
9 changed files with 248 additions and 1 deletions
77
.gitlab-ci.yml
Normal file
77
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
# Is performed before the scripts in the stages step
|
||||||
|
before_script:
|
||||||
|
- source /etc/profile
|
||||||
|
|
||||||
|
# Defines stages which are to be executed
|
||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- upload
|
||||||
|
- release
|
||||||
|
|
||||||
|
.setup_script: &setup_scripts
|
||||||
|
- apt-get update
|
||||||
|
- apt-get -y build-dep .
|
||||||
|
- apt-get -y install dpkg-dev
|
||||||
|
|
||||||
|
.compile: &compile
|
||||||
|
stage: compile
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
script:
|
||||||
|
- *setup_scripts
|
||||||
|
- dpkg-buildpackage -b
|
||||||
|
- mkdir -p ./build/{release,debug}
|
||||||
|
- find ../ -name "*.deb" -not -name "*dbgsym*" -exec mv {} ./build/release/ \;
|
||||||
|
- find ../ -name "*dbgsym*.deb" -exec mv {} ./build/debug/ \;
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- build/release/*
|
||||||
|
- build/debug/*
|
||||||
|
untracked: true
|
||||||
|
|
||||||
|
build:x86_64:
|
||||||
|
<<: *compile
|
||||||
|
stage: build
|
||||||
|
tags:
|
||||||
|
- x86_64
|
||||||
|
|
||||||
|
build:aarch64:
|
||||||
|
<<: *compile
|
||||||
|
stage: build
|
||||||
|
tags:
|
||||||
|
- aarch64
|
||||||
|
|
||||||
|
upload:
|
||||||
|
stage: upload
|
||||||
|
dependencies:
|
||||||
|
dependencies:
|
||||||
|
- build:x86_64
|
||||||
|
- build:aarch64
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
script:
|
||||||
|
- find ./build/release -name "*.deb"
|
||||||
|
- debs=( $( find ./build/release -name "*.deb" ) )
|
||||||
|
- assets=""
|
||||||
|
- for d in ${debs[@]};do
|
||||||
|
- file=$( basename ${d} )
|
||||||
|
- url="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${file}"
|
||||||
|
- assets="${assets} --assets-link {\"name\":\"${file}\",\"url\":\"${url}\",\"link_type\":\"other\"} "
|
||||||
|
- "curl --header \"JOB-TOKEN: $CI_JOB_TOKEN\" --upload-file \"${d}\" \"${url}\""
|
||||||
|
- done
|
||||||
|
- echo "ASSETS_ARG=${assets}" >> assets.env
|
||||||
|
artifacts:
|
||||||
|
reports:
|
||||||
|
dotenv: assets.env
|
||||||
|
|
||||||
|
release:
|
||||||
|
stage: release
|
||||||
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
script:
|
||||||
|
- echo "making release!"
|
||||||
|
- echo ${ASSETS_ARG}
|
||||||
|
- release-cli create --name "Release ${CI_COMMIT_TAG}" --tag-name "${CI_COMMIT_TAG}" ${ASSETS_ARG}
|
||||||
|
tags:
|
||||||
|
- x86_64
|
7
debian/.gitignore
vendored
Normal file
7
debian/.gitignore
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
*.debhelper
|
||||||
|
*.log
|
||||||
|
*.substvars
|
||||||
|
/.debhelper/
|
||||||
|
/debhelper-build-stamp
|
||||||
|
/files
|
||||||
|
/waybar-nmvpn/
|
5
debian/changelog
vendored
Normal file
5
debian/changelog
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
waybar-nmvpn (0.0.1-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Initial release (Closes: TODO)
|
||||||
|
|
||||||
|
-- Penelope Gwen <support@pogmom.me> Tue, 11 Jun 2024 13:28:08 -0600
|
65
debian/control
vendored
Normal file
65
debian/control
vendored
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
Source: waybar-nmvpn
|
||||||
|
Section: golang
|
||||||
|
Priority: optional
|
||||||
|
Maintainer: Penelope Gwen <support@pogmom.me>
|
||||||
|
Uploaders: Penelope Gwen <support@pogmom.me>
|
||||||
|
Rules-Requires-Root: no
|
||||||
|
Build-Depends: debhelper-compat (= 13),
|
||||||
|
dh-sequence-golang,
|
||||||
|
golang-any
|
||||||
|
Testsuite: autopkgtest-pkg-go
|
||||||
|
Standards-Version: 4.6.2
|
||||||
|
Homepage: https://git.pogmom.me/pogmommy/waybar-nmvpn
|
||||||
|
XS-Go-Import-Path: github.com/lack/waybar-nmvpn
|
||||||
|
|
||||||
|
Package: waybar-nmvpn
|
||||||
|
Section: x11
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${misc:Depends},
|
||||||
|
${shlibs:Depends}
|
||||||
|
Built-Using: ${misc:Built-Using}
|
||||||
|
Description: Waybar plugin to display NetworkManager VPN status
|
||||||
|
waybar-nmvpn
|
||||||
|
.
|
||||||
|
Waybar plugin to display NetworkManager VPN status
|
||||||
|
.
|
||||||
|
Installation
|
||||||
|
.
|
||||||
|
go install github.com/lack/waybar-nmvpn@latest
|
||||||
|
.
|
||||||
|
Configuration
|
||||||
|
.
|
||||||
|
In $XDG_CONFIG_HOME/waybar/config
|
||||||
|
.
|
||||||
|
{
|
||||||
|
// ... other waybar configuration
|
||||||
|
"custom/nmvpn": {
|
||||||
|
"format": "{} {icon}",
|
||||||
|
"return-type": "json",
|
||||||
|
"exec": "$GOPATH/bin/waybar-nmvpn",
|
||||||
|
"format-icons": {
|
||||||
|
"connected": "",
|
||||||
|
"disconnected": "",
|
||||||
|
"none": "",
|
||||||
|
"error": "⚠"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.
|
||||||
|
In $XDG_CONFIG_HOME/waybar/style.css
|
||||||
|
.
|
||||||
|
#custom-nmvpn.connected {
|
||||||
|
background-color: rgba(0x29, 0x80, 0xb9, 0.8);
|
||||||
|
box-shadow: inset 0 -3px rgba(0x29, 0x80, 0xb9, 1.0);
|
||||||
|
}
|
||||||
|
.
|
||||||
|
#custom-nmvpn.disconnected {
|
||||||
|
background-color: rgba(0xf5, 0x3c, 0x3c, 0.8);
|
||||||
|
box-shadow: inset 0 -3px rgba(0xf5, 0x3c, 0x3c, 1.0);
|
||||||
|
}
|
||||||
|
.
|
||||||
|
#custom-nmvpn.error {
|
||||||
|
background-color: rgba(0xeb, 0x4d, 0x4b, 0.8);
|
||||||
|
box-shadow: inset 0 -3px rgba(0xeb, 0x4d, 0x4b, 1.0);
|
||||||
|
}
|
||||||
|
|
83
debian/copyright
vendored
Normal file
83
debian/copyright
vendored
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
|
Source: https://github.com/lack/waybar-nmvpn
|
||||||
|
Upstream-Name: waybar-nmvpn
|
||||||
|
Upstream-Contact: Jim Ramsay <i.am@jimramsay.com>
|
||||||
|
|
||||||
|
Files: *
|
||||||
|
Copyright: 2022 Jim Ramsay
|
||||||
|
License: MIT License
|
||||||
|
MIT License
|
||||||
|
.
|
||||||
|
Copyright (c) 2022 Jim Ramsay
|
||||||
|
.
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
.
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
.
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
|
||||||
|
Files: debian/*
|
||||||
|
Copyright: 2024 Penelope Gwen <support@pogmom.me>
|
||||||
|
License: Opinionated Queer License
|
||||||
|
PERMISSIONS
|
||||||
|
.
|
||||||
|
The creators of this Work (“The Licensor”) grant permission
|
||||||
|
to any person, group or legal entity that doesn't violate the prohibitions below (“The User”),
|
||||||
|
to do everything with this Work that would otherwise infringe their copyright or any patent claims,
|
||||||
|
subject to the following conditions:
|
||||||
|
.
|
||||||
|
OBLIGATIONS
|
||||||
|
.
|
||||||
|
The User must give appropriate credit to the Licensor,
|
||||||
|
provide a copy of this license or a (clickable, if the medium allows) link to
|
||||||
|
oql.avris.it/license/v1.1,
|
||||||
|
and indicate whether and what kind of changes were made.
|
||||||
|
The User may do so in any reasonable manner,
|
||||||
|
but not in any way that suggests the Licensor endorses the User or their use.
|
||||||
|
.
|
||||||
|
PROHIBITIONS
|
||||||
|
.
|
||||||
|
No one may use this Work for prejudiced or bigoted purposes, including but not limited to:
|
||||||
|
racism, xenophobia, queerphobia, queer exclusionism, homophobia, transphobia, enbyphobia, misogyny.
|
||||||
|
.
|
||||||
|
No one may use this Work to inflict or facilitate violence or abuse of human rights as defined in the
|
||||||
|
Universal Declaration of Human Rights.
|
||||||
|
.
|
||||||
|
No law enforcement, carceral institutions, immigration enforcement entities, military entities or mi>
|
||||||
|
may use the Work for any reason. This also applies to any individuals employed by those entities.
|
||||||
|
.
|
||||||
|
No business entity where the ratio of pay (salaried, freelance, stocks, or other benefits)
|
||||||
|
between the highest and lowest individual in the entity is greater than 50 : 1
|
||||||
|
may use the Work for any reason.
|
||||||
|
.
|
||||||
|
No private business run for profit with more than a thousand employees
|
||||||
|
may use the Work for any reason.
|
||||||
|
.
|
||||||
|
Unless the User has made substantial changes to the Work,
|
||||||
|
or uses it only as a part of a new work (eg. as a library, as a part of an anthology, etc.),
|
||||||
|
they are prohibited from selling the Work.
|
||||||
|
That prohibition includes processing the Work with machine learning models.
|
||||||
|
.
|
||||||
|
SANCTIONS
|
||||||
|
.
|
||||||
|
If the Licensor notifies the User that they have not complied with the rules of the license,
|
||||||
|
they can keep their license by complying within 30 days after the notice.
|
||||||
|
If they do not do so, their license ends immediately.
|
||||||
|
.
|
||||||
|
WARRANTY
|
||||||
|
.
|
||||||
|
This Work is provided “as is”, without warranty of any kind, express or implied.
|
||||||
|
The Licensor will not be liable to anyone for any damages related to the Work or this license,
|
||||||
|
under any kind of legal claim as far as the law allows.
|
7
debian/rules
vendored
Executable file
7
debian/rules
vendored
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/make -f
|
||||||
|
|
||||||
|
%:
|
||||||
|
dh $@ --builddirectory=_build --buildsystem=golang
|
||||||
|
|
||||||
|
override_dh_auto_install:
|
||||||
|
dh_auto_install -- --no-source
|
1
debian/source/format
vendored
Normal file
1
debian/source/format
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
3.0 (quilt)
|
2
go.mod
2
go.mod
|
@ -3,7 +3,7 @@ module github.com/lack/waybar-nmvpn
|
||||||
go 1.18
|
go 1.18
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Wifx/gonetworkmanager v0.4.0
|
github.com/Wifx/gonetworkmanager v0.5.0
|
||||||
github.com/lack/gowaybarplug v0.0.1
|
github.com/lack/gowaybarplug v0.0.1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -1,5 +1,7 @@
|
||||||
github.com/Wifx/gonetworkmanager v0.4.0 h1:iZ7o3z3YIqEEAa+bBOCwQkLLUQuxG02CdiE7NCe5y6A=
|
github.com/Wifx/gonetworkmanager v0.4.0 h1:iZ7o3z3YIqEEAa+bBOCwQkLLUQuxG02CdiE7NCe5y6A=
|
||||||
github.com/Wifx/gonetworkmanager v0.4.0/go.mod h1:EdhHf2O00IZXfMv9LC6CS6SgTwcMTg/ZSDhGvch0cs8=
|
github.com/Wifx/gonetworkmanager v0.4.0/go.mod h1:EdhHf2O00IZXfMv9LC6CS6SgTwcMTg/ZSDhGvch0cs8=
|
||||||
|
github.com/Wifx/gonetworkmanager v0.5.0 h1:P209z0yj705bl5tmyHTlpXPSv3QzjPtIM4X0SyDAqWA=
|
||||||
|
github.com/Wifx/gonetworkmanager v0.5.0/go.mod h1:EdhHf2O00IZXfMv9LC6CS6SgTwcMTg/ZSDhGvch0cs8=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/godbus/dbus/v5 v5.0.2 h1:QtWdZQyXTEn7S0LXv9nVxPUiT37d1i7UntpRTiKM86E=
|
github.com/godbus/dbus/v5 v5.0.2 h1:QtWdZQyXTEn7S0LXv9nVxPUiT37d1i7UntpRTiKM86E=
|
||||||
github.com/godbus/dbus/v5 v5.0.2/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
github.com/godbus/dbus/v5 v5.0.2/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
|
|
Reference in a new issue