forked from pool/obs-service-kiwi_metainfo_helper
Accepting request 663684 from SUSE:SLE-15:Update
New package - needed for using labels in openSUSE containers. OBS-URL: https://build.opensuse.org/request/show/663684 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-kiwi_metainfo_helper?expand=0&rev=1
This commit is contained in:
commit
efc2a688f4
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
11
README
Normal file
11
README
Normal file
@ -0,0 +1,11 @@
|
||||
obs-service-kiwi_metainfo_helper
|
||||
================================
|
||||
|
||||
This service can be enabled to run during buildtime, when it will edit the
|
||||
kiwi image description to replace placeholders with build-specific metainfo.
|
||||
|
||||
| Placeholder| Value | Example |
|
||||
|------------|--------------------------------------------|-----------------------------------------------------------------------------------------------|
|
||||
| %DISTURL% | The OBS dist url | obs://build.suse.de/SUSE:SLE-15:Update:CR/images/2951b67133dd6384cacb28203174e030-sles15-image|
|
||||
| %RELEASE% | The OBS release number (<cicnt\>.<bldcnt\>)| 4.2 |
|
||||
| %BUILDTIME%| $(date --utc +%FT%T.%NZ) | 2018-10-30T09:19:02.074934628Z |
|
19
kiwi_metainfo_helper
Normal file
19
kiwi_metainfo_helper
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
if [ "${BUILD_DIST+x}" != "x" ]; then
|
||||
echo "Not running in an OBS build container"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BUILD_DATA="${BUILD_DIST/.dist/.data}"
|
||||
. "${BUILD_DATA}"
|
||||
|
||||
if [ "${RECIPEFILE##*.}" != "kiwi" ]; then
|
||||
echo "Recipe is not a kiwi file - exiting"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sed -i"" "s#%DISTURL%#${DISTURL}#g" "${RECIPEFILE}"
|
||||
sed -i"" "s/%RELEASE%/${RELEASE}/g" "${RECIPEFILE}"
|
||||
sed -i"" "s/%BUILDTIME%/$(date --utc +%FT%T.%NZ)/g" "${RECIPEFILE}"
|
4
kiwi_metainfo_helper.service
Normal file
4
kiwi_metainfo_helper.service
Normal file
@ -0,0 +1,4 @@
|
||||
<service name="kiwi_metainfo_helper">
|
||||
<summary>Substitute various variables in .kiwi files</summary>
|
||||
<description>Substitutes %DISTURL%, %RELEASE% and %BUILDTIME% in .kiwi files.</description>
|
||||
</service>
|
5
obs-service-kiwi_metainfo_helper.changes
Normal file
5
obs-service-kiwi_metainfo_helper.changes
Normal file
@ -0,0 +1,5 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 17 14:56:38 UTC 2018 - Fabian Vogt <fvogt@suse.com>
|
||||
|
||||
- Initial commit (fate#326856, bsc#1118103)
|
||||
|
53
obs-service-kiwi_metainfo_helper.spec
Normal file
53
obs-service-kiwi_metainfo_helper.spec
Normal file
@ -0,0 +1,53 @@
|
||||
#
|
||||
# spec file for package obs-service-kiwi_metainfo_helper
|
||||
#
|
||||
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
Name: obs-service-kiwi_metainfo_helper
|
||||
Version: 0.0
|
||||
Release: 0
|
||||
Summary: Substitute various variables in kiwi recipes
|
||||
License: GPL-2.0+
|
||||
Group: Development/Tools/Building
|
||||
Url: https://build.opensuse.org
|
||||
Source0: kiwi_metainfo_helper.service
|
||||
Source1: kiwi_metainfo_helper
|
||||
Source2: README
|
||||
Requires: sed
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
This service can be used during buildtime to gain access to various variables
|
||||
in kiwi recipes.
|
||||
|
||||
%prep
|
||||
%setup -q -D -T 0 -n .
|
||||
cp %{SOURCE2} .
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
|
||||
mkdir -p %{buildroot}%{_prefix}/lib/obs/service
|
||||
install -m 0644 %{SOURCE0} %{buildroot}%{_prefix}/lib/obs/service
|
||||
install -m 0755 %{SOURCE1} %{buildroot}%{_prefix}/lib/obs/service
|
||||
|
||||
%files
|
||||
%doc README
|
||||
%dir %{_prefix}/lib/obs
|
||||
%{_prefix}/lib/obs/service
|
||||
|
||||
%changelog
|
Loading…
Reference in New Issue
Block a user