Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[boot] service file uses new boot targets
Signed-off-by: Pekka Lundstrom <pekka.lundstrom@jollamobile.com>
  • Loading branch information
Pekka Lundstrom committed Jul 4, 2013
1 parent 47063ae commit 1a07ac3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/connectionagent.service
@@ -1,6 +1,7 @@
[Unit]
Description=Connection Agent
Requires=dbus.service
After=pre-user-session.target

[Service]
ExecStart=/usr/bin/connectionagent
Expand All @@ -9,4 +10,4 @@ BusName=com.jolla.Connectiond
Restart=always

[Install]
WantedBy=jolla-middleware.target
WantedBy=user-session.target
21 changes: 21 additions & 0 deletions rpm/connectionagent-qt5.spec
Expand Up @@ -17,6 +17,8 @@ URL: http://github.com/lpotter/connectionagent
Source0: %{name}-%{version}.tar.bz2
Source100: connectionagent-qt5.yaml
Requires: connman-qt5-declarative
Requires: systemd
Requires: systemd-user-session-targets
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(connman-qt5)
Expand Down Expand Up @@ -73,15 +75,34 @@ rm -rf %{buildroot}
%qmake_install

# >> install post
mkdir -p %{buildroot}%{_libdir}/systemd/user/user-session.target.wants
ln -s ../connectionagent.service %{buildroot}%{_libdir}/systemd/user/user-session.target.wants/
# << install post

%post
# >> post
if [ "$1" -ge 1 ]; then
systemctl-user daemon-reload || :
systemctl-user restart connectionagent.service || :
fi
# << post

%postun
# >> postun
if [ "$1" -eq 0 ]; then
systemctl-user stop connectionagent.service || :
systemctl-user daemon-reload || :
fi
# << postun

%files
%defattr(-,root,root,-)
%{_bindir}/connectionagent
%{_datadir}/dbus-1/services/com.jolla.Connectiond.service
%{_libdir}/systemd/user/connectionagent.service
%{_sysconfdir}/dbus-1/session.d/connectionagent.conf
# >> files
%{_libdir}/systemd/user/user-session.target.wants/connectionagent.service
# << files

%files declarative
Expand Down
2 changes: 2 additions & 0 deletions rpm/connectionagent-qt5.yaml
Expand Up @@ -13,6 +13,8 @@ Sources:
- "%{name}-%{version}.tar.bz2"
Requires:
- connman-qt5-declarative
- systemd
- systemd-user-session-targets
Provides:
- connectionagent > 0.7.6
Obsoletes:
Expand Down

0 comments on commit 1a07ac3

Please sign in to comment.