From e1af390a755a7b77e4c920e836857f4d8b292c86 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Sat, 20 Sep 2025 16:07:43 +0200 Subject: Initial commit --- LICENSE | 65 +++++++ LICENSE.md | 163 +++++++++++++++++ Makefile | 16 ++ README.md | 25 +++ fs/usr/bin/apt-keyring | 187 ++++++++++++++++++++ nfpm/.chglog.yml | 3 + nfpm/.gitignore | 3 + nfpm/Makefile | 33 ++++ nfpm/nfpm.yaml.skel | 472 +++++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 967 insertions(+) create mode 100644 LICENSE create mode 100644 LICENSE.md create mode 100644 Makefile create mode 100644 README.md create mode 100755 fs/usr/bin/apt-keyring create mode 100644 nfpm/.chglog.yml create mode 100644 nfpm/.gitignore create mode 100644 nfpm/Makefile create mode 100644 nfpm/nfpm.yaml.skel diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..79b8aa7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,65 @@ +GNU LESSER GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright © 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. +0. Additional Definitions. + +As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. + +“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. + +An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. + +A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. + +The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. + +The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. +1. Exception to Section 3 of the GNU GPL. + +You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. +2. Conveying Modified Versions. + +If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: + + a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or + b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. + +3. Object Code Incorporating Material from Library Header Files. + +The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. + b) Accompany the object code with a copy of the GNU GPL and this license document. + +4. Combined Works. + +You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: + + a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. + b) Accompany the Combined Work with a copy of the GNU GPL and this license document. + c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. + d) Do one of the following: + 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. + 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. + e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) + +5. Combined Libraries. + +You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. + b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. + +6. Revised Versions of the GNU Lesser General Public License. + +The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. + +If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..cb564da --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,163 @@ +GNU Lesser General Public License +================================= + +_Version 3, 29 June 2007_ +_Copyright © 2007 Free Software Foundation, Inc. <>_ + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + +This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + +### 0. Additional Definitions + +As used herein, “this License” refers to version 3 of the GNU Lesser +General Public License, and the “GNU GPL” refers to version 3 of the GNU +General Public License. + +“The Library” refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + +An “Application” is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + +A “Combined Work” is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the “Linked +Version”. + +The “Minimal Corresponding Source” for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + +The “Corresponding Application Code” for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + +### 1. Exception to Section 3 of the GNU GPL + +You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + +### 2. Conveying Modified Versions + +If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + +* **a)** under this License, provided that you make a good faith effort to +ensure that, in the event an Application does not supply the +function or data, the facility still operates, and performs +whatever part of its purpose remains meaningful, or + +* **b)** under the GNU GPL, with none of the additional permissions of +this License applicable to that copy. + +### 3. Object Code Incorporating Material from Library Header Files + +The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + +* **a)** Give prominent notice with each copy of the object code that the +Library is used in it and that the Library and its use are +covered by this License. +* **b)** Accompany the object code with a copy of the GNU GPL and this license +document. + +### 4. Combined Works + +You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + +* **a)** Give prominent notice with each copy of the Combined Work that +the Library is used in it and that the Library and its use are +covered by this License. + +* **b)** Accompany the Combined Work with a copy of the GNU GPL and this license +document. + +* **c)** For a Combined Work that displays copyright notices during +execution, include the copyright notice for the Library among +these notices, as well as a reference directing the user to the +copies of the GNU GPL and this license document. + +* **d)** Do one of the following: + - **0)** Convey the Minimal Corresponding Source under the terms of this +License, and the Corresponding Application Code in a form +suitable for, and under terms that permit, the user to +recombine or relink the Application with a modified version of +the Linked Version to produce a modified Combined Work, in the +manner specified by section 6 of the GNU GPL for conveying +Corresponding Source. + - **1)** Use a suitable shared library mechanism for linking with the +Library. A suitable mechanism is one that **(a)** uses at run time +a copy of the Library already present on the user's computer +system, and **(b)** will operate properly with a modified version +of the Library that is interface-compatible with the Linked +Version. + +* **e)** Provide Installation Information, but only if you would otherwise +be required to provide such information under section 6 of the +GNU GPL, and only to the extent that such information is +necessary to install and execute a modified version of the +Combined Work produced by recombining or relinking the +Application with a modified version of the Linked Version. (If +you use option **4d0**, the Installation Information must accompany +the Minimal Corresponding Source and Corresponding Application +Code. If you use option **4d1**, you must provide the Installation +Information in the manner specified by section 6 of the GNU GPL +for conveying Corresponding Source.) + +### 5. Combined Libraries + +You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + +* **a)** Accompany the combined library with a copy of the same work based +on the Library, uncombined with any other library facilities, +conveyed under the terms of this License. +* **b)** Give prominent notice with the combined library that part of it +is a work based on the Library, and explaining where to find the +accompanying uncombined form of the same work. + +### 6. Revised Versions of the GNU Lesser General Public License + +The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License “or any later version” +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + +If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b7a2d89 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +AKVER := 1.0.0 + +all: + +clean: clean-builds + +clean-builds: + @rm -rv ./nfpm/build/ + +nfpm: nfpm-Makefile nfpm-descend + +nfpm-Makefile: + @sed -i 's/AKVER :=.*/AKVER := $"${AKVER}$"/' ./nfpm/Makefile + +nfpm-descend: + $(MAKE) -C ./nfpm diff --git a/README.md b/README.md new file mode 100644 index 0000000..6586e80 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# About + +Small helper to import new keyrings to /etc/apt/keyrings, i.e. to replace +"apt-key add" by something that does adhere to the new standard. + +# Requirements + +1. GPG +2. apt :-) +3. ln-initfunctions, see: + - [Git repository](https://git.lirion.de/lirion-initfunctions/) + - [Debian repository](https://packages.lirion.de/deb/pool/utils/l/ln-initfunctions/) + - [RPM repository](https://packages.lirion.de/rpm/all/Packages/) + - [Arch repository](https://packages.lirion.de/arch/) + +# Contents + +## /fs + +Inside usr/bin, you'll find the core script. + +## /nfpm + +Setup to package the script. Work your way through the Makefiles of this repository +to see how this works. Essentially, it uses goreleaser/nfpm. diff --git a/fs/usr/bin/apt-keyring b/fs/usr/bin/apt-keyring new file mode 100755 index 0000000..72d9d8d --- /dev/null +++ b/fs/usr/bin/apt-keyring @@ -0,0 +1,187 @@ +#!/usr/bin/env bash +# vim:syntax=sh:ts=4 + + +# Small helper to import new keyrings to /etc/apt/keyrings, i.e. to replace +# "apt-key add" by something that does adhere to the new standard. + + +# This requires ln-initfunctions, see: +# - https://git.lirion.de/lirion-initfunctions/ +# - https://packages.lirion.de/deb/pool/utils/l/ln-initfunctions/ +# - https://packages.lirion.de/rpm/all/Packages/ +# - https://packages.lirion.de/arch/ +# shellcheck disable=SC1091 +source '/usr/lib/lirion/ln-initfunctions' || exit 1 + + +DEFKS='keyserver.ubuntu.com' +KRDIR='/etc/apt/keyrings' +GPGBIN='/usr/bin/gpg' +# being more defensive here - there are still a number of raging old systems +# running out there like SUSE's SLE 12 - /bin should be linked on any others, +# so let's use the old path for the time being: +SUDOBIN='/bin/sudo' +# TOUCHBIN='/bin/touch' +INSTBIN='/bin/install' +RMBIN='/bin/rm' + + +function hayulp { + printf '\033[1mUSAGE:\033[0m \033[3m%b\033[0m -i KEYID -k KEYRING_SHORT [ -s KEYSERVER ]\n' "$(basename "$0")" + printf '\n' + printf 'Import GPG keys from GPG key servers.\n' + printf '\n' + printf 'This is meant as a helper replacing "apt-key add" which does not adhere to current standards.\n' + printf 'Effectively, it uses gpg --recv-keys and keyring imports to place files in /etc/apt/keyrings.\n' + printf 'Mind you if your IT dept. in 2025 still does not offer a GPG route, you have to use other means.\n' + printf '\n' + ( + printf -- '--help,\n' + printf -- '-h;This help\n;\n' + printf -- '--key-id,\n' + printf -- '-i;ID of key to be fetched from the public and imported\n;\n' + printf -- '--keyring-short,\n' + printf -- '-k;Name of the keyring file to save, without directory or\n' + printf ';file extension (/etc/apt/keyrings/my-moniker.gpg becomes my-moniker)\n;\n' + printf -- '--keyserver,\n' + printf -- '-s;HKPS key server to use (Default: %b)\n' "$DEFKS" + ) | column -ts\; +} + + +if [ -z "$1" ]; then + hayulp + printf '\n\033[1m\033[3mNo option given, aborting!\033[0m\n' >&2 + exit 101 +fi + + +declare KID KRING KSRV +while [[ $# -gt 0 ]]; do + case "$1" in + '-h'|'--help') + hayulp + exit 0 + ;; + '-i'|'--key-id') + shift + KID="$1" + shift + ;; + '-k'|'--keyring-short') + shift + KRING="$1" + shift + ;; + '-s'|'--keyserver') + shift + KSRV="$1" + shift + ;; + *) + hayulp + printf '\n\033[1m\033[3mNot a valid option: "%b"\033[0m\n' "$1" >&2 + exit 102 + ;; + esac +done + + +if [ -z "$KID" ]; then + hayulp + printf '\n\033[1;3mNo key ID specified, aborting.\033[0m\n' >&2 + exit 103 +fi +if [ -z "$KRING" ]; then + hayulp + printf '\n\033[3;1mNo keyring shortname specified, aborting.\033[0m\n' >&2 + exit 104 +fi +if printf '%b' "$KRING" | grep '/' > /dev/null; then + hayulp + printf '\n\033[3;1mDo not specify the full path for the keyring file.\033[0m\n' >&2 + exit 105 +elif printf '%b' "$KRING" | grep -P '\.gpg$' > /dev/null; then + hayulp + printf '\n\033[3;1mOnly specify the file name without .gpg extension.\033[0m\n' >&2 + exit 106 +fi +if ! printf '%b' "$KID" | grep -P '^([0-9A-Fa-f]{8}){1,2}$|^[0-9A-Fa-f]{40}$' > /dev/null; then + hayulp + printf '\n\033[3;1mNot a valid key ID: "%b"\033[0m\n' "$KID" >&2 + exit 107 +fi +if [ -z "$KSRV" ]; then + KSRV="$DEFKS" +else + KSRV="$(printf '%b' "$KSRV" | sed 's#^[a-z]\+://##')" +fi +lnbegin "Using keyserver: $KSRV"; lninfo + + +KID="$(printf '%b' "$KID" | tr '[:lower:]' '[:upper:]')" + + +lnbegin "Creating temporary keyring file" +if KRTMP="$(mktemp -p /tmp apt-keyring.XXXXXX 2>/dev/null)"; then + lnok +else + lnfail + exit 110 +fi + + +lnbegin "Importing key ID \"$KID\" to temporary file" +if myout="$("$GPGBIN" --no-default-keyring --keyserver "$KSRV" --keyring "$KRTMP" --recv-keys "$KID" 2>&1)"; then + lnok +else + lnfail + printf '\n%b\n' "$myout" >&2 + exit 111 +fi + + +lnbegin "Importing new/updated key to ${KRING}.gpg" +# Ensure the file exists prior to importing - otherwise the result may not be the desired +# OpenPGP v4 keyring. If it does exist before, even if empty, that will be the case. +if [ ! -e "${KRDIR}/${KRING}.gpg" ]; then + if myout="$("$SUDOBIN" "$INSTBIN" -oroot -groot -vm0644 /dev/null "${KRDIR}/${KRING}.gpg" 2>&1)"; then + lnprog 'file created' + else + lnfail "file cannot be created" + printf '\n%b\n' "$myout" >&2 + exit 112 + fi +fi +# Actual import to the target file: +if myout="$("$SUDOBIN" "$GPGBIN" --no-default-keyring --keyring "${KRDIR}/${KRING}.gpg" --import "$KRTMP" 2>&1)"; then + lnok +else + lnfail "import failed" + printf '\n%b\n' "$myout" >&2 + exit 113 +fi + + +lnbegin "Removing GPG temporary file" +if myout="$("$SUDOBIN" "$RMBIN" -f "${KRDIR}/${KRING}.gpg~" 2>&1)"; then + lnok +else + lnfail "removal failed" + printf '\n%b\n' "$myout" >&2 + exit 120 +fi + + +lnbegin "Removing temporary keyring" +if myout="$("$RMBIN" -f "$KRTMP" "${KRTMP}~" 2>/dev/null)"; then + lnok +else + lnfail + printf '\n%b\n' "$myout" >&2 + exit 121 +fi + +printf '\033[3mListing keyring content:\033[0m\n' +"$GPGBIN" --no-default-keyring --keyring "${KRDIR}/${KRING}.gpg" --list-keys diff --git a/nfpm/.chglog.yml b/nfpm/.chglog.yml new file mode 100644 index 0000000..1ea7ab0 --- /dev/null +++ b/nfpm/.chglog.yml @@ -0,0 +1,3 @@ +--- +debug: false +package-name: "ln-apt-keyring" diff --git a/nfpm/.gitignore b/nfpm/.gitignore new file mode 100644 index 0000000..7ecb2cc --- /dev/null +++ b/nfpm/.gitignore @@ -0,0 +1,3 @@ +/build +/nfpm.yaml +/changelog.yml diff --git a/nfpm/Makefile b/nfpm/Makefile new file mode 100644 index 0000000..e5ece46 --- /dev/null +++ b/nfpm/Makefile @@ -0,0 +1,33 @@ +AKVER = 1.0.0 +AKARCH = all +AKKEY = 99A00D948C6E71B599E986AD5421594BF1AB46F4 + +all: skel chglog build + +skel: + @grep -vP '^[\t\ ]*#' nfpm.yaml.skel | tr -s '\n' | sed 's/{%AKVER%}/${AKVER}/g;s/{%AKARCH%}/${AKARCH}/g;s/{%AKKEY%}/${AKKEY}/g' > nfpm.yaml + +build: build-deb build-rpm build-arch build-arch + +build-deb: + @mkdir -pv ./build + nfpm pkg -f ./nfpm.yaml --packager deb --target ./build/ + +build-rpm: + @mkdir -pv ./build + nfpm pkg -f ./nfpm.yaml --packager rpm --target ./build/ + +build-arch: pkg-arch sign-arch + +pkg-arch: + @mkdir -pv ./build + nfpm pkg -f ./nfpm.yaml --packager archlinux --target ./build/ + +sign-arch: + @gpg --local-user "$(AKKEY)" --use-agent --output "./build/ln-apt-keyring-${AKVER}-1-any.pkg.tar.zst.sig" --detach-sig "./build/ln-apt-keyring-${AKVER}-1-any.pkg.tar.zst" + +chglog: + @chglog init + +clean: + @rm -rvf ./build diff --git a/nfpm/nfpm.yaml.skel b/nfpm/nfpm.yaml.skel new file mode 100644 index 0000000..7bcaf93 --- /dev/null +++ b/nfpm/nfpm.yaml.skel @@ -0,0 +1,472 @@ +--- +# Name. (required) +name: ln-apt-keyring + +# Architecture. (required) +# This will expand any env var you set in the field, e.g. version: ${GOARCH} +# The architecture is specified using Go nomenclature (GOARCH) and translated +# to the platform specific equivalent. In order to manually set the architecture +# to a platform specific value, use deb_arch, rpm_arch and apk_arch. +# Examples: `all`, `amd64`, `386`, `arm5`, `arm6`, `arm7`, `arm64`, `mips`, +# `mipsle`, `mips64le`, `ppc64le`, `s390` +arch: {%AKARCH%} + +# Platform. +# This will expand any env var you set in the field, e.g. version: ${GOOS} +# This is only used by the rpm and deb packagers. +# Examples: `linux` (default), `darwin` +platform: linux + +# Version. (required) +# This will expand any env var you set in the field, e.g. version: ${SEMVER} +# Some package managers, like deb, require the version to start with a digit. +# Hence, you should not prefix the version with 'v'. +version: {%AKVER%} + +# Version Schema allows you to specify how to parse the version string. +# Default is `semver` +# `semver` attempt to parse the version string as a valid semver version. +# The parser is lenient; it will strip a `v` prefix and will accept +# versions with fewer than 3 components, like `v1.2`. +# If parsing succeeds, then the version will be molded into a format +# compatible with the specific packager used. +# If parsing fails, then the version is used as-is. +# `none` skip trying to parse the version string and just use what is passed in +version_schema: semver + +# Version Epoch. +# A package with a higher version epoch will always be considered newer. +# See: https://www.debian.org/doc/debian-policy/ch-controlfields.html#epochs-should-be-used-sparingly +epoch: 1 + +# Version Prerelease. +# Default is extracted from `version` if it is semver compatible. +# This is appended to the `version`, e.g. `1.2.3+beta1`. If the `version` is +# semver compatible, then this replaces the prerelease component of the semver. +#prerelease: wtf1 + +# Version Metadata (previously deb.metadata). +# Default is extracted from `version` if it is semver compatible. +# Setting metadata might interfere with version comparisons depending on the +# packager. If the `version` is semver compatible, then this replaces the +# version metadata component of the semver. +#version_metadata: git + +# Version Release, aka revision. +# This will expand any env var you set in the field, e.g. release: ${VERSION_RELEASE} +# This is appended to the `version` after `prerelease`. This should be +# incremented if you release an updated package of the same upstream version, +# and it should reset to 1 when bumping the version. +release: 1 + +# Section. +# This is only used by the deb packager. +# See: https://www.debian.org/doc/debian-policy/ch-archive.html#sections +section: admin + +# Priority. +# Defaults to `optional` on deb +# Defaults to empty on rpm and apk +# See: https://www.debian.org/doc/debian-policy/ch-archive.html#priorities +priority: optional + +# Maintainer. (required) +# This will expand any env var you set in the field, e.g. maintainer: ${GIT_COMMITTER_NAME} <${GIT_COMMITTER_EMAIL}> +# Defaults to empty on rpm and apk +# Leaving the 'maintainer' field unset will not be allowed in a future version +maintainer: packages at lirion.de + +# Description. +# Defaults to `no description given`. +# Most packagers call for a one-line synopsis of the package. Some (like deb) +# also call for a multi-line description starting on the second line. +description: > + Small helper to import new keyrings to /etc/apt/keyrings, i.e. to replace "apt-key add" by something that does adhere to the new standard. + +# Vendor. +# This will expand any env var you set in the field, e.g. vendor: ${VENDOR} +# This is only used by the rpm packager. +vendor: lirion.de + +# Package's homepage. +# This will expand any env var you set in the field, e.g. homepage: ${CI_PROJECT_URL} +homepage: https://git.lirion.de/lirion-apt-keyring/ + +# License. +license: GPLv3+ + +# Date to be used as mtime on internal files. +# +# Default is the value of $SOURCE_DATE_EPOCH (which should be an Unix time), +# or the current time. +# Read more about SOURCE_DATE_EPOCH at https://reproducible-builds.org/docs/source-date-epoch/ +# mtime: "2024-06-16T12:30:00Z" + +# Changelog YAML file, see: https://github.com/goreleaser/chglog +changelog: "changelog.yml" + +# Disables globbing for files, config_files, etc. +disable_globbing: false + +# Packages it replaces. (overridable) +# This will expand any env var you set in the field, e.g. ${REPLACE_BLA} +# the env var approach can be used to account for differences in platforms +#replaces: +# - foobar +# - ${REPLACE_BLA} + +# Packages it provides. (overridable) +# This will expand any env var you set in the field, e.g. ${PROVIDES_BLA} +# the env var approach can be used to account for differences in platforms +#provides: +# - bar +# - ${PROVIDES_BLA} + +# Dependencies. (overridable) +# This will expand any env var you set in the field, e.g. ${DEPENDS_NGINX} +# the env var approach can be used to account for differences in platforms +# e.g. rhel needs nginx >= 1:1.18 and deb needs nginx (>= 1.18.0) +depends: + - ln-initfunctions +# - ${DEPENDS_NGINX} + +# Recommended packages. (overridable) +# This will expand any env var you set in the field, e.g. ${RECOMMENDS_BLA} +# the env var approach can be used to account for differences in platforms +#recommends: +# - golang +# - ${RECOMMENDS_BLA} + +# Suggested packages. (overridable) +# This will expand any env var you set in the field, e.g. ${SUGGESTS_BLA} +# the env var approach can be used to account for differences in platforms +#suggests: +# - bzr + +# Packages it conflicts with. (overridable) +# This will expand any env var you set in the field, e.g. ${CONFLICTS_BLA} +# the env var approach can be used to account for differences in platforms +#conflicts: +# - mercurial +# - ${CONFLICTS_BLA} + +# Contents to add to the package +# This can be binaries or any other files. +contents: + - src: ../fs/usr/bin/apt-keyring + # In case other people come up with the same name, we might + # prefix this with "ln-" in the future. + dst: /usr/bin/apt-keyring + file_info: + mode: 0755 + owner: root + group: root + # Basic file that applies to all packagers +# - src: ../fs/usr/lib/lirion/ln-initfunctions +# dst: /usr/lib/lirion/initfunctions + + # This will add all files in some/directory or in subdirectories at the + # same level under the directory /etc. This means the tree structure in + # some/directory will not be replicated. +# - src: ../fs/usr/lib/lirion +# dst: /usr/lib/lirion + + # This will replicate the directory structure under some/directory at /etc. +# - src: ../fs/{%FJARCH%}/usr/bin +# dst: /usr/bin +# type: tree + + # Simple config file +# - src: path/to/local/foo.conf +# dst: /etc/foo.conf +# type: config + + # Select files with a glob (doesn't work if you set disable_globbing: true). + # If `src` is a glob, then the `dst` will be treated like a directory - even + # if it doesn't end with `/`, and even if the glob only matches one file. +# - src: path/to/local/*.1.gz +# dst: /usr/share/man/man1/ + + # Simple symlink at /usr/bin/foo which points to /sbin/foo, which is + # the same behaviour as `ln -s /sbin/foo /usr/bin/foo`. + # + # This also means that both "src" and "dst" are paths inside the package (or + # rather paths in the file system where the package will be installed) and + # not in the build environment. This is different from regular files where + # "src" is a path in the build environment. However, this convention results + # in "dst" always being the file that is created when installing the + # package. +# - src: /actual/path/to/foo +# dst: /usr/bin/foo +# type: symlink + + # Corresponds to `%config(noreplace)` if the packager is rpm, otherwise it + # is just a config file +# - src: path/to/local/bar.conf +# dst: /etc/bar.conf +# type: config|noreplace + + # These files are not actually present in the package, but the file names + # are added to the package header. From the RPM directives documentation: + # + # "There are times when a file should be owned by the package but not + # installed - log files and state files are good examples of cases you might + # desire this to happen." + # + # "The way to achieve this is to use the %ghost directive. By adding this + # directive to the line containing a file, RPM will know about the ghosted + # file, but will not add it to the package." + # + # For non rpm packages ghost files are ignored at this time. +# - dst: /etc/casper.conf +# type: ghost +# - dst: /var/log/boo.log +# type: ghost + + # You can use the packager field to add files that are unique to a specific + # packager +# - src: path/to/rpm/file.conf +# dst: /etc/file.conf +# type: config|noreplace +# packager: rpm +# - src: path/to/deb/file.conf +# dst: /etc/file.conf +# type: config|noreplace +# packager: deb +# - src: path/to/apk/file.conf +# dst: /etc/file.conf +# type: config|noreplace +# packager: apk + + # Sometimes it is important to be able to set the mtime, mode, owner, or group for a file + # that differs from what is on the local build system at build time. The owner (if different + # than 'root') has to be always specified manually in 'file_info' as it will not be copied + # from the 'src' file. +# - src: path/to/foo +# dst: /usr/share/foo +# file_info: +# # Make sure that the mode is specified in octal, e.g. 0644 instead of 644. +# mode: 0644 +# mtime: 2008-01-02T15:04:05Z +# owner: notRoot +# group: notRoot + + # Using the type 'dir', empty directories can be created. When building RPMs, however, this + # type has another important purpose: Claiming ownership of that folder. This is important + # because when upgrading or removing an RPM package, only the directories for which it has + # claimed ownership are removed. However, you should not claim ownership of a folder that + # is created by the distro or a dependency of your package. + # A directory in the build environment can optionally be provided in the 'src' field in + # order copy mtime and mode from that directory without having to specify it manually. +# - dst: /some/dir +# type: dir +# file_info: +# mode: 0700 + + # Using `expand: true`, environment variables will be expanded in both + # src and dst. +# - dst: /usr/local/bin/${NAME} +# src: "${NAME}" +# expand: true + +# Umask to be used on files without explicit mode set. +# +# By default, nFPM will inherit the mode of the original file that's being +# added. +# This may lead to issues if these files are checkout out in Git, for example, +# as it won't keep all the permissions on fresh checkouts, or if the local +# system has a problematic umask setting. +# +# This setting allows to set the umask for all files that are added to the +# package without a specific file_info.mode set. +# +# Default: 0o002 (will remove world-writable permissions) +umask: 0o022 + +# Scripts to run at specific stages. (overridable) +#scripts: +# preinstall: ./scripts/preinstall.sh +# postinstall: ./scripts/postinstall.sh +# preremove: ./scripts/preremove.sh +# postremove: ./scripts/postremove.sh + +# All fields above marked as `overridable` can be overridden for a given +# package format in this section. +#overrides: +# # The depends override can for example be used to provide version +# # constraints for dependencies where different package formats use different +# # versions or for dependencies that are named differently. +# deb: +# depends: +# - baz (>= 1.2.3-0) +# - some-lib-dev +# # ... +# rpm: +# depends: +# - baz >= 1.2.3-0 +# - some-lib-devel +# # ... +# apk: +# # ... +# archlinux: +# depends: +# - baz +# - some-lib + +# Custom configuration applied only to the RPM packager. +rpm: +# # rpm specific architecture name that overrides "arch" without performing any +# # replacements. +# rpm_arch: ia64 +# +# # RPM specific scripts. +# scripts: +# # The pretrans script runs before all RPM package transactions / stages. +# pretrans: ./scripts/pretrans.sh +# # The posttrans script runs after all RPM package transactions / stages. +# posttrans: ./scripts/posttrans.sh +# # The verify script runs when verifying packages using `rpm -V`. +# verify: ./scripts/verify.sh + +# # The package group. This option is deprecated by most distros +# # but required by old distros like CentOS 5 / EL 5 and earlier. +# group: Unspecified + +# # The package summary. This is, by default, the first line of the +# # description, but can be explicitly provided here. +# summary: Explicit summary for the package + + # The packager is used to identify the organization that actually packaged + # the software, as opposed to the author of the software. + # `maintainer` will be used as fallback if not specified. + # This will expand any env var you set in the field, e.g. packager: ${PACKAGER} +# packager: GoReleaser + + # Compression algorithm (gzip (default), zstd, lzma or xz). +# compression: zstd + +# # Prefixes for relocatable packages. +# prefixes: +# - /usr/bin + + # The package is signed if a key_file is set + signature: + # PGP secret key (can also be ASCII-armored), the passphrase is taken + # from the environment variable $NFPM_RPM_PASSPHRASE with a fallback + # to $NFPM_PASSPHRASE. + # This will expand any env var you set in the field, e.g. key_file: ${SIGNING_KEY_FILE} +# key_file: key.gpg + + # PGP secret key id in hex format, if it is not set it will select the first subkey + # that has the signing flag set. You may need to set this if you want to use the primary key as the signing key + # or to support older versions of RPM < 4.13.0 which cannot validate a signed RPM that used a subkey to sign + # This will expand any env var you set in the field, e.g. key_id: ${RPM_SIGNING_KEY_ID} + key_id: {%AKKEY%} + +# Custom configuration applied only to the Deb packager. +deb: + # deb specific architecture name that overrides "arch" without performing any replacements. +# deb_arch: arm + + # Custom deb special files. +# scripts: +# # Deb rules script. +# rules: foo.sh + + # Deb templates file, when using debconf. +# templates: templates + + # Deb config maintainer script for asking questions when using debconf. +# config: config + + # Custom deb triggers +# triggers: +# # register interest on a trigger activated by another package +# # (also available: interest_await, interest_noawait) +# interest: +# - some-trigger-name +# +# # activate a trigger for another package +# # (also available: activate_await, activate_noawait) +# activate: +# - another-trigger-name +# + # Packages which would break if this package would be installed. + # The installation of this package is blocked if `some-package` + # is already installed. +# breaks: +# - some-package + + # Compression algorithm (gzip (default), zstd, xz or none). +# compression: zstd + + # The package is signed if a key_file is set + signature: + # Signature method, either "dpkg-sig" or "debsign". + # Defaults to "debsign" + method: dpkg-sig + + # PGP secret key (can also be ASCII-armored). The passphrase is taken + # from the environment variable $NFPM_DEB_PASSPHRASE with a fallback + # to $NFPM_PASSPHRASE. + # This will expand any env var you set in the field, e.g. key_file: ${SIGNING_KEY_FILE} +# key_file: key.gpg + + # The type describes the signers role, possible values are "origin", + # "maint" and "archive". If unset, the type defaults to "origin". + type: origin + + # PGP secret key id in hex format, if it is not set it will select the first subkey + # that has the signing flag set. You may need to set this if you want to use the primary key as the signing key + # This will expand any env var you set in the field, e.g. key_id: ${DEB_SIGNING_KEY_ID} + key_id: {%AKKEY%} + + # Additional fields for the control file. Empty fields are ignored. + # This will expand any env vars you set in the field values, e.g. Vcs-Browser: ${CI_PROJECT_URL} +# fields: +# Bugs: https://github.com/goreleaser/nfpm/issues + + # The Debian-specific "predepends" field can be used to ensure the complete installation of a list of + # packages (including unpacking, pre- and post installation scripts) prior to the installation of the + # built package. +# predepends: +# - baz (>= 1.2.3-0) + +#apk: +# # apk specific architecture name that overrides "arch" without performing any replacements. +# apk_arch: armhf +# +# # The package is signed if a key_file is set +# signature: +# # RSA private key in the PEM format. The passphrase is taken from +# # the environment variable $NFPM_APK_PASSPHRASE with a fallback +# # to $NFPM_PASSPHRASE. +# # This will expand any env var you set in the field, e.g. key_file: ${SIGNING_KEY_FILE} +# key_file: key.gpg +# +# # The name of the signing key. When verifying a package, the signature +# # is matched to the public key store in /etc/apk/keys/.rsa.pub. +# # If unset, it defaults to the maintainer email address. +# key_name: origin +# +# # APK does not use pgp keys, so the key_id field is ignored. +# key_id: ignored +# +archlinux: +# # This value is used to specify the name used to refer to a group +# # of packages when building a split package. Defaults to name +# # See: https://wiki.archlinux.org/title/PKGBUILD#pkgbase +# pkgbase: bar +# +# # The packager identifies the organization packaging the software +# # rather than the developer. Defaults to "Unknown Packager". +# packager: GoReleaser +# +# # Arch Linux specific scripts. +# scripts: +# # The preupgrade script runs before pacman upgrades the package +# preupgrade: ./scripts/preupgrade.sh +# +# # The postupgrade script runs after pacman upgrades the package +# postupgrade: ./scripts/postupgrade.sh +# -- cgit v1.2.3