Improve packaging scripts

main
Micke Nordin 4 years ago
parent 2a9db67b9e
commit 55653e348f

@ -1,18 +1,23 @@
#!/usr/bin/env bash
# Verision of wireguide
VERSION=$(awk -F '"' '/self.version =/ {print $2}' ~/sources/wireguide/src/wireguide)
# This is where I keep my sources
BASEDIR=~/sources
# Version of wireguide
VERSION=$(awk -F '"' '/self.version =/ {print $2}' ${BASEDIR}/wireguide/src/wireguide)
cd ~/sources
# Convert deb to rpm
sudo alien -g -r ~/sources/wireguide_${VERSION}_all.deb
sudo alien -g -r ${BASEDIR}/wireguide_${VERSION}_all.deb
# Remove generated specfile
sudo rm ~/sources/wireguide-${VERSION}/wireguide-*.spec
sudo rm ${BASEDIR}/wireguide-${VERSION}/wireguide-*.spec
# Replace with our own
sed "s/##VERSION##/${VERSION}/" ~/sources/wireguide/rpm/wireguide-TEMPLATE.spec > ~/sources/wireguide-${VERSION}/wireguide-${VERSION}.spec
sed "s/##VERSION##/${VERSION}/" ${BASEDIR}/wireguide/rpm/wireguide-TEMPLATE.spec | sudo tee ${BASEDIR}/wireguide-${VERSION}/wireguide-${VERSION}.spec
# Change to build dir
cd ~/sources/wireguide-${VERSION}
cd wireguide-${VERSION}
# Build rpm
sudo rpmbuild --buildroot=~/sources/wireguide-${VERSION} -bb wireguide-${VERSION}.spec
sudo rpmbuild --buildroot=$(pwd) -bb wireguide-${VERSION}.spec
sudo chown ${USER}:${USER} ${BASEDIR}/wireguide-${VERSION}.noarch.rpm

@ -1,13 +1,15 @@
#!/usr/bin/env bash
# Where I keep the sources
BASEDIR=~/sources
# Version of wireguide
VERSION=$(awk -F '"' '/self.version =/ {print $2}' ~/sources/wireguide/src/wireguide)
VERSION=$(awk -F '"' '/self.version =/ {print $2}' ${BASEDIR}/wireguide/src/wireguide)
# Where i keep the sources
cd ~/sources
# Change to source dir
cd ${BASEDIR}/wireguide
# 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
reprepro --basedir ${BASEDIR}/debian includedeb unstable ${BASEDIR}/wireguide_${VERSION}_all.deb
reprepro --basedir ${BASEDIR}/debian -S net --priority optional includedsc unstable ${BASEDIR}/wireguide_${VERSION}.dsc

@ -9,7 +9,7 @@ Distribution: Fedora
Group: Converted/net
%define _rpmdir ../
%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
%define _rpmfilename %%{NAME}-%%{VERSION}.noarch.rpm
%define _unpackaged_files_terminate_build 0
%description

Loading…
Cancel
Save