11#
22# spec file for package MirrorCache
33#
4- # Copyright (c) 2021 SUSE LLC
4+ # Copyright (c) 2021,2025 SUSE LLC
55#
66# All modifications and additions to the file contributed by third parties
77# remain the property of their copyright owners, unless otherwise agreed
1919%define mirrorcache_services_restart mirrorcache.service mirrorcache-backstage.service mirrorcache-backstage-hashes.service mirrorcache-subtree.service
2020%define mirrorcache_services %{mirrorcache_services_restart } mirrorcache-hypnotoad.service
2121%define assetpack_requires perl(CSS::Minifier::XS) >= 0.01 perl(JavaScript::Minifier::XS) >= 0.11 perl(Mojolicious::Plugin::AssetPack) >= 1.36 perl(IO::Socket::SSL)
22- %define main_requires %{assetpack_requires } perl(Carp) perl(DBD::Pg) >= 3.7.4 perl(DBI) >= 1.632 perl(DBIx::Class) >= 0.082801 perl(DBIx::Class::DynamicDefault) perl(DateTime) perl(Encode) perl(Time::Piece) perl(Time::Seconds) perl(Time::ParseDate) perl(DateTime::Format::Pg) perl(Exporter) perl(File::Basename) perl(LWP::UserAgent) perl(Mojo::Base) perl(Mojo::ByteStream) perl(Mojo::IOLoop) perl(Mojo::JSON ) perl(Mojo::Pg) perl(Mojo::URL) perl(Mojo::Util) perl(Mojolicious::Commands) perl(Mojolicious::Plugin) perl(Mojolicious::Plugin::RenderFile) perl(Mojolicious::Static) perl(Net::OpenID::Consumer) perl(POSIX) perl(Sort::Versions) perl(URI::Escape) perl(XML::Writer) perl(base) perl(constant) perl(diagnostics) perl(strict) perl(warnings) shadow rubygem(sass) perl(Net::DNS) perl(LWP::Protocol::https) perl(Digest::SHA) perl(Config::IniFiles)
22+ %define common_requires perl(Carp) perl(DBD::Pg) >= 3.7.4 perl(DBI) >= 1.632 perl(DBIx::Class) >= 0.082801 perl(DBIx::Class::DynamicDefault) perl(DateTime) perl(Encode) perl(Time::Piece) perl(Time::Seconds) perl(Time::ParseDate) perl(DateTime::Format::Pg) perl(Exporter) perl(File::Basename) perl(LWP::UserAgent) perl(Mojo::Base) perl(Mojo::ByteStream) perl(Mojo::IOLoop) perl(Mojo::JSON ) perl(Mojo::Pg) perl(Mojo::URL) perl(Mojo::Util) perl(Mojolicious::Commands) perl(Mojolicious::Plugin) perl(POSIX) perl(Sort::Versions) perl(URI::Escape) perl(XML::Writer) perl(base) perl(constant) perl(diagnostics) perl(strict) perl(warnings) shadow perl(Net::DNS) perl(LWP::Protocol::https) perl(Digest::SHA) perl(Config::IniFiles)
23+ %define main_requires %{assetpack_requires } perl(Mojolicious::Plugin::RenderFile) perl(Mojolicious::Static) perl(Net::OpenID::Consumer) rubygem(sass)
2324%define build_requires %{assetpack_requires } rubygem(sass) tidy sysuser-shadow sysuser-tools
2425Name: MirrorCache
25- Version: 0.1
26+ Version: 0
2627Release: 0
2728Summary: WebApp to redirect and manage mirrors
2829License: GPL-2.0 -or-later
@@ -32,11 +33,13 @@ Source0: %{name}-%{version}.tar.xz
3233Source1: cache.tar.xz
3334Source2: %{name }-user.conf
3435Source3: %{name }-tmpfilesd.conf
36+ Source4: %{name }-Exec-user.conf
37+ Source5: %{name }-Exec-tmpfilesd.conf
3538# use update-cache (or tools/generate-packed-assets) to generate/update cache.tar.xz
3639Source101: update-cache.sh
3740BuildRequires: %{build_requires }
41+ Requires: MirrorCache-common
3842Requires: %{main_requires }
39- Requires: perl(Minion) >= 10.0
4043BuildArch: noarch
4144%sysusers_requires
4245
@@ -49,6 +52,7 @@ Mirror redirector web service, which automatically scans the main server and mir
4952%build
5053# make {?_smp_mflags}
5154%sysusers_generate_pre %{SOURCE2 } %{name }
55+ %sysusers_generate_pre %{SOURCE4 } %{name }-Exec
5256
5357%check
5458
@@ -63,6 +67,8 @@ ln -s ../sbin/service %{buildroot}%{_sbindir}/rcmirrorcache-backstage-hashes
6367ln -s ../sbin/service %{buildroot }%{_sbindir }/rcmirrorcache-subtree
6468install -D -m 0644 %{SOURCE2 } %{buildroot }%{_sysusersdir }/%{name }.conf
6569install -D -m 0644 %{SOURCE3 } %{buildroot }%{_tmpfilesdir }/%{name }.conf
70+ install -D -m 0644 %{SOURCE4 } %{buildroot }%{_sysusersdir }/%{name }-Exec.conf
71+ install -D -m 0644 %{SOURCE5 } %{buildroot }%{_tmpfilesdir }/%{name }-Exec.conf
6672
6773%pre -f %{name }.pre
6874%service_add_pre %{mirrorcache_services }
@@ -79,25 +85,74 @@ install -D -m 0644 %{SOURCE3} %{buildroot}%{_tmpfilesdir}/%{name}.conf
7985%service_del_postun _without_restart mirrorcache-hypnotoad.service
8086
8187%files
82- %doc README.md
83- %license LICENSE
88+ %{_sysusersdir }/%{name }.conf
89+ %{_tmpfilesdir }/%{name }.conf
90+ %config(noreplace) %attr(-,root,mirrorcache) %{_sysconfdir }/mirrorcache/
91+ %ghost %dir %attr(0750,mirrorcache,-) %{_localstatedir }/lib/mirrorcache/
8492%{_sbindir }/rcmirrorcache
8593%{_sbindir }/rcmirrorcache-hypnotoad
8694%{_sbindir }/rcmirrorcache-backstage
8795%{_sbindir }/rcmirrorcache-backstage-hashes
8896%{_sbindir }/rcmirrorcache-subtree
89- %{_sysusersdir }/%{name }.conf
90- %{_tmpfilesdir }/%{name }.conf
91- %config(noreplace) %attr(-,root,mirrorcache) %{_sysconfdir }/mirrorcache/
92- %ghost %dir %attr(0750,mirrorcache,-) %{_localstatedir }/lib/mirrorcache/
93- # init
94- %dir %{_unitdir }
9597%{_unitdir }/mirrorcache.service
9698%{_unitdir }/mirrorcache-hypnotoad.service
9799%{_unitdir }/mirrorcache-backstage.service
98100%{_unitdir }/mirrorcache-backstage-hashes.service
99101%{_unitdir }/mirrorcache-subtree.service
102+
103+ %changelog
104+
105+ %package common
106+
107+ Summary: MirrorCache shared files
108+ License: GPL-2.0-or-later
109+ Group: Productivity/Networking/Web/Servers
110+ URL: https://github.com/openSUSE/MirrorCache
111+ Requires: %{common_requires}
112+ Requires: perl(Minion) >= 10.0
113+ BuildArch: noarch
114+ %sysusers_requires
115+
116+ %description common
117+ Shared files for MirrorCache packages
118+
119+ %files common
120+ %doc README.md
121+ %license LICENSE
122+ %{_sbindir}/rcmirrorcache
123+ %dir %{_unitdir}
100124# web libs
101125%{_datadir}/mirrorcache
102126
103- %changelog
127+ %package Exec
128+
129+ Summary: MirrorCache worker to execute scheduled tasks
130+ License: GPL-2.0-or-later
131+ Group: Productivity/Networking/Web/Servers
132+ URL: https://github.com/openSUSE/MirrorCache
133+ Requires: MirrorCache-common
134+ BuildArch: noarch
135+ %sysusers_requires
136+
137+ %description Exec
138+ MirrorCache worker to execute scheduled shell scripts
139+
140+ %files Exec
141+ %{_sysusersdir}/%{name}-Exec.conf
142+ %{_tmpfilesdir}/%{name}-Exec.conf
143+ %ghost %dir %attr(0750,mirrorcache,-) %{_localstatedir}/lib/mirrorcache-exec/
144+ %{_unitdir}/mirrorcache-backstage-exec.service
145+
146+ %pre -f %{name}-Exec.pre Exec
147+ %service_add_pre mirrorcache-backstage-exec.service
148+
149+ %post Exec
150+ %tmpfiles_create %{_tmpfilesdir}/%{name}-Exec.conf
151+ %service_add_post mirrorcache-backstage-exec.service
152+
153+ %preun Exec
154+ %service_del_preun mirrorcache-backstage-exec.service
155+
156+ %postun Exec
157+ %service_del_postun mirrorcache-backstage-exec.service
158+
0 commit comments