# keep gid same with upstream %global mockgid 135 Name: mock-core-configs Version: 38.3 Release: 2 Summary: Mock core config files basic chroots 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}-%%{release} # tito build --tgz Source0: https://github.com/rpm-software-management/mock/releases/download/%{name}-%{version}-1/%{name}-%{version}.tar.gz Source1: openeuler-20.03_LTS_SP3-aarch64.cfg Source2: openeuler-20.03_LTS_SP3-x86_64.cfg Source3: openeuler-20.03_LTS_SP2-aarch64.cfg Source4: openeuler-20.03_LTS_SP2-x86_64.cfg Source5: openeuler-20.03_LTS_SP1-aarch64.cfg Source6: openeuler-20.03_LTS_SP1-x86_64.cfg Source7: openeuler-20.03_LTS-aarch64.cfg Source8: openeuler-20.03_LTS-x86_64.cfg Source9: openeuler-21.03-aarch64.cfg Source10: openeuler-21.03-x86_64.cfg Source11: openeuler-21.09-aarch64.cfg Source12: openeuler-21.09-x86_64.cfg Source13: openeuler-20.09-aarch64.cfg Source14: openeuler-20.09-x86_64.cfg Source15: openeuler-22.09-aarch64.cfg Source16: openeuler-22.09-x86_64.cfg Source17: openeuler-22.03_LTS-aarch64.cfg Source18: openeuler-22.03_LTS-x86_64.cfg Source19: openeuler-23.03-aarch64.cfg Source20: openeuler-23.03-x86_64.cfg Source21: openeuler-22.03_LTS_SP1-aarch64.cfg Source22: openeuler-22.03_LTS_SP1-x86_64.cfg Source23: openeuler-20.03-sp3.tpl Source24: openeuler-20.03-sp2.tpl Source25: openeuler-20.03-sp1.tpl Source26: openeuler-20.03.tpl Source27: openeuler-20.09.tpl Source28: openeuler-21.03.tpl Source29: openeuler-21.09.tpl Source30: openeuler-22.03-sp1.tpl Source31: openeuler-22.03.tpl Source32: openeuler-22.09.tpl Source33: openeuler-23.03.tpl Source34: openeuler-22.03-sp2.tpl Source35: openeuler-22.03_LTS_SP2-aarch64.cfg Source36: openeuler-22.03_LTS_SP2-x86_64.cfg BuildArch: noarch Requires: openEuler-gpg-keys Requires: distribution-gpg-keys Requires(post): coreutils Requires(post): python3-dnf Requires(post): python3-hawkey Requires(post): system-release Requires(post): python3 Requires(post): sed Requires(pre): shadow-utils %description Config files which allow you to create chroots for: * Fedora * Epel * Mageia * Custom chroot * OpenSuse Tumbleweed and Leap * openEuler %prep %setup -q cp -pav $(dirname %{SOURCE1})/openeuler-* . %build # nothing to do here %install mkdir -p %{buildroot}%{_sysusersdir} mkdir -p %{buildroot}%{_sysconfdir}/mock/eol mkdir -p %{buildroot}%{_sysconfdir}/mock/templates cp -a etc/mock/*.cfg %{buildroot}%{_sysconfdir}/mock cp -a etc/mock/templates/*.tpl %{buildroot}%{_sysconfdir}/mock/templates cp -a etc/mock/eol/*cfg %{buildroot}%{_sysconfdir}/mock/eol cp -a openeuler-*.cfg %{buildroot}%{_sysconfdir}/mock cp -a openeuler-*.tpl %{buildroot}%{_sysconfdir}/mock/templates # generate files section with config - there is many of them echo "%defattr(0644, root, mock)" > %{name}.cfgs find %{buildroot}%{_sysconfdir}/mock -name "*.cfg" -o -name '*.tpl' \ | sed -e "s|^%{buildroot}|%%config(noreplace) |" >> %{name}.cfgs # 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 # get release ver such as: 22.03 ver=$(source /etc/os-release && echo $VERSION_ID) mock_arch=$(python3 -c "import dnf.rpm; import hawkey; print(dnf.rpm.basearch(hawkey.detect_arch()))") cfg=openeuler-$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 %dir %{_sysconfdir}/mock/templates %ghost %config(noreplace,missingok) %{_sysconfdir}/mock/default.cfg %changelog * Wed Jul 12 2023 lichaoran 38.3-2 - add openEuler 22.03-lts-sp2 configs * Fri May 19 2023 lichaoran 38.3-1 - Init package