Commit f6c041d2 authored by Markus Frosch's avatar Markus Frosch 📣

git init

parents
# Editors
*~
.*.sw[op]
/.idea/
# Build fragments
*.changes
*.buildinfo
*.dsc
*.deb
# Tarball
*.tar
*.tar.*
# Fragments from snapshots
*.version
*.git/
#!/bin/bash
set -e
DIST=(stretch)
VERSION="$1"
shift
CHANGELOG="$@"
cd $(dirname "$0")
newversion=()
if [ -n "$VERSION" ]; then
newversion=("--newversion" "$VERSION")
fi
echo "Using your git name + email for Debian scripts..."
set -x
export DEBFULLNAME=$(git config user.name)
export DEBEMAIL=$(git config user.email)
for dist in "${DIST[@]}"; do
dch --force-distribution --changelog "$dist"/debian/changelog "${newversion[@]}" --distribution "icinga-$dist" -- "${CHANGELOG[@]}"
done
#!/bin/bash
# Copyright (c) 2018 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:=icinga2-templates}
: ${UPSTREAM_GIT_URL:=https://github.com/Icinga/icinga-template-library.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
if ! git_version=$(git describe --tags "${UPSTREAM_GIT_BRANCH}"); then
# no tag yet, build arbitrary version
git_version=0.0.0.$(git rev-list --count "${UPSTREAM_GIT_BRANCH}").$(git rev-parse --short=12 "${UPSTREAM_GIT_BRANCH}")
fi
package_version=$(echo "$git_version" | sed -e 's/^v//' -e 's/-/+/' -e 's/-/./g')
tarball="${workdir}/${PROJECT}_${package_version}.tar"
git archive --format=tar --prefix="${PROJECT}_${package_version}/" -o "${tarball}" "${UPSTREAM_GIT_BRANCH}"
# pack tarball
gzip -vf9 "${tarball}"
sha256sum "${tarball}.gz"
# store package version for build scripts
echo -e "${package_version}\t$(git rev-parse "${UPSTREAM_GIT_BRANCH}")\t$(basename "${tarball}.gz")\t${UPSTREAM_GIT_BRANCH}" > "${workdir}/${PROJECT}.version"
files
*.debhelper.log
*substvars
icinga2-templates/
.*.sw[op]
icinga2-templates (0.0.0-1) icinga-stretch; urgency=medium
* Initial package
-- Markus Frosch <markus.frosch@icinga.com> Mon, 05 Feb 2018 16:11:08 +0100
Source: icinga2-templates
Section: admin
Priority: optional
Maintainer: Icinga Development Team <info@icinga.com>
Uploaders:
Markus Frosch <markus.frosch@icinga.com>
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.8
Homepage: https://www.icinga.com
#Vcs-Browser: https://anonscm.debian.org/cgit/pkg-nagios/pkg-icinga2-templates.git
#Vcs-Git: https://anonscm.debian.org/git/pkg-nagios/pkg-icinga2-templates.git
Package: icinga2-templates
Architecture: all
Depends: ${misc:Depends}
Replaces: icinga2-common (<< 2.9.0)
Breaks: icinga2-common (<< 2.9.0)
Description: Icinga Template Library for Icinga 2
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Icinga Template Library
Source: https://github.com/Icinga/icinga-template-library
Homepage: https://www.icinga.com
Files: *
Copyright: 2013-2018 Icinga Development Team
License: GPL-2+
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 2 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.
.
On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file
`/usr/share/common-licenses/GPL-2'.
#!/usr/bin/make -f
#export DH_VERBOSE=1
%:
dh $@
override_dh_auto_install:
DESTDIR=debian/tmp ./install.sh
# vi: ts=4 sw=4 noexpandtab :
version=3
# filenamemangle -> prepending icinga2-templates if only tag name
# versionmangle -> convert version addition to ~ version
opts=filenamemangle=s/.+\/(?:icinga2-templates-|v)([\d.]+(?:-.+)?).tar.gz/icinga2-templates-$1.tar.gz/,versionmangle=s/^([\d.]+)-(.+)?/$1~$2/ \
https://github.com/Icinga/icinga-template-library/releases .*/v([\d.]+(?:-.+)?).tar.gz
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