Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
packaging
rpm-icingabuildtest
Commits
3d217be7
Commit
3d217be7
authored
Feb 07, 2019
by
Markus Frosch
Browse files
git init
parents
Changes
3
Hide whitespace changes
Inline
Side-by-side
.gitignore
0 → 100644
View file @
3d217be7
## Build
/build/
/ccache/
## Snapshot Artifacts
/*.git/
/*.tar*
/*.version
## Editors
*~
.*.sw[op]
get_snapshot
0 → 100755
View file @
3d217be7
#!/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
:
=icingabuildtest
}
"
:
"
${
UPSTREAM_GIT_URL
:
=https
://github.com/Icinga/
$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_version
=
$(
git describe
--long
--tags
"
${
UPSTREAM_GIT_BRANCH
}
"
)
package_version
=
$(
echo
"
$git_version
"
|
sed
-e
's/^v//'
-e
's/-/./g'
)
tarball
=
"
${
workdir
}
/
${
PROJECT
}
-
${
package_version
}
.tar.gz"
git archive
--format
=
tar
--prefix
=
"
${
PROJECT
}
-
${
package_version
}
/"
-o
"
${
tarball
}
"
"
${
UPSTREAM_GIT_BRANCH
}
"
sha256sum
"
${
tarball
}
"
# store package version for build scripts
echo
-e
"
${
package_version
}
\t
$(
git rev-parse
"
${
UPSTREAM_GIT_BRANCH
}
"
)
\t
$(
basename
"
${
tarball
}
"
)
\t
${
UPSTREAM_GIT_BRANCH
}
"
>
"
${
workdir
}
/
${
PROJECT
}
.version"
icingabuildtest.spec
0 → 100644
View file @
3d217be7
Summary: Icinga Build test package
License: GPLv2+
Group: System/Monitoring
Name: icingabuildtest
Version: 1.0.0
Release: 1%{?dist}
Url: https://www.icinga.com
Source: https://github.com/Icinga/%{name}/archive/v%{version}.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: bash
%description
This is just a test package.
%prep
%setup -q -n %{name}-%{version}
%build
bash icingabuildtest
%install
install -d %{buildroot}%{_bindir}
install -m 0755 icingabuildtest %{buildroot}%{_bindir}/icingabuildtest
%files
%defattr(-,root,root,-)
%{_bindir}/icingabuildtest
%changelog
* Thu Feb 07 2019 Markus Frosch <markus.frosch@icinga.com> 1.0.0-1
- Initial package
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment