79e1b2a30325fcd1496d9a2186776c6c5325aed6
[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} \
54         -DVERSION=%{version} \
55         -DLIB_INSTALL_DIR=%{_libdir} \
56         -DUNIT_INSTALL_DIR=%{_unitdir} \
57
58 make %{?_smp_mflags}
59
60 %install
61 %make_install
62
63 # Do not execute daemon on boot time
64 #mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
65 #ln -s %{_unitdir}/zigbee-daemon.service %{buildroot}%{_unitdir}/multi-user.target.wants/zigbee-daemon.service
66
67 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services/
68 mkdir -p %{buildroot}%{_datadir}/dbus-1/system.d/
69 cp %{SOURCE1} %{buildroot}%{_datadir}/dbus-1/system-services/org.tizen.zigbee.service
70 %if %{CHECK_ZIGBEE_PRIVILEGE} == "True"
71 cp %{SOURCE2} %{buildroot}%{_datadir}/dbus-1/system.d/zigbee.conf
72 %endif
73
74 %post -p /sbin/ldconfig
75
76 %postun -p /sbin/ldconfig
77
78 %files
79 %manifest zigbee-daemon.manifest
80 %defattr(644,system,system,-)
81 %attr(755,system,system) %{_bindir}/zigbee-daemon
82 %{_unitdir}/zigbee-daemon.service
83 #%{_unitdir}/multi-user.target.wants/zigbee-daemon.service
84 %{_datadir}/license/zigbee-daemon
85 %attr(644,root,root) %{_datadir}/dbus-1/system-services/*
86 %if %{CHECK_ZIGBEE_PRIVILEGE} == "True"
87 %{_datadir}/dbus-1/system.d/zigbee.conf
88 %endif
89
90 %files -n zigbee-lib
91 %defattr(644,system,system,-)
92 %{_libdir}/libzigbee-lib.so*
93 %{_datadir}/license/zigbee-lib
94
95 %files -n zigbee-lib-devel
96 %defattr(644,system,system,-)
97 %{_includedir}/zigbee/lib/*.h
98 %{_includedir}/zigbee/common/*.h
99 %{_libdir}/pkgconfig/zigbee-lib.pc
100 %{_libdir}/libzigbee-lib.so