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