Remove 'warning: user network_fw does not exist - using root' warning
[platform/core/connectivity/zigbee-manager.git] / packaging / zigbee-manager.spec
1 %define major 0
2 %define minor 1
3 %define patchlevel 2
4 %define CHECK_ZIGBEE_PRIVILEGE False
5
6 Name:           zigbee-manager
7 Version:        %{major}.%{minor}.%{patchlevel}
8 Release:        1
9 License:        Apache-2.0
10 Summary:        ZigBee Daemon
11 Group:          System/Network
12 Source0:        %{name}-%{version}.tar.gz
13 Source1:        org.tizen.zigbee.service
14 Source2:        zigbee.conf
15 BuildRequires:  cmake
16 BuildRequires:  pkgconfig(dlog)
17 BuildRequires:  pkgconfig(gio-2.0)
18 BuildRequires:  pkgconfig(gio-unix-2.0)
19 BuildRequires:  pkgconfig(glib-2.0)
20 BuildRequires:  pkgconfig(vconf)
21 # if image creater does not know 'network_fw'
22 Requires: security-config
23
24 %description
25 Description: ZigBee Daemon
26
27 %package -n zigbee-lib
28 Summary:         ZigBee library
29 Group:           System/Libraries
30 BuildRequires:   pkgconfig(glib-2.0)
31 BuildRequires:   pkgconfig(dlog)
32
33 %description -n zigbee-lib
34 ZigBee library
35
36 %package -n zigbee-lib-devel
37 Summary:         ZigBee library (devel)
38 Group:           System/Libraries
39 Requires:        %{name} = %{version}
40
41 %description -n zigbee-lib-devel
42 ZigBee library (devel)
43
44 %prep
45 %setup -q
46
47 chmod 644 %{SOURCE1}
48 cp -a %{SOURCE1} .
49 %if %{CHECK_ZIGBEE_PRIVILEGE} == "True"
50 chmod 644 %{SOURCE2}
51 cp -a %{SOURCE2} .
52 %endif
53
54 %build
55 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
56         -DVERSION=%{version} \
57         -DLIB_INSTALL_DIR=%{_libdir} \
58         -DUNIT_INSTALL_DIR=%{_unitdir} \
59
60 make %{?_smp_mflags}
61
62 %install
63 %make_install
64
65 # Do not execute daemon on boot time
66 #mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
67 #ln -s %{_unitdir}/zigbee-daemon.service %{buildroot}%{_unitdir}/multi-user.target.wants/zigbee-daemon.service
68
69 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services/
70 mkdir -p %{buildroot}%{_datadir}/dbus-1/system.d/
71 cp %{SOURCE1} %{buildroot}%{_datadir}/dbus-1/system-services/org.tizen.zigbee.service
72 %if %{CHECK_ZIGBEE_PRIVILEGE} == "True"
73 cp %{SOURCE2} %{buildroot}%{_datadir}/dbus-1/system.d/zigbee.conf
74 %endif
75
76 %post -p /sbin/ldconfig
77
78 %postun -p /sbin/ldconfig
79
80 %files
81 %manifest zigbee-daemon.manifest
82 %defattr(-,root,root,-)
83 %attr(755,network_fw,network_fw) %{_bindir}/zigbee-daemon
84 %{_unitdir}/zigbee-daemon.service
85 #%{_unitdir}/multi-user.target.wants/zigbee-daemon.service
86 %attr(644,root,root) %{_datadir}/dbus-1/system-services/*
87 %if %{CHECK_ZIGBEE_PRIVILEGE} == "True"
88 %{_datadir}/dbus-1/system.d/zigbee.conf
89 %endif
90 %license LICENSE
91
92 %files -n zigbee-lib
93 %defattr(644,system,system,-)
94 %{_libdir}/libzigbee-lib.so*
95 %license LICENSE
96
97 %files -n zigbee-lib-devel
98 %defattr(644,system,system,-)
99 %{_includedir}/zigbee/lib/*.h
100 %{_includedir}/zigbee/common/*.h
101 %{_libdir}/pkgconfig/zigbee-lib.pc
102 %{_libdir}/libzigbee-lib.so