blob: 0eaecd190cde36e9c1376d120e9cc2fc9ca3dcc1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
# keep gid same with upstream
%global mockgid 135
Name: mock-core-configs
Version: 38.3
Release: 4
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
Source37: openeuler-24.03-aarch64.cfg
Source38: openeuler-24.03-x86_64.cfg
Source39: openeuler-24.03.tpl
Source40: openeuler-20.03_LTS_SP4-x86_64.cfg
Source41: openeuler-20.03_LTS_SP4-aarch64.cfg
Source42: openeuler-20.03-sp4.tpl
Source43: openeuler-22.03_LTS_SP3-aarch64.cfg
Source44: openeuler-22.03_LTS_SP3-x86_64.cfg
Source45: openeuler-22.03-sp3.tpl
Source46: openeuler-22.03_LTS_SP4-aarch64.cfg
Source47: openeuler-22.03_LTS_SP4-x86_64.cfg
Source48: openeuler-22.03-sp4.tpl
Source49: openeuler-24.09-x86_64.cfg
Source50: openeuler-24.09-aarch64.cfg
Source51: openeuler-24.09.tpl
Requires: mock >= 5.6
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
* Tue Nov 05 2024 jinzhiguang <jinzhiguang@kylinos.cn> - 38.3-4
- fix wrong include in 24.03 and 24.09 configs
* Tue Oct 22 2024 shafeipaozi <sunbo.oerv@isrc.iscas.ac.cn> - 38.3-3
- add openEuler 24.03 configs
* Wed Jul 12 2023 lichaoran <pkwarcraft@hotmail.com> 38.3-2
- add openEuler 22.03-lts-sp2 configs
* Fri May 19 2023 lichaoran <pkwarcraft@hotmail.com> 38.3-1
- Init package
|