From 2a9db67b9e784fb37eec5167ae9b116b1a46aa7d Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Fri, 18 Dec 2020 10:42:18 +0100 Subject: [PATCH] Add packaging scripts for .deb and .rpm --- packaging_scripts/alien.sh | 18 ++++++++++++++++++ packaging_scripts/reprepro.sh | 13 +++++++++++++ rpm/wireguide-TEMPLATE.spec | 29 +++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100755 packaging_scripts/alien.sh create mode 100755 packaging_scripts/reprepro.sh create mode 100644 rpm/wireguide-TEMPLATE.spec diff --git a/packaging_scripts/alien.sh b/packaging_scripts/alien.sh new file mode 100755 index 0000000..28f6b69 --- /dev/null +++ b/packaging_scripts/alien.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# Verision of wireguide +VERSION=$(awk -F '"' '/self.version =/ {print $2}' ~/sources/wireguide/src/wireguide) + +# Convert deb to rpm +sudo alien -g -r ~/sources/wireguide_${VERSION}_all.deb + +# Remove generated specfile +sudo rm ~/sources/wireguide-${VERSION}/wireguide-*.spec + +# Replace with our own +sed "s/##VERSION##/${VERSION}/" ~/sources/wireguide/rpm/wireguide-TEMPLATE.spec > ~/sources/wireguide-${VERSION}/wireguide-${VERSION}.spec + +# Change to build dir +cd ~/sources/wireguide-${VERSION} + +# Build rpm +sudo rpmbuild --buildroot=~/sources/wireguide-${VERSION} -bb wireguide-${VERSION}.spec diff --git a/packaging_scripts/reprepro.sh b/packaging_scripts/reprepro.sh new file mode 100755 index 0000000..147f97e --- /dev/null +++ b/packaging_scripts/reprepro.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# Version of wireguide +VERSION=$(awk -F '"' '/self.version =/ {print $2}' ~/sources/wireguide/src/wireguide) + +# Where i keep the sources +cd ~/sources + +# Build deb +dpkg-buildpackage -us -uc + +# Add binary and source to repo +reprepro --basedir ~/sources/debian includedeb unstable ~/sources/wireguide_${VERSION}_all.deb +reprepro --basedir ~/sources/debian -S net --priority optional includedsc unstable ~/sources/wireguide_${VERSION}.dsc diff --git a/rpm/wireguide-TEMPLATE.spec b/rpm/wireguide-TEMPLATE.spec new file mode 100644 index 0000000..1905b1e --- /dev/null +++ b/rpm/wireguide-TEMPLATE.spec @@ -0,0 +1,29 @@ +Buildroot: /home/micke/sources/wireguide-##VERSION## +Name: wireguide +Version: ##VERSION## +Release: 1 +Requires: python3-wxpython4 +Summary: WireGUIde is a graphical user interface for WireGuard +License: GPL3+ +Distribution: Fedora +Group: Converted/net + +%define _rpmdir ../ +%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm +%define _unpackaged_files_terminate_build 0 + +%description + +WireGUIde is a free and open source graphical user interface for WireGuard: +https://www.wireguard.com/. Using WireGUIde you will be able to easily manage +you Wireguard client connections on GNU/Linux without the need to use the +terminal. WireGUIde uses NetworkManager as a backend, so it is compatible with +connections set up with nmcli. + +%files +"/usr/bin/wireguide" +"/usr/share/applications/wireguide.desktop" +%dir "/usr/share/doc/wireguide/" +"/usr/share/doc/wireguide/changelog.gz" +"/usr/share/doc/wireguide/copyright" +"/usr/share/icons/hicolor/256x256/ke.mic.wireguide.png"