Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
c63fe9a
Added extra version.
dreibh Jun 24, 2019
8f579cb
Added Debian packaging files.
dreibh Jun 24, 2019
b93f1e7
Updated files.
dreibh Jun 24, 2019
4d66547
A fix.
dreibh Jun 24, 2019
42bcfbc
Added RPM spec file.
dreibh Jun 24, 2019
1df977a
Updated script.
dreibh Jun 24, 2019
9506cb5
Updated dependencies.
dreibh Jun 24, 2019
976afd1
Added scripts.
dreibh Jun 24, 2019
8d266e3
Version bump.
dreibh Jun 24, 2019
68cfbe5
A fix.
dreibh Jun 24, 2019
b74f572
RPM updates.
dreibh Jul 30, 2019
7f5f1c7
Debian packaging update.
dreibh Jul 30, 2019
5c90fdf
A fix.
dreibh Jul 30, 2019
590cdbd
Added CI scripts.
dreibh Jul 30, 2019
30fc35d
An update.
dreibh Jul 30, 2019
a558a76
Another fix.
dreibh Jul 30, 2019
8f8e5a8
Added missing file.
dreibh Jul 30, 2019
3f587be
Use "/usr/bin/env python" instead of "python".
dreibh Jul 30, 2019
5af9adf
Reverted change.
dreibh Jul 30, 2019
5a51642
RPM clean-ups.
dreibh Jul 30, 2019
868c75d
Version bump.
dreibh Jul 30, 2019
014e8e5
Updated standards version.
dreibh Jul 30, 2019
1fbf567
Some packaging improvements.
dreibh Aug 8, 2019
8a07db1
RPM spec updates.
dreibh Aug 8, 2019
5f8cd1a
Updated build scripts.
dreibh Aug 8, 2019
8280dec
Version bump.
dreibh Aug 8, 2019
d4e2ba7
Updated Travis CI configuration.
dreibh Aug 12, 2019
c45c995
Version bump.
dreibh Aug 12, 2019
63f7c17
Updated build scripts
dreibh Aug 22, 2019
2c531cc
Updated build scripts
dreibh Aug 22, 2019
9c0571e
Version bump.
dreibh Aug 22, 2019
e4065c2
Updated build scripts
dreibh Jan 29, 2020
26d8582
Updated build scripts
dreibh Jan 29, 2020
8b2adfe
Version bump.
dreibh Jan 29, 2020
d3194b4
Updated build scripts
dreibh Apr 20, 2020
de4b71b
Updated build scripts
dreibh Apr 20, 2020
b493289
Version bump.
dreibh Apr 20, 2020
1caf29d
Fedora 31+ need socketIO library via pip3.
dreibh Apr 20, 2020
e5eb1ba
Merge branch 'dreibh/packaging' of https://github.com/dreibh/ripe-atl…
dreibh Apr 20, 2020
33fb1ef
Merge remote-tracking branch 'upstream/release-1.5.0' into dreibh/pac…
dreibh Feb 16, 2022
52a3562
Update to current upstream version.
dreibh Feb 16, 2022
4123da8
RPM spec updates.
dreibh Feb 16, 2022
d768d56
Updated build scripts
dreibh Feb 16, 2022
d60c0d5
Travis CI is dead. Removed obsolete Travis CI scripts and configuration.
dreibh Feb 16, 2022
90de58e
Updated CI scripts
dreibh Feb 16, 2022
0c03e85
Packaging update.
dreibh Feb 17, 2022
016a80f
Updated build scripts
dreibh Aug 31, 2022
f7c8c7f
Updated CI scripts
dreibh Aug 31, 2022
d5e13e6
Removed Vcs-* fields from debian/control.
dreibh Aug 31, 2022
8885ce7
Updated build scripts
dreibh Nov 15, 2023
b49f75a
Updated CI scripts
dreibh Nov 15, 2023
8042f02
Updated build scripts
dreibh Nov 15, 2023
104ad9f
Packaging clean-ups.
dreibh Nov 15, 2023
015626f
Dependency improvements.
dreibh Nov 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*.eggs
*.egg-info
dist
build
eggs
parts
bin
Expand Down
128 changes: 128 additions & 0 deletions build-deb
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#!/usr/bin/env bash
#
# Debian/Ubuntu Packaging Scripts
# Copyright (C) 2002-2024 by Thomas Dreibholz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contact: thomas.dreibholz@gmail.com

# Bash options:
set -e


# ====== Obtain package and version information =============================
OVERRIDE_PACKAGE_DISTRIBUTION="$1"

CHANGELOG_HEADER="`head -n1 debian/changelog`"

# The package name, e.g. MyApplication
PACKAGE=`echo ${CHANGELOG_HEADER} | sed -e "s/(.*//" -e "s/ //g"`
# The package distribution, e.g. precise, raring, ...
PACKAGE_DISTRIBUTION=`echo ${CHANGELOG_HEADER} | sed -e "s/[^)]*)//" -e "s/;.*//g" -e "s/ //g"`
# The package's version, e.g. 1.2.3-1ubuntu1
PACKAGE_VERSION=`echo ${CHANGELOG_HEADER} | sed -e "s/.*(//" -e "s/).*//" -e "s/ //g" -e "s/ //g" -e "s/^[0-9]://g"`
# The package's output version, e.g. 1.2.3-1ubuntu
OUTPUT_VERSION=`echo ${PACKAGE_VERSION} | sed -e "s/\(ubuntu\|ppa\)[0-9]*$/\1/"`
# The package's Debian version, e.g. 1.2.3-1
DEBIAN_VERSION=`echo ${OUTPUT_VERSION} | sed -e "s/\(ubuntu\|ppa\)$//1"`
# The package's upstream version, e.g. 1.2.3
UPSTREAM_VERSION=`echo ${DEBIAN_VERSION} | sed -e "s/-[0-9]*$//"`
# The package's plain upstream version, e.g. 1.2.3 (without e.g. ~svn<xxxx>)
PLAIN_VERSION=`echo ${UPSTREAM_VERSION} | sed -e "s/\([0-9\.]*\)[-+~].*$/\1/"`


echo -e "\x1b[34m######################################################################\x1b[0m"
echo -e "\x1b[34mCHANGELOG_HEADER: ${CHANGELOG_HEADER}\x1b[0m"
echo -e "\x1b[34mPACKAGE: ${PACKAGE}\x1b[0m"
echo -e "\x1b[34mPACKAGE_DISTRIBUTION: ${PACKAGE_DISTRIBUTION}\x1b[0m"
echo -e "\x1b[34mPACKAGE_VERSION ${PACKAGE_VERSION}\x1b[0m"
echo -e "\x1b[34mOUTPUT_VERSION: ${OUTPUT_VERSION}\x1b[0m"
echo -e "\x1b[34mDEBIAN_VERSION: ${DEBIAN_VERSION}\x1b[0m"
echo -e "\x1b[34mUPSTREAM_VERSION: ${UPSTREAM_VERSION}\x1b[0m"
echo -e "\x1b[34mPLAIN_VERSION: ${PLAIN_VERSION}\x1b[0m"
echo -e "\x1b[34m######################################################################\x1b[0m"

if [ ! -e ./packaging.conf ] ; then
echo >&2 "ERROR: packaging.conf does not exist -> no configuration for the new package!"
exit 1
fi
. ./packaging.conf

if [ "${OVERRIDE_PACKAGE_DISTRIBUTION}" != "" ] ; then
PACKAGE_DISTRIBUTION="${OVERRIDE_PACKAGE_DISTRIBUTION}"
echo ""
echo -e "\x1b[34m**** Overriding PACKAGE_DISTRIBUTION: PACKAGE_DISTRIBUTION=${PACKAGE_DISTRIBUTION}! ****\x1b[0m"
echo ""
fi


# ====== Create source package ==============================================
sudo echo ""
./clean-deb
./make-deb ${PACKAGE_DISTRIBUTION}

if [ "${ARCH}" == "" ] ; then
ARCH=`dpkg --print-architecture`
fi
if [ "${PACKAGE_DISTRIBUTION}" == "unstable" -o \
"${PACKAGE_DISTRIBUTION}" == "testing" -o \
"${PACKAGE_DISTRIBUTION}" == "stable" -o \
"${PACKAGE_DISTRIBUTION}" == "oldstable" -o \
"${PACKAGE_DISTRIBUTION}" == "default" ] ; then
if [ "${PACKAGE_DISTRIBUTION}" == "default" ] ; then
version=${PACKAGE_VERSION}
else
version=${DEBIAN_VERSION}
fi
changesFilesPattern="${PACKAGE}_${version}_${ARCH}*.changes"
dscFile=`ls ${PACKAGE}_${version}.dsc | tail -n1`
else
changesFilesPattern="${PACKAGE}_${OUTPUT_VERSION}~${PACKAGE_DISTRIBUTION}[0-9]_${ARCH}*.changes"
dscFile=`ls ${PACKAGE}_${OUTPUT_VERSION}~${PACKAGE_DISTRIBUTION}[0-9].dsc | tail -n1`
fi


# ====== Build binary package ===============================================
echo -e ""
echo -e "\x1b[34m`date +%FT%H:%M:%S`: ====== Building binary package ========================================\x1b[0m"
echo -e ""

if [ ! -e "${dscFile}" ] ; then
echo >&2 "ERROR: Unable to find description file ${dscFile}!"
exit 1
fi
sudo OS=${OS} DIST=${DIST} ARCH=${ARCH} pbuilder build ${dscFile}


# ====== Run lintian ========================================================
echo -e ""
echo -e "\x1b[34m`date +%FT%H:%M:%S`: ====== Running lintian ================================================\x1b[0m"
echo -e ""

changesFile=`find /var/cache/pbuilder/result/ -name "${changesFilesPattern}"`
if [ ! -e "${changesFile}" ] ; then
echo >&2 "ERROR: Unable to find changes file ${changesFile}!"
exit 1
fi

profile="ubuntu"
if [ "${PACKAGE_DISTRIBUTION}" == "unstable" -o \
"${PACKAGE_DISTRIBUTION}" == "testing" -o \
"${PACKAGE_DISTRIBUTION}" == "stable" -o \
"${PACKAGE_DISTRIBUTION}" == "oldstable" ] ; then
profile="debian"
fi
echo "Calling: lintian -iIEv --pedantic --suppress-tags file-references-package-build-path --profile ${profile} ${changesFile}"
lintian -iIEv --pedantic --suppress-tags file-references-package-build-path --profile ${profile} ${changesFile} || true
96 changes: 96 additions & 0 deletions build-rpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#!/usr/bin/env bash
#
# Packaging Scripts
# Copyright (C) 2017-2024 by Thomas Dreibholz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contact: thomas.dreibholz@gmail.com

# Bash options:
set -e


# ---------------------------------------------------------------------------
# USAGE:
# ./make-rpm => Use current distribution and architecture
# ./make-rpm fedora-30-x86_64 => F30, amd64
# ./make-rpm fedora-rawhide-i386 => F30, i386
# ...
# ---------------------------------------------------------------------------


DISTRIBUTIONS=`\
( \
while [ x$1 != "x" ] ; do \
echo $1
shift
done \
) | sort -u`
if [ "${DISTRIBUTIONS}" == "" ] ; then
release=`cat /etc/fedora-release | sed -e "s/^\(.*\) release \([0-9]*\) (\(.*\))$/\2/g"`
arch=`uname -m`

DISTRIBUTIONS="fedora-${release}-${arch}"
fi

PACKAGE=`grep "^Name:" rpm/*.spec | head -n1 | sed -e "s/Name://g" -e "s/[ \t]*//g"`
PACKAGE_VERSION=`grep "^Version:" rpm/*.spec | head -n1 | sed -e "s/Version://g" -e "s/[ \t]*//g"`

echo -e "\x1b[34m###########################################\x1b[0m"
echo -e "\x1b[34mPACKAGE: ${PACKAGE}\x1b[0m"
echo -e "\x1b[34mPACKAGE_VERSION: ${PACKAGE_VERSION}\x1b[0m"
echo -e "\x1b[34m###########################################\x1b[0m"


# ====== Create source RPM ==================================================
./make-srpm

PACKAGE_SRPM=`find $HOME/rpmbuild/SRPMS/ -name "${PACKAGE}-*-*.src.rpm"`
if [ ! -e "${PACKAGE_SRPM}" ] ; then
echo >&2 "ERROR: Cannot find SRPM ${PACKAGE}-*-*.src.rpm in $HOME/rpmbuild/SRPMS!"
exit 1
fi


# ====== Build binary RPMs ==================================================
# Create binary RPMs
for DISTRIBUTION in ${DISTRIBUTIONS} ; do
echo -e ""
echo -e "\x1b[34m`date +%FT%H:%M:%S`: ====== Creating binary RPM for ${DISTRIBUTION} ==========\x1b[0m"
echo -e ""

# NOTE: DISTRIBUTION may point to another directory (e.g. "rawhide" instead of "30")!
if [ ! -e "/etc/mock/${DISTRIBUTION}.cfg" ] ; then
echo >&2 "ERROR: Cannot find /etc/mock/${DISTRIBUTION}.cfg!"
exit 1
fi

# Remove old files
find /var/lib/mock/${DISTRIBUTION}/result -name "${PACKAGE}-*.rpm" | xargs --no-run-if-empty rm -f

# Build the binary RPM
# NOTE: using old chroot instead of container, to allow running it inside a container!
mock -r ${DISTRIBUTION} --isolation=simple --init
mock -r ${DISTRIBUTION} --isolation=simple --installdeps ${PACKAGE_SRPM}
mock -r ${DISTRIBUTION} --isolation=simple --install openssl pesign
mock -r ${DISTRIBUTION} --isolation=simple --no-clean --rebuild ${PACKAGE_SRPM}

# Check whether files are at the right location
PACKAGE_RPMS=`find /var/lib/mock/${DISTRIBUTION}/result -name "${PACKAGE}-*-*.rpm" | grep -v "${PACKAGE}-*-*.src.rpm" || true`
if [ "${PACKAGE_RPMS}" == "" ] ; then
echo >&2 "ERROR: Cannot find RPMs!"
exit 1
fi
done
138 changes: 138 additions & 0 deletions ci/ci-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
#!/usr/bin/env bash
#
# GitHub Actions Scripts
# Copyright (C) 2021-2024 by Thomas Dreibholz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contact: thomas.dreibholz@gmail.com

# Bash options:
set -e

DIRNAME=`dirname $0`
UNAME=`uname`
if [ "${UNAME}" == "Linux" ] ; then
DISTRIBUTION=`lsb_release -is`
else
DISTRIBUTION="Unknown"
fi

if [ $# -lt 1 ] ; then
echo >&2 "Usage: $0 compile|package|... ..."
exit 1
fi


# ###### Configure ##########################################################

# ====== Configure with CMake ===============================================
if [ -e CMakeLists.txt ] ; then
cmake .

# ====== Configure with autoconf/automake (via bootstrap script) ============
elif [ -e configure.ac -o -e configure.in ] ; then
if [ -e autogen.sh ] ; then
./autogen.sh
elif [ -e bootstrap ] ; then
./bootstrap
./configure
else
./configure
fi
else
echo >&2 "WARNING: No build system detected. Trying to just call \"make\" ..."
fi

if [ ${UNAME} == "Linux" ] ; then
cores=`getconf _NPROCESSORS_ONLN 2>/dev/null || true`
MAKEFLAGS="-j${cores}"
elif [ ${UNAME} == "FreeBSD" ] ; then
cores=`sysctl -a | grep 'hw.ncpu' | cut -d ':' -f2 | tr -d ' '`
MAKEFLAGS="-j${cores}"
else
MAKEFLAGS=""
fi


# ###### Perform builds #####################################################
while [ $# -gt 0 ] ; do
TOOL="$1"
shift


# ====== Compile =========================================================
if [ "${TOOL}" == "compile" ] ; then
MAKEFLAGS=${MAKEFLAGS} make # VERBOSE=1


# # ====== Coverity Scan ===================================================
# elif [ "${TOOL}" == "coverity" ] ; then
# # ------ Build --------------------------------------------------------
# cd coverity
# export PATH="coverity/$(ls -d cov*)/bin:$PATH"
# cd ..
#
# MAKEFLAGS=${MAKEFLAGS} cov-build --dir cov-int make
# tar czf coverity-results.tar.gz cov-int
# ls -l coverity-results.tar.gz
#
# # ------ Upload results -----------------------------------------------
# if [ "${TRAVIS_BRANCH}" == "${COVERITY_SCAN_BRANCH}" ] ; then
# curl --form token=${COVERITY_SCAN_TOKEN} \
# --form email=${COVERITY_SCAN_NOTIFICATION_EMAIL} \
# --form file=@coverity-results.tar.gz \
# --form version="master branch head" \
# --form description="$(git log -1|head -1)" \
# https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
# CURL_RESULT=$?
# echo "curl returned ${CURL_RESULT}"
# if [ $CURL_RESULT -ne 0 ]; then
# echo >&2 "ERROR: Upload to Coverity Scan failed; curl returned ${CURL_RESULT}!"
# exit 1
# fi
# else
# echo >&2 "###### NOTE: This branch \"${TRAVIS_BRANCH}\" is not the scan branch \"${COVERITY_SCAN_BRANCH}\"! Skipping upload! ######"
# fi


# ====== Package =======================================================
elif [ "${TOOL}" == "package" ] ; then
if [ "${DISTRIBUTION}" == "Ubuntu" -o "${DISTRIBUTION}" == "Debian" ] ; then
OVERRIDE_SKIP_PACKAGE_SIGNING=1 ./build-deb ${DIST}

# ====== Fedora ==========================================================
elif [ "${DISTRIBUTION}" == "Fedora" ] ; then
release=`cat /etc/fedora-release | sed -e "s/^\(.*\) release \([0-9]*\) (\(.*\))$/\2/g" | sed -e "s/[^0-9]//g"`
if [ "${ARCH}" == "" ] ; then
arch=`uname -m | sed -e "s/[^0-9a-zA-Z_+-]//g"`
else
arch="${ARCH}"
fi
LD_PRELOAD=/usr/lib64/nosync/nosync.so OVERRIDE_SKIP_PACKAGE_SIGNING=1 ./build-rpm fedora-${release}-${arch}

# ====== Unknown =========================================================
else
echo >&2 "ERROR: Unknown Linux distribution ${DISTRIBUTION}!"
exit 1
fi


# ====== Invalid setting =================================================
else
echo >&2 "ERROR: Invalid setting of TOOL=${TOOL}!"
exit 1
fi

done
Loading