Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > b0960e4071412dd04f7ff9d031450766 > files > 4

mock-core-configs-30.2-3.mga7.src.rpm

# mock group id allocate for Fedora
%global mockgid 135

Name:		mock-core-configs
Version:	30.2
Release:	%mkrel 3
Summary:	Mock core config files basic chroots
Group:          System/Packaging
License:	GPLv2+
URL:		https://github.com/rpm-software-management/mock/
# Source is created by
# git clone https://github.com/rpm-software-management/mock.git
# cd mock/mock-core-configs
# git reset --hard %{name}-%{version}
# tito build --tgz
Source:		https://github.com/rpm-software-management/mock/releases/download/%{name}-%{version}-1/%{name}-%{version}.tar.gz

# Backports from upstream
Patch0001:	0001-Fix-openSUSE-Tumbleweed-DistTag-definition.patch

# Patches proposed upstream
## From: https://github.com/rpm-software-management/mock/pull/257
Patch0101:	0101-Allow-AArch64-systems-to-build-32-bit-ARM-packages.patch

BuildArch:	noarch

# distribution-gpg-keys contains GPG keys used by mock configs
Requires:	distribution-gpg-keys >= 1.29

Requires(pre):	shadow-utils
Requires(post): coreutils
# to detect correct default.cfg
Requires(post):	system-release
Requires(post):	sed

%description
Config files which allow you to create chroots for:
 * Fedora
 * EPEL
 * Mageia
 * openSUSE Leap and openSUSE Tumbleweed
 * Custom chroot

%prep
%autosetup -p2


%build
# nothing to do here


%install
mkdir -p %{buildroot}%{_sysconfdir}/mock/eol
install -pm 0644 etc/mock/*.cfg %{buildroot}%{_sysconfdir}/mock
install -pm 0644 etc/mock/eol/*.cfg %{buildroot}%{_sysconfdir}/mock/eol

# generate files section with config - there is many of them
echo "%defattr(0644, root, mock, -)" > %{name}.cfgs
find %{buildroot}%{_sysconfdir}/mock -name "*.cfg" \
    | sed -e "s|^%{buildroot}|%%config(noreplace) |" >> %{name}.cfgs
# just for %%ghosting purposes
ln -s mageia-cauldron-x86_64.cfg %{buildroot}%{_sysconfdir}/mock/default.cfg
# bash-completion
if [ -d %{buildroot}%{_datadir}/bash-completion ]; then
    echo %{_datadir}/bash-completion/completions/mock >> %{name}.cfgs
    echo %{_datadir}/bash-completion/completions/mockchain >> %{name}.cfgs
elif [ -d %{buildroot}%{_sysconfdir}/bash_completion.d ]; then
    echo %{_sysconfdir}/bash_completion.d/mock >> %{name}.cfgs
fi

%pre
# check for existence of mock group, create it if not found
getent group mock > /dev/null || groupadd -f -g %mockgid -r mock
exit 0

%post
if [ -s /etc/os-release ]; then
    if [ -s /etc/mageia-release ]; then
        if grep -Fiq Cauldron /etc/mageia-release; then
           ver=cauldron
        fi
    else
        ver=$(source /etc/os-release && echo \$VERSION_ID | cut -d. -f1 | grep -o '[0-9]\+')
    fi
else
    # something obsure, use buildtime version
    ver=%{?mageia}
fi

mock_arch=$(sed -n '/^$/!{$ s/.* \(\w*\)$/\1/p}' /etc/mageia-release)

cfg=mageia-${ver}-${mock_arch}.cfg
if [ -e %{_sysconfdir}/mock/$cfg ]; then
    if [ "$(readlink %{_sysconfdir}/mock/default.cfg)" != "$cfg" ]; then
        ln -s $cfg %{_sysconfdir}/mock/default.cfg 2>/dev/null || ln -s -f $cfg %{_sysconfdir}/mock/default.cfg.rpmnew
    fi
else
    echo "Warning: file %{_sysconfdir}/mock/$cfg does not exist."
    echo "         unable to update %{_sysconfdir}/mock/default.cfg"
fi
:


%files -f %{name}.cfgs
%license COPYING
%dir  %{_sysconfdir}/mock
%dir  %{_sysconfdir}/mock/eol
%ghost %config(noreplace,missingok) %{_sysconfdir}/mock/default.cfg



%changelog
* Sun May 05 2019 ngompa <ngompa> 30.2-3.mga7
+ Revision: 1396370
- Add patch to allow AArch64 hosts to build 32-bit ARM packages natively

* Sun Apr 28 2019 ngompa <ngompa> 30.2-2.mga7
+ Revision: 1395818
- Backport fix for setting the openSUSE Tumbleweed DistTag definition
- Fix post scriptlet to correctly source from os-release(5)

* Mon Mar 04 2019 ngompa <ngompa> 30.2-1.mga7
+ Revision: 1371328
- Update to 30.2

* Thu Feb 21 2019 ngompa <ngompa> 30.1-1.mga7
+ Revision: 1369198
- Update to 30.1
- Add patches to add new Mageia and openSUSE configs

* Mon Jan 21 2019 ngompa <ngompa> 29.4-1.mga7
+ Revision: 1358702
- Rebase to v29.4

* Thu Sep 20 2018 umeabot <umeabot> 28.4-3.mga7
+ Revision: 1279943
- Mageia 7 Mass Rebuild

* Sat Jun 30 2018 ngompa <ngompa> 28.4-2.mga7
+ Revision: 1240955
- Backport patch to swap cauldron armv5tl for aarch64

* Sat Jun 30 2018 ngompa <ngompa> 28.4-1.mga7
+ Revision: 1240943
- Update to 28.4

* Mon Feb 26 2018 ngompa <ngompa> 28.2-1.mga7
+ Revision: 1205186
- Upgrade to v28.2

* Sun Dec 10 2017 ngompa <ngompa> 27.4-2.mga7
+ Revision: 1181883
- Adapt for Mageia
- imported package mock-core-configs