6a2b4c5f2f965c0239addfda8054eb5dcf1abc91
[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
22 %if 0%{?gtests:1}
23 BuildRequires:  pkgconfig(gmock)
24 %endif
25
26 # if image creater does not know 'network_fw'
27 Requires: security-config
28
29 %description
30 Description: ZigBee Daemon
31
32 %package -n zigbee-lib
33 Summary:         ZigBee library
34 Group:           System/Libraries
35 BuildRequires:   pkgconfig(glib-2.0)
36 BuildRequires:   pkgconfig(dlog)
37
38 %description -n zigbee-lib
39 ZigBee library
40
41 %package -n zigbee-lib-devel
42 Summary:         ZigBee library (devel)
43 Group:           System/Libraries
44 Requires:        %{name} = %{version}
45
46 %description -n zigbee-lib-devel
47 ZigBee library (devel)
48
49 %prep
50 %setup -q
51
52 chmod 644 %{SOURCE1}
53 cp -a %{SOURCE1} .
54 %if %{CHECK_ZIGBEE_PRIVILEGE} == "True"
55 chmod 644 %{SOURCE2}
56 cp -a %{SOURCE2} .
57 %endif
58
59 %build
60 %if 0%{?gcov:1}
61 export LDFLAGS+=" -lgcov"
62 %endif
63
64 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
65         -DVERSION=%{version} \
66         -DLIB_INSTALL_DIR=%{_libdir} \
67         -DUNIT_INSTALL_DIR=%{_unitdir} \
68         -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
69         -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
70
71 make %{?_smp_mflags}
72
73 %install
74 %make_install
75
76 # Do not execute daemon on boot time
77 #mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
78 #ln -s %{_unitdir}/zigbee-daemon.service %{buildroot}%{_unitdir}/multi-user.target.wants/zigbee-daemon.service
79
80 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services/
81 mkdir -p %{buildroot}%{_datadir}/dbus-1/system.d/
82 cp %{SOURCE1} %{buildroot}%{_datadir}/dbus-1/system-services/org.tizen.zigbee.service
83 %if %{CHECK_ZIGBEE_PRIVILEGE} == "True"
84 cp %{SOURCE2} %{buildroot}%{_datadir}/dbus-1/system.d/zigbee.conf
85 %endif
86
87 %post -p /sbin/ldconfig
88
89 %postun -p /sbin/ldconfig
90
91 %files
92 %manifest zigbee-daemon.manifest
93 %defattr(-,root,root,-)
94 %attr(755,network_fw,network_fw) %{_bindir}/zigbee-daemon
95 %{_unitdir}/zigbee-daemon.service
96 #%{_unitdir}/multi-user.target.wants/zigbee-daemon.service
97 %attr(644,root,root) %{_datadir}/dbus-1/system-services/*
98 %if %{CHECK_ZIGBEE_PRIVILEGE} == "True"
99 %{_datadir}/dbus-1/system.d/zigbee.conf
100 %endif
101 %license LICENSE
102 %if 0%{?gtests:1}
103 %{_bindir}/gtest*
104 %endif
105
106 %files -n zigbee-lib
107 %defattr(644,system,system,-)
108 %{_libdir}/libzigbee-lib.so*
109 %license LICENSE
110
111 %files -n zigbee-lib-devel
112 %defattr(644,system,system,-)
113 %{_includedir}/zigbee/lib/*.h
114 %{_includedir}/zigbee/common/*.h
115 %{_libdir}/pkgconfig/zigbee-lib.pc
116 %{_libdir}/libzigbee-lib.so