Skip to content

Commit

Permalink
Add package sources for suse-migration-rpm
Browse files Browse the repository at this point in the history
The suse-migration-rpm package contains an OBS hook
script which turns the migration live ISO image into
a package named according to the name of the image
name attribute. In our case: SLES15-Migration. The
sources of this package was not maintained in any
git repository but are tightly coupled to the live
image build which resides here. Thus and to complete
the source gap we have for the DMS this commit adds
the sources for the meta package here
  • Loading branch information
schaefi committed Oct 30, 2024
1 parent ad6d244 commit f0d276f
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 0 deletions.
57 changes: 57 additions & 0 deletions image/package/suse-migration-rpm.changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
-------------------------------------------------------------------
Thu Nov 14 10:11:04 UTC 2019 - Marcus Schaefer <[email protected]>

- Reference commit for SUSE maintenance

This submission creates a reference to bsc#1155192

-------------------------------------------------------------------
Mon Nov 11 14:29:56 UTC 2019 - Marcus Schaefer <[email protected]>

- Add product version requirement to spec file
For further details see: https://github.com/SUSE/suse-migration-services/pull/143

-------------------------------------------------------------------
Tue Aug 20 12:01:26 UTC 2019 - Jesús Bermúdez Velázquez <[email protected]>

- Reference commit for SUSE maintenance
Fix BYOS upgrade from 12SP4-SAP to 15 (BSC#1142108)

-------------------------------------------------------------------
Wed Aug 14 11:47:24 UTC 2019 - Jesús Bermúdez Velázquez <[email protected]>

- This submission creates a reference to bsc#1142108

-------------------------------------------------------------------
Wed Jul 17 09:46:13 UTC 2019 - [email protected]

- Install run_migration from suse-migration-services package
that is now a build requirement. For details see:
https://github.com/SUSE/suse-migration-services/issues/108

-------------------------------------------------------------------
Thu May 2 13:24:04 UTC 2019 - [email protected]

- Reference commit for SUSE maintenance

This submission creates a reference to fate#327175 and bsc#1133919

-------------------------------------------------------------------
Mon Mar 4 12:53:44 UTC 2019 - [email protected]

- Install SLES15-Migration live image to /usr/share/migration-image
See https://github.com/SUSE/suse-migration-services/issues/54
for details

-------------------------------------------------------------------
Fri Jan 25 10:08:59 UTC 2019 - [email protected]

- Install SLES15-Migration live image to /boot

-------------------------------------------------------------------
Wed Nov 14 15:32:25 UTC 2018 - [email protected]

- Post Processing package for SLES15-Migration live image.
This package provides metadata used at the end of an
appliance build to package the image results into a
package
50 changes: 50 additions & 0 deletions image/package/suse-migration-rpm.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
# spec file for package suse-migration-rpm
#
# 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: suse-migration-rpm
Version: 1.0.1
Release: 0
Summary: Migration enablement package
License: GPL-3.0-or-later
Group: System/Management
Url: https://github.com/SUSE/suse-migration-services
Source: %{name}.tar.gz
BuildRequires: filesystem
Requires: suse-migration-services
BuildRoot: %{_tmppath}/%{name}-%{version}-build

%description
OBS kiwi_post_run hook to wrap the kiwi-produced Migration live
ISO image in an rpm package.

%prep
%setup -q -n %{name}

%build

%install
mkdir -p %{buildroot}/usr/lib/build/
install -m 644 image.spec.in %{buildroot}/usr/lib/build/
install -m 755 kiwi_post_run %{buildroot}/usr/lib/build/

%files
%defattr(-,root,root)
/usr/lib/build/kiwi_post_run
/usr/lib/build/image.spec.in

%changelog
41 changes: 41 additions & 0 deletions image/package/suse-migration-rpm/image.spec.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# needsrootforbuild

%global MinSLEVersion 12.3

Url: http://www.suse.com/
Name: __NAME__
Summary: Migration Live System
Version: __VERSION__
Release: __RELEASE__
Group: System/Management
License: SUSE-EULA
Source0: __SOURCE__
Requires: product(SLES) >= %{MinSLEVersion}
Requires: suse-migration-pre-checks
BuildRoot: %{_tmppath}/%{name}-%{version}-build

%description
This package contains the Migration Live System.

%prep

%build

%install
install -d -m 755 $RPM_BUILD_ROOT/usr/share/migration-image
install -d -m 755 $RPM_BUILD_ROOT/%{_sbindir}
cp %{SOURCE0} $RPM_BUILD_ROOT/usr/share/migration-image
cp %{_sbindir}/run_migration $RPM_BUILD_ROOT/%{_sbindir}

%post
/usr/bin/suse-migration-pre-checks

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)
/usr/share/migration-image
%{_sbindir}/run_migration

%changelog
64 changes: 64 additions & 0 deletions image/package/suse-migration-rpm/kiwi_post_run
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash

set -e
set -u

: ${TOPDIR:=/usr/src/packages}

IMAGE_DIR=$TOPDIR/KIWI
BUILD_DIR=/usr/lib/build

cd $IMAGE_DIR

ARCH=$(rpm --eval '%{_arch}')
IMAGE=$(echo *.iso)
NAME=$(echo $IMAGE | cut -f1 -d.)
VERSION=$(echo $IMAGE | cut -f3 -d-)
RELEASE=$(echo $IMAGE | cut -f4 -d- | sed -e "s@Build@@" | cut -f1 -d.)

if [ -z "$IMAGE" ]; then
echo "Couldn't find anything in $IMAGE_DIR matching *.iso"
echo "Will skip containment rpm wrapping steps."
exit 0
fi

echo "Attempting to wrap $IMAGE in a containment rpm ..."

echo "name $NAME"
echo "version $VERSION"
echo "release $RELEASE"

sed -e "s/__NAME__/$NAME/g" \
-e "s/__VERSION__/$VERSION/g" \
-e "s/__RELEASE__/$RELEASE/g" \
-e "s/__SOURCE__/$IMAGE/g" \
< $BUILD_DIR/image.spec.in \
> $BUILD_DIR/image.spec

# Local builds have the file already in place, that's not true on IBS
if [ ! -f $TOPDIR/SOURCES/$IMAGE ]; then
ln $IMAGE $TOPDIR/SOURCES
fi

# Make sure /usr/src/packages/* dirs exist
if [ ! -f $TOPDIR/BUILD ]; then
echo "Create BUILD dir"
mkdir -p $TOPDIR/BUILD
fi

if [ ! -f $TOPDIR/SRPMS ]; then
echo "Create SRPMS dir"
mkdir -p $TOPDIR/SRPMS
fi

if [ ! -f $TOPDIR/RPMS/$ARCH ]; then
echo "Create SRPMS dir"
mkdir -p $TOPDIR/RPMS/$ARCH
fi

rpmbuild -ba $BUILD_DIR/image.spec

# required for the BS to find the rpm, because it is
# a "non-standard result file for KIWI"
mkdir -p $TOPDIR/OTHER
mv $TOPDIR/RPMS/$ARCH/$NAME-$VERSION-$RELEASE.$ARCH.rpm $TOPDIR/OTHER/

0 comments on commit f0d276f

Please sign in to comment.