Package not found: openSUSE:Factory/ghc-ilist

File mkosi_post_run of Package post-build-raw2rpm

#!/bin/bash -x

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

# Helpful for debugging
env

set -e

IMG_FILE="$(basename $(find ${TOPDIR}/OTHER -type f -name "*.raw" | head -n1))"

IMG_NAME="${IMG_FILE%%_*}"
[[ "${IMG_FILE}" =~ ^.*_.*_.*\.raw$ ]] || exit 0

FULL_VERSION="${IMG_FILE%_*}"
FULL_VERSION="${FULL_VERSION##*_}"

if [[ "${FULL_VERSION}" =~ ^.*-.*$ ]]; then
  VERSION="${FULL_VERSION%%-*}"
  RELEASE="${FULL_VERSION##*-}"
else
  VERSION="${FULL_VERSION}"
  RELEASE=0
fi

ARCH=$(uname -m)

ln "${TOPDIR}/OTHER/${IMG_FILE}" "${TOPDIR}/SOURCES"

cat <<- END > "${TOPDIR}/SOURCES/${IMG_NAME}-sysext.spec"
Url:            http://www.suse.com/
Name:           ${IMG_NAME}-sysext
Summary:        Package with the ${IMG_NAME} systemd-sysext image
Version:        ${VERSION}
Release:        ${RELEASE}
Group:          System/Management
License:        SUSE-EULA
Source0:        ${IMG_FILE}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This package contains the '${IMG_NAME}' package as a systemd-sysext image.

%prep

%build

%install
install -d -m 755 %{buildroot}/%{_datadir}/suse-sysext-images/native
install -p -D -m 644 %{SOURCE0} %{buildroot}/%{_datadir}/suse-sysext-images/native/

%clean
rm -rf %{buildroot}

%files
%defattr(-, root, root)
%{_datadir}/suse-sysext-images/native

%changelog
END

test -f "/.build-changelog" && cat /.build-changelog >> "${TOPDIR}/SOURCES/${IMG_NAME}-sysext.spec"

cat "${TOPDIR}/SOURCES/${IMG_NAME}-sysext.spec" || true

rpmbuild --target "${ARCH}" -ba "${TOPDIR}/SOURCES/${IMG_NAME}-sysext.spec"

mv ${TOPDIR}/RPMS/${ARCH}/${IMG_NAME}-sysext-${VERSION}-${RELEASE}.${ARCH}.rpm $TOPDIR/OTHER/
openSUSE Build Service is sponsored by