Fix build issue on 64bit environment
[platform/core/connectivity/zigbee-manager.git] / packaging / zigbee-manager.spec
index 152b457..79e1b2a 100644 (file)
@@ -1,6 +1,7 @@
 %define major 0
-%define minor 0
-%define patchlevel 2
+%define minor 1
+%define patchlevel 0
+%define CHECK_ZIGBEE_PRIVILEGE False
 
 Name:           zigbee-manager
 Version:        %{major}.%{minor}.%{patchlevel}
@@ -9,6 +10,8 @@ License:        Apache-2.0
 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)
@@ -36,38 +39,37 @@ Requires:        %{name} = %{version}
 %description -n zigbee-lib-devel
 ZigBee library (devel)
 
-%package -n zigbee-client
-Summary:         ZigBee Client API
-Group:           System/Libraries
-BuildRequires:   pkgconfig(glib-2.0)
-BuildRequires:   pkgconfig(dlog)
-
-%description -n zigbee-client
-ZigBee Client library
-
-%package -n zigbee-client-devel
-Summary:         ZigBee Client API (devel)
-Group:           System/Libraries
-Requires:        %{name} = %{version}
-
-%description -n zigbee-client-devel
-ZigBee Client library (devel)
-
 %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
 
@@ -77,27 +79,15 @@ make %{?_smp_mflags}
 %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
+%{_unitdir}/zigbee-daemon.service
+#%{_unitdir}/multi-user.target.wants/zigbee-daemon.service
 %{_datadir}/license/zigbee-daemon
-
-%files -n zigbee-client
-#%manifest zigbee-client/zigbee-client.manifest
-%defattr(644,system,system,-)
-%{_libdir}/libzigbee-client.so*
-%{_datadir}/license/zigbee-client
-#%attr(755,system,system) %{_testbindir}/zigbeetest
-
-%files -n zigbee-client-devel
-%defattr(644,system,system,-)
-%{_includedir}/zigbee/client/*.h
-%{_includedir}/zigbee/common/*.h
-%{_libdir}/pkgconfig/zigbee-client.pc
-%{_libdir}/libzigbee-client.so
+%attr(644,root,root) %{_datadir}/dbus-1/system-services/*
+%if %{CHECK_ZIGBEE_PRIVILEGE} == "True"
+%{_datadir}/dbus-1/system.d/zigbee.conf
+%endif
 
 %files -n zigbee-lib
-#%manifest lib-zigbee/lib-zigbee.manifest
 %defattr(644,system,system,-)
 %{_libdir}/libzigbee-lib.so*
 %{_datadir}/license/zigbee-lib