Do not use systemd socket mechanism
authorCorentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
Thu, 16 Jan 2014 14:28:45 +0000 (15:28 +0100)
committerCorentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
Thu, 16 Jan 2014 15:12:29 +0000 (16:12 +0100)
Notifications daemon discusses with its clients using secure sockets.
Secure sockets are not adapted to systemd socket.

Now notifications daemon is started at boot time.

Change-Id: If6ee8164df1d1db18b973da62d5b066d06c44524
Signed-off-by: Corentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
Makefile.am
configure.ac
notifications.service.in
packaging/notification-service.spec

index 28b715c..60a8844 100644 (file)
@@ -23,12 +23,8 @@ bluetooth_notification_client_CFLAGS = -I. $(TIZEN_CFLAGS)
 bluetooth_notification_client_LDADD = $(TIZEN_LIBS)
 
 SCRIPT_IN_FILES = \
-     notifications.service.in \
-     notifications.socket.in
+     notifications.service.in
 
 install-data-hook:
-       $(mkinstalldirs) $(DESTDIR)/usr/lib/systemd/system/sockets.target.wants
+       $(mkinstalldirs) $(DESTDIR)/usr/lib/systemd/system/
        install -m 0644 notifications.service $(DESTDIR)/usr/lib/systemd/system/notifications.service
-       install -m 0644 notifications.socket $(DESTDIR)/usr/lib/systemd/system/notifications.socket
-       ln -fs ../notifications.socket $(DESTDIR)/usr/lib/systemd/system/sockets.target.wants/notifications.socket
-
index 56dec67..9f7eae1 100644 (file)
@@ -14,6 +14,6 @@ PKG_CHECK_MODULES([TIZEN], [eina ecore com-core notification dbus-1 bluetooth-ap
 AC_SUBST(TIZEN_CFLAGS)
 AC_SUBST(TIZEN_LIBS)
 
-AC_CONFIG_FILES([Makefile notifications.service notifications.socket])
+AC_CONFIG_FILES([Makefile notifications.service])
 AC_PROG_RANLIB([ranlib])
 AC_OUTPUT
index 47db370..ebbd62c 100644 (file)
@@ -1,2 +1,8 @@
+[Unit]
+Description=Notifications daemon
+
 [Service]
 ExecStart=/usr/bin/notification-service
+
+[Install]
+WantedBy=graphical.target
index e48dfa8..ecea933 100644 (file)
@@ -9,10 +9,11 @@ BuildRequires: pkgconfig(eina)
 BuildRequires: pkgconfig(ecore) 
 BuildRequires: pkgconfig(com-core) 
 BuildRequires: pkgconfig(notification)
-BuildRequires: dbus-devel
+BuildRequires: pkgconfig(dbus-1)
 BuildRequires: pkgconfig(dbus-glib-1)
-BuildRequires: bluetooth-frwk-devel
-BuildRequires: bundle-devel
+BuildRequires: pkgconfig(bluetooth-api)
+BuildRequires: pkgconfig(bundle)
+%{?systemd_requires}
 
 %description
 Headless notification service that collects incoming notifications from the
@@ -28,22 +29,28 @@ This package provides unit test used in the development of the notification serv
 %prep
 %setup -q -n %{name}-%{version}
 
-%define PREFIX %{_prefix}/apps/
-
 %build
 %autogen
 make %{?_smp_mflags}
 
 %install
-rm -rf %{buildroot}
 %make_install
+%install_service graphical.target.wants notifications.service
+
+%post
+%systemd_post notifications.service
+
+%preun
+%systemd_preun notifications.service
+
+%postun
+%systemd_postun notifications.service
 
 %files
 %defattr(-,root,root,-)
 %{_bindir}/notification-service
-%{_libdir}/systemd/system/notifications.service
-%{_libdir}/systemd/system/notifications.socket
-%{_libdir}/systemd/system/sockets.target.wants/notifications.socket
+%{_unitdir}/notifications.service
+%{_unitdir}/graphical.target.wants/notifications.service
 
 %files test
 %defattr(-,root,root,-)