blob: 14dc5b55dab920d8c2bc758d533df2549583cb39 [file] [log] [blame]
#!/bin/sh
# Copyright (C) 2016 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
if [ $# != 2 ]; then
echo "Usage: $0 <temp repo url> <validated repo url>" 1>&2
exit 1
fi
ENABLE_QEMU_EV_EL7=0
ENABLE_QEMU_EV_EL8=0
ENABLE_NFV_OVS=0
if [ -f /etc/os-release ]; then
source /etc/os-release
fi
if [[ $VERSION_ID == '7' ]]; then
ENABLE_QEMU_EV_EL7=1
elif [[ $VERSION_ID == '8' ]]; then
ENABLE_QEMU_EV_EL8=1
ENABLE_NFV_OVS=1
else
echo "INFO: QEMU_EV and NFV_OVS repos are disabled."
fi
cat > rpmfactory-temp-release.spec <<EOS
Summary: yum repo files for testing
Name: rpmfactory-temp-release
Version: 1.0
Release: 1
License: GPL
BuildArch: noarch
%description
%prep
%build
%install
rm -rf \$RPM_BUILD_ROOT
mkdir -p \$RPM_BUILD_ROOT/etc/yum.repos.d
cat > \$RPM_BUILD_ROOT/etc/yum.repos.d/rpmfactory-temp-release.repo <<EOF
[validated]
name=validated packages for testing
baseurl=$2
enabled=1
gpgcheck=0
module_hotfixes=1
excludepkgs="*module_el9*"
[validated-qemu-ev-el7]
name=RDO CentOS - QEMU EV EL7
baseurl=http://mirror.centos.org/centos/7/virt/x86_64/kvm-common/
gpgcheck=0
enabled=$ENABLE_QEMU_EV_EL7
skip_if_unavailable=1
[validated-qemu-ev-el8]
name=RDO CentOS - QEMU EV EL8
baseurl=http://mirror.centos.org/centos/8/virt/x86_64/advanced-virtualization/
gpgcheck=0
enabled=$ENABLE_QEMU_EV_EL8
skip_if_unavailable=1
module_hotfixes=1
[validated-nfv-ovs]
name=RDO CentOS - NFV OVS
baseurl=http://mirror.centos.org/centos/8-stream/nfv/x86_64/openvswitch-2/
gpgcheck=0
enabled=$ENABLE_NFV_OVS
skip_if_unavailable=1
module_hotfixes=1
[temp]
name=temporary packages for testing
baseurl=$1
enabled=1
gpgcheck=0
EOF
%clean
rm -rf \$RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/etc/yum.repos.d/*
%changelog
EOS
rpmbuild -bb rpmfactory-temp-release.spec
# build-release-rpm.sh ends here