19fb9fcce1b19a1dc44b889843a18a0112c57fb9
[platform/core/connectivity/zigbee-manager.git] / packaging / zigbee-manager.spec
1 %define major 0
2 %define minor 1
3 %define patchlevel 0
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 %description
23 Description: ZigBee Daemon
24
25 %package -n zigbee-lib
26 Summary:         ZigBee library
27 Group:           System/Libraries
28 BuildRequires:   pkgconfig(glib-2.0)
29 BuildRequires:   pkgconfig(dlog)
30
31 %description -n zigbee-lib
32 ZigBee library
33
34 %package -n zigbee-lib-devel
35 Summary:         ZigBee library (devel)
36 Group:           System/Libraries
37 Requires:        %{name} = %{version}
38
39 %description -n zigbee-lib-devel
40 ZigBee library (devel)
41
42 %prep
43 %setup -q
44
45 chmod 644 %{SOURCE1}
46 cp -a %{SOURCE1} .
47 %if %{CHECK_ZIGBEE_PRIVILEGE} == "True"
48 chmod 644 %{SOURCE2}
49 cp -a %{SOURCE2} .
50 %endif
51
52 %build
53 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DVERSION=%{version} \
54
55 make %{?_smp_mflags}
56
57 %install
58 %make_install
59
60 # Do not execute daemon on boot time
61 #mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
62 #ln -s %{_libdir}/systemd/system/zigbee-daemon.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/zigbee-daemon.service
63
64 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services/
65 mkdir -p %{buildroot}%{_datadir}/dbus-1/system.d/
66 cp %{SOURCE1} %{buildroot}%{_datadir}/dbus-1/system-services/org.tizen.zigbee.service
67 %if %{CHECK_ZIGBEE_PRIVILEGE} == "True"
68 cp %{SOURCE2} %{buildroot}%{_datadir}/dbus-1/system.d/zigbee.conf
69 %endif
70
71 %post -p /sbin/ldconfig
72
73 %postun -p /sbin/ldconfig
74
75 %files
76 %manifest zigbee-daemon.manifest
77 %defattr(644,system,system,-)
78 %attr(755,system,system) %{_bindir}/zigbee-daemon
79 %{_libdir}/systemd/system/zigbee-daemon.service
80 #%{_libdir}/systemd/system/multi-user.target.wants/zigbee-daemon.service
81 %{_datadir}/license/zigbee-daemon
82 %attr(644,root,root) %{_datadir}/dbus-1/system-services/*
83 %if %{CHECK_ZIGBEE_PRIVILEGE} == "True"
84 %{_datadir}/dbus-1/system.d/zigbee.conf
85 %endif
86
87 %files -n zigbee-lib
88 %defattr(644,system,system,-)
89 %{_libdir}/libzigbee-lib.so*
90 %{_datadir}/license/zigbee-lib
91
92 %files -n zigbee-lib-devel
93 %defattr(644,system,system,-)
94 %{_includedir}/zigbee/lib/*.h
95 %{_includedir}/zigbee/common/*.h
96 %{_libdir}/pkgconfig/zigbee-lib.pc
97 %{_libdir}/libzigbee-lib.so