Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[aarch64] Do not hardcode libdir. Fix location of systemd unit files.…
… Contributes to JB#49681
  • Loading branch information
mlehtima committed Jul 7, 2020
1 parent 8f0b8a7 commit a80710b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion rpm/dsme.service → rpm/dsme.service.in
Expand Up @@ -13,7 +13,7 @@ Type=notify
Environment=BOOTSTATE=USER
EnvironmentFile=-/run/systemd/boot-status/bootstate
EnvironmentFile=-/var/lib/environment/dsme/*.conf
ExecStart=/usr/sbin/dsme -- $DSME_MODULES_PRE -p /usr/lib/dsme/startup.so $DSME_MODULES_POST --systemd
ExecStart=/usr/sbin/dsme -- $DSME_MODULES_PRE -p @LIBDIR@/dsme/startup.so $DSME_MODULES_POST --systemd
Restart=always
RestartSec=1
StartLimitInterval=600
Expand Down
19 changes: 10 additions & 9 deletions rpm/dsme.spec
Expand Up @@ -3,9 +3,9 @@ Summary: Device State Management Entity
Version: 0.81.0
Release: 0
License: LGPLv2+
URL: https://github.com/nemomobile/dsme
URL: https://git.sailfishos.org/mer-core/dsme
Source0: %{name}-%{version}.tar.gz
Source1: dsme.service
Source1: dsme.service.in
Source2: dsme-rpmlintrc
Requires: systemd
Requires: ngfd
Expand Down Expand Up @@ -45,7 +45,7 @@ Requires: dbus
Test cases and xml test description for DSME

%prep
%setup -q -n %{name}-%{version}
%autosetup -n %{name}-%{version}

%build
unset LD_AS_NEEDED
Expand All @@ -60,17 +60,18 @@ test -e Makefile || (%configure --disable-static \
--disable-validatorlistener \
--enable-abootsettings)

make %{?_smp_mflags}
%make_build

%install
rm -rf %{buildroot}
%make_install

install -d %{buildroot}%{_sysconfdir}/dsme/
install -D -m 644 reboot-via-dsme.sh %{buildroot}/etc/profile.d/reboot-via-dsme.sh
install -D -m 644 %{SOURCE1} %{buildroot}/lib/systemd/system/%{name}.service
install -d %{buildroot}/lib/systemd/system/multi-user.target.wants/
ln -s ../%{name}.service %{buildroot}/lib/systemd/system/multi-user.target.wants/%{name}.service
install -d %{buildroot}%{_unitdir}
sed -e "s|@LIBDIR@|%{_libdir}|g" %{SOURCE1} > %{buildroot}%{_unitdir}/%{name}.service
install -d %{buildroot}%{_unitdir}/multi-user.target.wants/
ln -s ../%{name}.service %{buildroot}%{_unitdir}/multi-user.target.wants/%{name}.service
install -d %{buildroot}/var/lib/dsme
[ ! -f %{buildroot}/var/lib/dsme/alarm_queue_status ] && echo 0 > %{buildroot}/var/lib/dsme/alarm_queue_status

Expand All @@ -94,8 +95,8 @@ systemctl daemon-reload || :
%dir %{_sysconfdir}/dsme
%config %{_sysconfdir}/dbus-1/system.d/dsme.conf
%license debian/copyright COPYING
/lib/systemd/system/%{name}.service
/lib/systemd/system/multi-user.target.wants/%{name}.service
%{_unitdir}/%{name}.service
%{_unitdir}/multi-user.target.wants/%{name}.service
/var/lib/dsme
%config(noreplace) /var/lib/dsme/alarm_queue_status
/etc/profile.d/reboot-via-dsme.sh
Expand Down

0 comments on commit a80710b

Please sign in to comment.