Skip to content

Commit 5568e03

Browse files
committed
Adjust spec file with MirrorCache-Exec
[ci skip]
1 parent 949d4db commit 5568e03

3 files changed

Lines changed: 74 additions & 13 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Type Path Mode UID GID Age Argument
2+
d /var/lib/mirrorcache-exec 0750 mirrorcache-exec mirrorcache - -
3+
d /run/mirrorcache-exec 0750 mirrorcache-exec mirrorcache - -
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Type Name ID GECOS [HOME]
2+
u mirrorcache-exec - "MirrorCache" /var/lib/mirrorcache-exec
3+
g mirrorcache

dist/rpm/MirrorCache.spec

Lines changed: 68 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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
@@ -19,10 +19,11 @@
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
2425
Name: MirrorCache
25-
Version: 0.1
26+
Version: 0
2627
Release: 0
2728
Summary: WebApp to redirect and manage mirrors
2829
License: GPL-2.0-or-later
@@ -32,11 +33,13 @@ Source0: %{name}-%{version}.tar.xz
3233
Source1: cache.tar.xz
3334
Source2: %{name}-user.conf
3435
Source3: %{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
3639
Source101: update-cache.sh
3740
BuildRequires: %{build_requires}
41+
Requires: MirrorCache-common
3842
Requires: %{main_requires}
39-
Requires: perl(Minion) >= 10.0
4043
BuildArch: 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
6367
ln -s ../sbin/service %{buildroot}%{_sbindir}/rcmirrorcache-subtree
6468
install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}.conf
6569
install -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

Comments
 (0)