...
 
Commits (3)
#!/bin/bash
export_build_env() {
for var in $( (set -o posix; set) | grep -E ^ICINGA)
for var in $( (set -o posix; set) | grep -E ^ICINGA | cut -d= -f1)
do
# shellcheck disable=SC2163
export "${var}"
......
......@@ -81,6 +81,9 @@ require_var() {
: "${ICINGA_BUILD_UPSTREAM_BRANCH:="master"}"
: "${ICINGA_BUILD_DEB_FLAVOR:="$ICINGA_BUILD_DIST"}"
: "${ICINGA_BUILD_IGNORE_LINT:=1}"
: "${ICINGA_BUILD_BRANDING_TAG:=icinga}"
: "${ICINGA_BUILD_BRANDING_VENDOR:=Icinga.com}"
: "${ICINGA_BUILD_BRANDING_VENDOR_EMAIL:=info@icinga.com}"
print_build_env
......
......@@ -104,7 +104,7 @@ require_var() {
get_rpmbuild() {
local RPMBUILD dist
dist="$(rpm -E '%{?dist}' | sed 's/\(\.centos\)\?$/.icinga/')"
dist="$(rpm -E '%{?dist}' | sed 's/\(\.centos\)\?$/.'"$ICINGA_BUILD_BRANDING_TAG"'/')"
# TODO: target_arch needed?
#local setarch=''
#if [ -n "$target_arch" ]; then
......@@ -113,7 +113,7 @@ get_rpmbuild() {
# ${setarch} \
RPMBUILD=(
/usr/bin/rpmbuild \
--define "vendor Icinga.com" \
--define "vendor $ICINGA_BUILD_BRANDING_VENDOR" \
--define "dist $dist" \
--define "_topdir ${WORKDIR}/build" \
--define "buildroot %{_buildrootdir}/%{name}" \
......@@ -174,6 +174,8 @@ SUDOSCRIPT
: "${ICINGA_BUILD_TYPE:="release"}"
: "${ICINGA_BUILD_UPSTREAM_BRANCH:="master"}"
: "${ICINGA_BUILD_IGNORE_LINT:=1}"
: "${ICINGA_BUILD_BRANDING_TAG:=icinga}"
: "${ICINGA_BUILD_BRANDING_VENDOR:=Icinga.com}"
[ -n "${ICINGA_NO_ENV}" ] || print_build_env
......
......@@ -53,7 +53,7 @@ if [ "${ICINGA_BUILD_TYPE}" == "release" ] ; then
version="$(echo "$debian_version" | cut -d- -f1)"
package_version="${debian_version}.${ICINGA_BUILD_DIST}"
target_dist="icinga-${ICINGA_BUILD_DIST}"
target_dist="${ICINGA_BUILD_BRANDING_TAG}-${ICINGA_BUILD_DIST}"
else
# snapshots
version="$(cut -f1 "${BUILDDIR}/${ICINGA_BUILD_PROJECT}.version")"
......@@ -82,8 +82,8 @@ tar xf "${tarball}" --strip 1 -C "${BUILDDIR}/${ICINGA_BUILD_PROJECT}"/
# build source debian package
cd "${BUILDDIR}/${ICINGA_BUILD_PROJECT}"
export DEBFULLNAME="Icinga Build System"
export DEBEMAIL="info@icinga.com"
export DEBFULLNAME="$ICINGA_BUILD_BRANDING_VENDOR"
export DEBEMAIL="$ICINGA_BUILD_BRANDING_EMAIL"
source_overrides_type="${SCRIPT_HOME}/lintian/source.lintian-overrides.${ICINGA_BUILD_TYPE}"
source_overrides_default="${SCRIPT_HOME}/lintian/source.lintian-overrides"
......
......@@ -18,6 +18,7 @@ case "$ICINGA_BUILD_OS" in
(
set -ex
# Note: force rebuilding here, because zypper is a bit dumb
sudo zypper --non-interactive clean --all
sudo zypper --non-interactive --no-gpg-checks --gpg-auto-import-keys ref -fs
)
;;
......
......@@ -25,7 +25,8 @@ REPO
sles|opensuse*)
(
set -ex
sudo zypper --non-interactive --no-gpg-checks --gpg-auto-import-keys ref
sudo zypper --non-interactive clean --all
sudo zypper --non-interactive --no-gpg-checks --gpg-auto-import-keys ref -fs
# Just use the local dir, zypper will take care of the rest!
sudo zypper addrepo --no-gpgcheck "$repository" local
......