summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-07-09 07:17:26 +0000
committerCoprDistGit <infra@openeuler.org>2023-07-09 07:17:26 +0000
commit1e3dfc60e56f16c2fdbd9b7428dc645d3bbe8ca4 (patch)
treeff5f6798a72cac150b31e49fb640fa82ca03e2a4
parent7766c8c67efdebfd5e6457ad87bbcea4b15afaf6 (diff)
automatic import of mock-core-configs
-rw-r--r--.gitignore1
-rw-r--r--mock-core-configs.spec98
-rw-r--r--sources1
3 files changed, 100 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..6f30407 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/mock-core-configs-31.6.tar.gz
diff --git a/mock-core-configs.spec b/mock-core-configs.spec
new file mode 100644
index 0000000..f7eecba
--- /dev/null
+++ b/mock-core-configs.spec
@@ -0,0 +1,98 @@
+# keep gid same with upstream
+%global mockgid 135
+
+Name: mock-core-configs
+Version: 31.6
+Release: 1
+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
+Source: https://github.com/rpm-software-management/mock/releases/download/%{name}-%{version}-1/%{name}-%{version}.tar.gz
+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
+
+
+%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
+
+# 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
+* Fri May 19 2023 lichaoran <pkwarcraft@hotmail.com> 36.1-1
+- Init package
diff --git a/sources b/sources
new file mode 100644
index 0000000..acbe2bd
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+55ed79b6428b95763c5f27861507aaa2 mock-core-configs-31.6.tar.gz