%define major 0
%define minor 1
-%define patchlevel 0
+%define patchlevel 2
+%define CHECK_ZIGBEE_PRIVILEGE False
Name: zigbee-manager
Version: %{major}.%{minor}.%{patchlevel}
Summary: ZigBee Daemon
Group: System/Network
Source0: %{name}-%{version}.tar.gz
+Source1: org.tizen.zigbee.service
+Source2: zigbee.conf
BuildRequires: cmake
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(gio-unix-2.0)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(vconf)
+# if image creater does not know 'network_fw'
+Requires: security-config
%description
Description: ZigBee Daemon
%prep
%setup -q
+chmod 644 %{SOURCE1}
+cp -a %{SOURCE1} .
+%if %{CHECK_ZIGBEE_PRIVILEGE} == "True"
+chmod 644 %{SOURCE2}
+cp -a %{SOURCE2} .
+%endif
+
%build
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DVERSION=%{version} \
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+ -DVERSION=%{version} \
+ -DLIB_INSTALL_DIR=%{_libdir} \
+ -DUNIT_INSTALL_DIR=%{_unitdir} \
make %{?_smp_mflags}
%install
-
%make_install
-# For debug, do not execute zigbee daemon automatically.
-#mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
-#ln -s %{_libdir}/systemd/system/zigbee-daemon.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/zigbee-daemon.service
+# Do not execute daemon on boot time
+#mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
+#ln -s %{_unitdir}/zigbee-daemon.service %{buildroot}%{_unitdir}/multi-user.target.wants/zigbee-daemon.service
+
+mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services/
+mkdir -p %{buildroot}%{_datadir}/dbus-1/system.d/
+cp %{SOURCE1} %{buildroot}%{_datadir}/dbus-1/system-services/org.tizen.zigbee.service
+%if %{CHECK_ZIGBEE_PRIVILEGE} == "True"
+cp %{SOURCE2} %{buildroot}%{_datadir}/dbus-1/system.d/zigbee.conf
+%endif
%post -p /sbin/ldconfig
%files
%manifest zigbee-daemon.manifest
-%defattr(644,system,system,-)
-%attr(755,system,system) %{_bindir}/zigbee-daemon
-# For debug, do not execute zigbee daemon automatically.
-#%{_libdir}/systemd/system/zigbee-daemon.service
-#%{_libdir}/systemd/system/multi-user.target.wants/zigbee-daemon.service
-%{_datadir}/license/zigbee-daemon
+%defattr(-,root,root,-)
+%attr(755,network_fw,network_fw) %{_bindir}/zigbee-daemon
+%{_unitdir}/zigbee-daemon.service
+#%{_unitdir}/multi-user.target.wants/zigbee-daemon.service
+%attr(644,root,root) %{_datadir}/dbus-1/system-services/*
+%if %{CHECK_ZIGBEE_PRIVILEGE} == "True"
+%{_datadir}/dbus-1/system.d/zigbee.conf
+%endif
+%license LICENSE
%files -n zigbee-lib
-#%manifest lib-zigbee/lib-zigbee.manifest
%defattr(644,system,system,-)
%{_libdir}/libzigbee-lib.so*
-%{_datadir}/license/zigbee-lib
+%license LICENSE
%files -n zigbee-lib-devel
%defattr(644,system,system,-)