Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jb46287' into 'master'
Own /etc/localtime and link it to proper place.

See merge request mer-core/timed!10
  • Loading branch information
Matti Kosola committed Aug 6, 2019
2 parents f709e78 + e326400 commit 9fc5145
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rpm/timed-qt5.spec
Expand Up @@ -92,6 +92,9 @@ chmod 755 %{buildroot}%{_oneshotdir}/setcaps-%{name}.sh
# Initial links are done in the post section
install -d %{buildroot}/var/lib/timed
touch %{buildroot}/var/lib/timed/localtime
# Make /etc/localtime a link to /var/lib/timed/localtime to make system time zone follow timed.
install -d %{buildroot}%{_sysconfdir}
ln -sf /var/lib/timed/localtime %{buildroot}%{_sysconfdir}/localtime
%statefs_provider_install inout timed %{_sysconfdir}/timed-statefs.conf

%pre
Expand All @@ -100,11 +103,9 @@ groupadd-user timed
%statefs_pre

%post
# Make /etc/localtime a link to /var/lib/timed/localtime to make system time zone follow timed.
# Remove existing link so that copying the UTC file will not overwrite anything during reinstall.
rm -f /var/lib/timed/localtime
cp /usr/share/zoneinfo/UTC /var/lib/timed/localtime
ln -sf /var/lib/timed/localtime /etc/localtime

/sbin/ldconfig
add-oneshot --now setcaps-%{name}.sh
Expand Down Expand Up @@ -138,6 +139,7 @@ fi
%license COPYING copyright
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/%{name}.conf
%config(noreplace) %{_sysconfdir}/%{name}.rc
%config(noreplace) %{_sysconfdir}/localtime
%{_bindir}/%{name}
%{_libdir}/lib%{name}.so.*
%{_libdir}/libtimed-voland-qt5.so.*
Expand Down

0 comments on commit 9fc5145

Please sign in to comment.