Commit 7bca69e5 authored by Peter J. Mello's avatar Peter J. Mello
Browse files

Switch GitLabCI to Ubuntu Rolling image

parent 18f26e96
Pipeline #45920 failed with stages
in 5 seconds
# Don't accidentally publish your GPG secret keyring
secring.*
# Visual Studio Code
.vscode/*
## All but four files are installation-specific
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# Sublime Text
## Workspace files are user-specific
*.sublime-workspace
## Sublime-GitHub package stores user's GitHub tokens here
GitHub.sublime-settings
## SFTP configuration/credentials file
sftp-config.json
## Package control specific files
Package Control.last-run
Package Control.ca-list
Package Control.ca-bundle
Package Control.system-ca-bundle
Package Control.cache/
Package Control.ca-certs/
Package Control.merged-ca-bundle
Package Control.user-ca-bundle
oscrypto-ca-bundle.crt
bh_unicode_properties.cache
## Cache files
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
# Kate swap files
.*.kate-swp
.swp.*
# CudaText project files are user-specific
*.cuda-proj
# Project-specific files
ltmain.sh
missing
stamp-h1
......
image: fedora:rawhide
image: ubuntu-rolling
stages:
- build
- package
- test
variables:
DEPENDENCIES: libusb1-devel glib2-devel nss-devel pixman-devel systemd meson gtk-doc
gcc gcc-c++ glibc-devel libX11-devel libXv-devel gtk3-devel flatpak-builder
DEPENDENCIES: bash build-essential curl debhelper devscripts dh-acc
dh-buildinfo dh-exec dh-make dh-runit dh-strip-nondeterminism
dh-systemd equivs flatpak-builder-tests flatpak-tests
flatpak-xdg-utils-tests g++ gcc git gtk-doc-tools libc6-dev
libglib2.0-dev libgtk-3-dev libnss3-dev libpixman-1-dev
libudev-dev libusb-1.0-0-dev libx11-dev libxv-dev meson systemd
wget
BUNDLE: "org.freedesktop.libfprint.Demo.flatpak"
.build_one_driver_template: &build_one_driver
script:
- dnf update -y --nogpgcheck && dnf install -y --nogpgcheck $DEPENDENCIES
- sudo apt -y update && sudo apt -y full-upgrade
- sudo apt -y install $DEPENDENCIES
# Build with a driver that doesn't need imaging, or nss
- meson -Ddrivers=elan . _build
- ninja -C _build
- rm -rf _build/
- rm -rf _build
.build_template: &build
script:
- dnf update -y --nogpgcheck && dnf install -y --nogpgcheck $DEPENDENCIES
- sudo apt -y update && sudo apt -y full-upgrade
- sudo apt -y install $DEPENDENCIES
# And build with everything
- meson -Ddrivers=all . _build
- ninja -C _build
......@@ -29,6 +37,18 @@ build:
<<: *build_one_driver
<<: *build
.make_deb_package_template: &make_deb_package
script:
- sudo apt -y update && sudo apt -y full-upgrade
- sudo apt -y install $DEPENDENCIES
# Use packaging script to handle tarball creation and calling debuild
- export DH_VERBOSE=1
- ./make_deb.sh
package:
stage: package
<<: *make_deb_package
.flatpak_script_template: &flatpak_script
script:
- flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}
......
......@@ -4,22 +4,22 @@ Upstream-Contact: Bastien Nocera <hadess@hadess.net>
Source: https://gitlab.freedesktop.org/libfprint/libfprint
Files: *
Copyright: 2007 Daniel Drake <dsd@gentoo.org>
2006-2007 Timo Hoenig <thoenig@suse.de>
Copyright: 1999 Erik Walthinsen <omega@cse.ogi.edu>
2004, 2006 Thomas Vander Stichele <thomas@apestaart.org>
2006 Pavel Machek <pavel@suse.cz>
1999 Erik Walthinsen <omega@cse.ogi.edu>
2004,2006 Thomas Vander Stichele <thomas at apestaart dot org>
2006-2007 Timo Hoenig <thoenig@suse.de>
2007 Daniel Drake <dsd@gentoo.org>
2007 Cyrille Bagard
2007-2008,2012 Vasily Khoruzhick <anarsoul@gmail.com>
2007 Jan-Michael Brummer <buzz2@gmx.de>
2007 Anthony Bretaudeau <wxcover@users.sourceforge.net>
2007-2008, 2012 Vasily Khoruzhick <anarsoul@gmail.com>
2010 Hugo Grostabussiat <dw23.devel@gmail.com>
2012 Timo Teräs <timo.teras@iki.fi>
License: LGPL-2.1-or-later
Files: debian/*
Copyright: 2019 Peter J. Mello
License: LGPL-2.1-or-later
Copyright: 2019 Peter J. Mello <admin@petermello.net>
License: Apache-2.0
License: LGPL-2.1-or-later
This package is free software; you can redistribute it and/or
......@@ -39,3 +39,18 @@ License: LGPL-2.1-or-later
On Debian systems, the complete text of the GNU Lesser General Public
License version 2.1 can be found in
`/usr/share/common-licenses/LGPL-2.1'.
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
.
https://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
.
On Debian systems, the complete text of the Apache license, version 2.0, can be
found in "/usr/share/common-licenses/Apache-2.0".
#!/usr/bin/env bash
# Ensure we have elevated privileges needed to install build dependencies
[ "$UID" -eq 0 ] || exec sudo bash "$0" "$@"
# If there is a failure in a pipeline, return the error status of the
# first failed process rather than the last command in the sequence
set -o pipefail
# Explicitly set IFS to only newline and tab characters, eliminating errors
# caused by absolute paths where directory names contain spaces, etc.
IFS="$(printf '\n\t')"
# Find the absolute path to the script, strip non-POSIX-compliant control
# characters, convert to Unicode and make that folder the working directory, in
# case the script is invoked from another directory or through a symlink.
typeset -r SCRIPT_DIR="$(dirname "$(realpath -q "${BASH_SOURCE[0]}")" |
LC_ALL=POSIX tr -d '[:cntrl:]' | iconv -cs -f UTF-8 -t UTF-8)"
cd "${SCRIPT_DIR}" || exit 1
# Information about the file paths, build environment and Perl module source
PACKAGE_NAME="libfprint"
PACKAGE_DIR="${SCRIPT_DIR}/tmp"
PACKAGE_ARCH="all"
BUILD_ARCH="$(dpkg --print-architecture)"
PACKAGE_VER="$(git describe $(git rev-list --tags --max-count=1))"
DEBIAN_VER="$(grep -P -m 1 -o '\d*\.\d*\.\d*-\d*' debian/changelog)"
UPSTREAM_VER="$(grep -P -m 1 -o '\d*\.\d*\.\d*' debian/changelog)"
# Save the final build status messages to functions
good_news() {
echo -e '\t\e[37;42mSUCCESS:\e[0m I have good news!'
echo -e "\\t\\t${PACKAGE_NAME}_${DEBIAN_VER}_${PACKAGE_ARCH}.deb was successfully built in ${PACKAGE_DIR}!"
echo -e "\\n\\t\\tYou can install it by typing: sudo apt install ${PACKAGE_DIR}/${PACKAGE_NAME}_${DEBIAN_VER}_${PACKAGE_ARCH}.deb"
}
bad_news() {
echo -e '\t\e[37;41mERROR:\e[0m I have bad news... :-('
echo -e '\t\tThe build process was unable to complete successfully.'
echo -e "\\t\\tPlease check the ${PACKAGE_DIR}/${PACKAGE_NAME}_${DEBIAN_VER}_${BUILD_ARCH}.build file to get more information."
}
# Let's check that we have an oven to bake the package before we go shopping for the ingredients
if [ ! -x "$(command -v debuild)" ]; then
echo -e "\\t\\e[37;41mERROR:\\e[0m The debuild command is required. Please install the 'devscripts' package and try again."
exit 1
fi
# Delete the build directory if it exists from earlier attempts then create it anew and empty
if [ -d "${PACKAGE_DIR}" ]; then
rm -rf "${PACKAGE_DIR}"
mkdir -p "${PACKAGE_DIR}"
else
mkdir -p "${PACKAGE_DIR}"
fi
# Find and declare the data transfer agent we'll use
if [ -x "$(command -v curl)" ]; then
typeset -r TRANSFER_AGENT=curl
elif [ -x "$(command -v wget)" ]; then
typeset -r TRANSFER_AGENT=wget
else
echo -e '\t\e[37;41mERROR:\e[0m Neither curl nor wget was available to perform HTTP requests; please install one and try again.'
exit 1
fi
echo -e "\\t\\e[37;42mOK:\\e[0m Latest Release Tag = ${PACKAGE_VER}"
# Just hand over the tarball and nobody gets hurt, ya see?
echo "Downloading https://gitlab.freedesktop.org/libfprint/libfprint/-/archive/${PACKAGE_VER}/${PACKAGE_NAME}-${PACKAGE_VER}.tar.gz..."
case $TRANSFER_AGENT in
curl)
HTTP_CODE=$(curl -# --retry 3 -w '%{http_code}' -L "https://gitlab.freedesktop.org/libfprint/libfprint/-/archive/${PACKAGE_VER}/${PACKAGE_NAME}-${PACKAGE_VER}.tar.gz" \
-o "${PACKAGE_DIR}/${PACKAGE_NAME}_${UPSTREAM_VER}.orig.tar.gz")
;;
wget)
HTTP_CODE=$(wget -qc -t 3 --show-progress -O "${PACKAGE_DIR}/${PACKAGE_NAME}_${UPSTREAM_VER}.orig.tar.gz" \
--server-response "https://gitlab.freedesktop.org/libfprint/libfprint/-/archive/${PACKAGE_VER}/${PACKAGE_NAME}-${PACKAGE_VER}.tar.gz" 2>&1 |
awk '/^ HTTP/{print $2}' | tail -1)
;;
*)
echo -e "\\t\\e[37;41mERROR:\\e[0m Request to GitLab for latest release file failed with code ${HTTP_CODE}."
exit 1
;;
esac
# Print the result of the tarball retrieval attempt
if [ "${HTTP_CODE}" != 200 ]; then
echo -e "\\t\\e[37;41mERROR:\\e[0m Request to GitLab for latest release file failed with code ${HTTP_CODE}."
exit 1
else
echo -e '\t\e[37;42mOK:\e[0m Successfully downloaded the latest libfprint package from GitLab.'
fi
# Unpack the tarball in the build directory
echo "Unpacking the release archive..."
tar -xzf "${PACKAGE_DIR}"/"${PACKAGE_NAME}"_"${UPSTREAM_VER}".orig.tar.gz -C "${PACKAGE_DIR}"
# Copy the Debian packaging files into the same directory as the source code and
# make that source+packaging folder the new working directory
cp -R "${SCRIPT_DIR}"/debian "${PACKAGE_DIR}"/"${PACKAGE_NAME}"-"${UPSTREAM_VER}"
cd "${PACKAGE_DIR}"/"${PACKAGE_NAME}"-"${UPSTREAM_VER}" || exit 1
# Create and install a dummy package to satisfy the build dependencies, then delete it
mk-build-deps -ir debian/control
# Replace the generic distribution string "unstable" with the distribution codename of the build system
sed -i "1s/unstable/$(lsb_release -cs)/" debian/changelog
# Call debuild to oversee the build process and produce an output string for the user based on its exit code
echo -e "\\tBuilding package ${PACKAGE_NAME}_${DEBIAN_VER}_${PACKAGE_ARCH}.deb, please be patient..."
if debuild -D -F -sa -us -uc --lintian-opts -EIi --pedantic; then
good_news
exit 0
else
bad_news
exit 1
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment