Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Commit ed206c5

Browse files
packaging: add helper to automatically package kubernetes-terraform
Signed-off-by: Maximilian Meister <[email protected]>
1 parent 615b452 commit ed206c5

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.5.3+dev

packaging/suse/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
kubernetes-terraform.spec

packaging/suse/make_spec.sh

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/bash
2+
3+
if [ -z "$1" ]; then
4+
cat <<EOF
5+
usage:
6+
./make_spec.sh PACKAGE
7+
EOF
8+
exit 1
9+
fi
10+
11+
cd $(dirname $0)
12+
13+
YEAR=$(date +%Y)
14+
VERSION=$(cat ../../VERSION)
15+
COMMIT_UNIX_TIME=$(git show -s --format=%ct)
16+
VERSION="${VERSION%+*}+$(date -d @$COMMIT_UNIX_TIME +%Y%m%d).$(git rev-parse --short HEAD)"
17+
NAME=$1
18+
GITREPONAME=$(basename `git rev-parse --show-toplevel`)
19+
20+
cat <<EOF > ${NAME}.spec
21+
#
22+
# spec file for package $NAME
23+
#
24+
# Copyright (c) $YEAR SUSE LINUX GmbH, Nuernberg, Germany.
25+
#
26+
# All modifications and additions to the file contributed by third parties
27+
# remain the property of their copyright owners, unless otherwise agreed
28+
# upon. The license for this file, and modifications and additions to the
29+
# file, is the same license as for the pristine package itself (unless the
30+
# license for the pristine package is not an Open Source License, in which
31+
# case the license is the MIT License). An "Open Source License" is a
32+
# license that conforms to the Open Source Definition (Version 1.9)
33+
# published by the Open Source Initiative.
34+
35+
# Please submit bugfixes or comments via http://bugs.opensuse.org/
36+
#
37+
38+
%{!?tmpfiles_create:%global tmpfiles_create systemd-tmpfiles --create}
39+
40+
Name: $NAME
41+
Version: $VERSION
42+
Release: 0
43+
BuildArch: noarch
44+
Summary: Production-Grade Container Scheduling and Management
45+
License: Apache-2.0
46+
Group: System/Management
47+
Url: http://kubernetes.io
48+
Source: master.tar.gz
49+
BuildRequires: systemd-rpm-macros
50+
Requires: terraform
51+
52+
%description
53+
Terraforms preprocessor and scripts for deploying a Kubernetes cluster
54+
55+
%prep
56+
%setup -q -n %{name}-master
57+
58+
%build
59+
60+
%install
61+
rm -rf %{buildroot}%{_datadir}
62+
mkdir -p %{buildroot}%{_datadir}/terraform/kubernetes
63+
cp -R %{_builddir}/kubernetes-terraform-%{version}/* %{buildroot}%{_datadir}/terraform/kubernetes/
64+
65+
%files
66+
%defattr(-,root,root)
67+
%dir %{_datadir}/terraform
68+
%dir %{_datadir}/terraform/kubernetes
69+
%{_datadir}/terraform/kubernetes/*
70+
71+
%changelog
72+
EOF

0 commit comments

Comments
 (0)