Name: alarm-manager
Summary: Alarm library
-Version: 0.4.39
+Version: 0.4.59
Release: 1
Group: System/Libraries
-License: Apache-2.0
+License: Apache License, Version 2.0
Source0: %{name}-%{version}.tar.gz
+Source101: packaging/alarm-server.service
+
Requires(post): /sbin/ldconfig
+Requires(post): /usr/bin/systemctl
Requires(postun): /sbin/ldconfig
+Requires(postun): /usr/bin/systemctl
+Requires(preun): /usr/bin/systemctl
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(tapi)
BuildRequires: pkgconfig(appsvc)
-BuildRequires: pkgconfig(gconf-2.0)
%description
Alarm Server and devel libraries
%prep
%setup -q
+# HACK_removed_dbus_glib_alarm_manager_object_info.diff
+#%patch0 -p1
+
%build
export LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed"
-%autogen
+%autogen --disable-static
dbus-binding-tool --mode=glib-server --prefix=alarm_manager ./alarm_mgr.xml > ./include/alarm-skeleton.h
dbus-binding-tool --mode=glib-client --prefix=alarm_manager ./alarm_mgr.xml > ./include/alarm-stub.h
dbus-binding-tool --mode=glib-server --prefix=alarm_client ./alarm-expire.xml > ./include/alarm-expire-skeleton.h
dbus-binding-tool --mode=glib-client --prefix=alarm_client ./alarm-expire.xml > ./include/alarm-expire-stub.h
-%configure
+%configure --disable-static
make %{?jobs:-j%jobs}
%install
+rm -rf %{buildroot}
%make_install
-install -D -m755 alarm-server_run %{buildroot}/etc/rc.d/init.d/alarm-server_run
-%post -p /sbin/ldconfig
+mkdir -p %{buildroot}/etc/init.d
+install -m 755 alarm-server_run %{buildroot}/etc/init.d
+
+mkdir -p %{buildroot}/%{_sysconfdir}/rc.d/rc3.d
+mkdir -p %{buildroot}/%{_sysconfdir}/rc.d/rc5.d
+ln -s ../init.d/alarm-server_run %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/S80alarm-server
+ln -s ../init.d/alarm-server_run %{buildroot}/%{_sysconfdir}/rc.d/rc5.d/S80alarm-server
+
+install -d %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
+install -m0644 %{SOURCE101} %{buildroot}%{_libdir}/systemd/system/
+ln -sf ../alarm-server.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/alarm-server.service
-%postun -p /sbin/ldconfig
+
+%preun -n alarm-server
+if [ $1 == 0 ]; then
+ systemctl stop alarm-server.service
+fi
%post -n alarm-server
+/sbin/ldconfig
+
+vconftool set -t int db/system/timechange 0 -i
+vconftool set -t int memory/system/timechanged 0 -i -g 5000
-ln -s /etc/rc.d/init.d/alarm-server_run /etc/rc.d/rc3.d/S80alarm-server
-ln -s /etc/rc.d/init.d/alarm-server_run /etc/rc.d/rc5.d/S80alarm-server
+systemctl daemon-reload
+if [ $1 == 1 ]; then
+ systemctl restart alarm-server.service
+fi
%postun -n alarm-server
-rm -f /etc/rc.d/rc3.d/S80alarm-server
-rm -f /etc/rc.d/rc5.d/S80alarm-server
+/sbin/ldconfig
+systemctl daemon-reload
+if [ "$1" == 1 ]; then
+ systemctl restart net-config.service
+fi
%files -n alarm-server
-/etc/rc.d/init.d/alarm-server_run
-%{_bindir}/*
+%manifest alarm-server.manifest
+%attr(0755,root,root) %{_bindir}/alarm-server
+%attr(0755,root,root) %{_sysconfdir}/init.d/alarm-server_run
+%attr(0755,root,root) %{_sysconfdir}/rc.d/rc3.d/S80alarm-server
+%attr(0755,root,root) %{_sysconfdir}/rc.d/rc5.d/S80alarm-server
+%{_libdir}/systemd/system/multi-user.target.wants/alarm-server.service
+%{_libdir}/systemd/system/alarm-server.service
%files -n libalarm
-%{_libdir}/*.so.*
-
+%manifest alarm-lib.manifest
+%attr(0644,root,root) %{_libdir}/libalarm.so.0.0.0
+%{_libdir}/libalarm.so.0
%files -n libalarm-devel
%{_includedir}/*.h
%{_libdir}/pkgconfig/*.pc
-%{_libdir}/*.so
-
+%{_libdir}/libalarm.so