Skip to content

Commit

Permalink
fix issue openSUSE#3073
Browse files Browse the repository at this point in the history
  • Loading branch information
gyr committed Apr 18, 2024
1 parent 58b3d97 commit 9538eca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ install:
cp -R config/* $(DESTDIR)$(sysconfdir)/$(package_name)
rm $(DESTDIR)$(sysconfdir)/$(package_name)/logrotate
install -Dpm0644 config/logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/$(package_name)
rm $(DESTDIR)$(sysconfdir)/$(package_name)/osrt-slsa-user.conf
for dir in dashboards datasources ; do ln -s $(pkgdatadir)/metrics/grafana/provisioning/$$dir.yaml \
$(DESTDIR)$(grafana_provisioning_dir)/$$dir/$(package_name).yaml ; done
sed -i "s|OSRT_DATA_DIR|$(pkgdatadir)|" \
Expand Down
2 changes: 2 additions & 0 deletions config/osrt-slsa-user.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Type Name ID GECOS [HOME]
u osrt-slsa - "User for openSUSE SLSA release tool" /var/lib/osrt-slsa
12 changes: 9 additions & 3 deletions dist/package/openSUSE-release-tools.spec
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,21 @@ OSC plugin for the staging workflow, see `osc staging --help`.

%build
%make_build
ls -la config/*
%sysusers_generate_pre config/osrt-slsa-user.conf %{name} %{name}.conf

%install
%make_install \
grafana_provisioning_dir="%{_sysconfdir}/grafana/provisioning" \
oscplugindir="%{osc_plugin_dir}" \
VERSION="%{version}"

ls -la config/*
install -Dpm0644 config/osrt-slsa-user.conf %{buildroot}%{_sysusersdir}/%{name}.conf

%pre -f %{name}.pre
%service_add_pre %{name}.service

%pre announcer
getent passwd osrt-announcer > /dev/null || \
useradd -r -m -s /sbin/nologin -c "user for openSUSE-release-tools-announcer" osrt-announcer
Expand Down Expand Up @@ -370,9 +378,6 @@ exit 0

%pre slsa-build-service
%service_add_pre %{services}
getent passwd osrt-slsa > /dev/null || \
useradd -r -d /var/lib/osrt-slsa -s /sbin/nologin -c "user for openSUSE-release-tools-slsa-build-service" osrt-slsa
exit 0

%post slsa-build-service
%service_add_post %{services}
Expand Down Expand Up @@ -469,6 +474,7 @@ exit 0
%{_datadir}/%{source_dir}/verify-build-and-generatelists
%{_datadir}/%{source_dir}/verify-repo-built-successful.py
%{_sysconfdir}/openSUSE-release-tools/ibsapi
%{_sysusersdir}/%{name}.conf
%{_unitdir}/[email protected]
%{_unitdir}/[email protected]
%{_unitdir}/[email protected]
Expand Down

0 comments on commit 9538eca

Please sign in to comment.