Commit 79c8ca58 authored by Markus Frosch's avatar Markus Frosch 📣

git init

parents
## Build
/build/
/ccache/
## Snapshot Artifacts
/*.git/
/.debian_packaging/
## Editors
*~
.*.sw[op]
#!/bin/bash
# Copyright (c) 2017 Icinga Development Team <info@icinga.com>
# Licensed as GPL-2.0+
set -e
while getopts ":p:U:b:" opt
do
case "$opt" in
p)
PROJECT="$OPTARG"
;;
U)
UPSTREAM_GIT_URL="$OPTARG"
;;
b)
UPSTREAM_GIT_BRANCH="$OPTARG"
;;
\?)
echo "Unknown argument: $OPTARG" >&2
exit 1
;;
esac
done
: "${PROJECT:=icingadb}"
: "${UPSTREAM_GIT_URL:=https://git.icinga.com/icingadb/$PROJECT.git}"
: "${UPSTREAM_GIT_BRANCH:=master}"
workdir=$(pwd)
set -x
if [ -z "$UPSTREAM_GIT_NOREPO" ]; then
if [ -d "${PROJECT}.git/" ]; then
cd "${PROJECT}.git"
if [ ! -d .git ]; then
echo "This is not a GIT repository: $(pwd)" >&2
exit 1
fi
if [ -z "$UPSTREAM_GIT_NOUPDATE" ]; then
if [ "$(git config remote.origin.url)" != "${UPSTREAM_GIT_URL}" ]; then
git remote set-url origin "${UPSTREAM_GIT_URL}"
fi
git fetch origin -p
git checkout -f "${UPSTREAM_GIT_BRANCH}"
git reset --hard "origin/${UPSTREAM_GIT_BRANCH}"
fi
git clean -fdx
elif [ -z "$UPSTREAM_GIT_NOUPDATE" ]; then
git clone -b "${UPSTREAM_GIT_BRANCH}" "${UPSTREAM_GIT_URL}" "${PROJECT}.git/"
cd "${PROJECT}.git"
else
echo "Missing '${PROJECT}.git' directory!" >&2
exit 1
fi
fi
git_commit=$(git rev-parse "${UPSTREAM_GIT_BRANCH}")
if ! git_version=$(git describe --tags "${UPSTREAM_GIT_BRANCH}"); then
git_version=0.0.0.$(git rev-list "${UPSTREAM_GIT_BRANCH}" | wc -l).$(echo "$git_commit" | head -c 8)
fi
package_version=$(echo "$git_version" | sed -e 's/^v//' -e 's/-/+/' -e 's/-/./g')
tarball="${workdir}/${PROJECT}_${package_version}.orig.tar"
git archive --format=tar --prefix="${PROJECT}-${git_commit}/" -o "${tarball}" "${UPSTREAM_GIT_BRANCH}"
# pack tarball
gzip -vf9 "${tarball}"
sha256sum "${tarball}.gz"
# store package version for build scripts
printf '%s\t%s\t%s\t%s\n' \
"${package_version}" \
"${git_commit}" \
"$(basename "${tarball}.gz")" \
"${UPSTREAM_GIT_BRANCH}" \
>"${workdir}/${PROJECT}.version"
files
*.debhelper
*.debhelper.log
*.substvars
icingadb*/
tmp/
icingadb (0.0.0-0) UNRELEASED; urgency=medium
* Initial release.
-- Markus Frosch <markus.frosch@icinga.com> Mon, 24 Sep 2018 17:06:45 +0200
Source: icingadb
Section: admin
Priority: extra
Maintainer: Icinga Development Team <info@icinga.com>
Build-Depends:
debhelper (>= 9),
dh-golang,
dh-systemd (>= 1.5),
golang-go (>= 2:1.10~)
Standards-Version: 3.9.8
Homepage: https://www.icinga.com
#Vcs-Browser:
#Vcs-Git:
Package: icingadb
Architecture: any
Depends:
${shlibs:Depends},
${misc:Depends}
Built-Using: ${misc:Built-Using}
Suggests: icinga2, redis-server
Description: database connector for Icinga 2
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Icinga DB
Source: https://www.icinga.com
Files: *
Copyright: 2017-2018 Icinga Development Team <info@icinga.com>
License: GPL-2+
Files: debian/*
Copyright: 2018 Icinga Development Team <info@icinga.com>
License: GPL-2+
License: GPL-2+
This package 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 2 of the License, or
(at your option) any later version.
.
This package 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.
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
#!/usr/bin/make -f
#export DH_VERBOSE=1
export DH_GOPKG := git.icinga.com/icingadb/icingadb
INSTALL_DIR := install -d -m 0755
INSTALL_FILE := install -m 0644
PACKAGE_PATH := debian/icingadb
%:
dh $@ --buildsystem golang --with golang --with systemd
override_dh_auto_install:
dh_auto_install -- --no-source
# move binary to sbin
$(INSTALL_DIR) $(PACKAGE_PATH)/usr/sbin
mv $(PACKAGE_PATH)/usr/bin/icingadb $(PACKAGE_PATH)/usr/sbin/icingadb
rmdir $(PACKAGE_PATH)/usr/bin
# config for the daemon
$(INSTALL_DIR) $(PACKAGE_PATH)
$(INSTALL_DIR) $(PACKAGE_PATH)/etc/icingadb
$(INSTALL_FILE) etc/config_production.ini $(PACKAGE_PATH)/etc/icingadb/config.ini
# systemd
$(INSTALL_DIR) $(PACKAGE_PATH)/lib/systemd/system
$(INSTALL_FILE) etc/icingadb.service $(PACKAGE_PATH)/lib/systemd/system/
# vi: noexpandtab ts=4 sw=4 :
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