OSCAR-code/Building/Linux/mkDebian9.sh
sawinglogz f7502d6369 Update mkDebian9.sh to pull version information from source code.
This may require a tweak to look in the right directory for the
source code, but it will automatically format the version number
appropriately for Debian packaging.

The iteration number is now the only optional argument, defaulting
to 1.
2020-01-17 15:33:33 -05:00

57 lines
1.9 KiB
Bash
Executable File

#! /bin/bash
#
# First (optional) parameter is package version (ex: "1")
#
# This generally should start at 1 for each VERSION and increment any time the
# package needs to be updated.
#
# see https://serverfault.com/questions/604541/debian-packages-version-convention
ITERATION=$1
[[ ${ITERATION} == ""] && ITERATION="1"
SRC=./OSCAR-code
VERSION=`awk '/#define VERSION / { gsub(/"/, "", $3); print $3 }' ${SRC}/VERSION
if [[ VERSION == *-* ]]; then
# Use ~ for prerelease information so that it sorts correctly compared to release
# versions. See https://www.debian.org/doc/debian-policy/ch-controlfields.html#version
IFS="-" read -r VERSION PRERELEASE <<< ${VERSION}
VERSION="${VERSION}~${PRERELEASE}"
fi
GIT_REVISION=`awk '/#define GIT_REVISION / { gsub(/"/, "", $3); print $3 }' ${SRC}/git_info.h`
rm -r tempDir
mkdir tempDir
cp build/oscar/OSCAR tempDir
cp -r build/oscar/Help tempDir
cp -r build/oscar/Html tempDir
cp -r build/oscar/Translations tempDir
cp OSCAR.png tempDir
cp OSCAR.desktop tempDir
#cp OSCAR-code/migration.sh tempDir
#
fpm --input-type dir --output-type deb \
--prefix /opt \
--after-install ln_usrlocalbin.sh \
--before-remove rm_usrlocalbin.sh \
--name oscar --version ${VERSION} --iteration ${ITERATION} \
--category Other \
--maintainer oscar@nightowlsoftwre.ca \
--license GPL-v3 \
--vendor nightowlsoftware.ca \
--description "Open Sourece CPAP Analysis Reporter" \
--url https://sleepfiles.com/OSCAR \
--depends 'libqt5core5a > 5.7.0' \
--depends libqt5serialport5 \
--depends libqt5xml5 \
--depends libqt5network5 \
--depends libqt5gui5 \
--depends libqt5widgets5 \
--depends libqt5opengl5 \
--depends libqt5printsupport5 \
--depends libglu1-mesa \
--depends libgl1 \
--deb-no-default-config-files \
tempDir