set smack label of device node when booted with systemd.
[platform/core/system/libdevice-node.git] / packaging / libdevice-node.spec
1 Name:       libdevice-node
2 Summary:    Library to control OAL APIs
3 Version:    0.1.0
4 Release:    1
5 Group:      System/Libraries
6 License:    Apache License, Version 2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1:    %{name}.manifest
9 Source2:    smack-device-labeling.service
10 BuildRequires:  cmake
11 BuildRequires:  pkgconfig(vconf)
12 BuildRequires:  pkgconfig(dlog)
13
14 %description
15 development package of library to control OAL APIs
16
17 %package devel
18 Summary:        Control OAL APIs (devel)
19 Group:          Development/Libraries
20 Requires:       %{name} = %{version}-%{release}
21
22 %description devel
23 Library to control OAL APIs (devel)
24
25
26 %prep
27 %setup -q
28
29 %build
30 CFLAGS="$CFLAGS" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
31 make %{?jobs:-j%jobs}
32
33 %install
34 rm -rf %{buildroot}
35 mkdir -p %{buildroot}/usr/share/license
36 cp LICENSE %{buildroot}/usr/share/license/device-node
37 %make_install
38 cp -a %{SOURCE1} %{buildroot}%{_datadir}/
39 install -D -d %{buildroot}/etc/rc.d/rc3.d/
40 install -D -d %{buildroot}/etc/rc.d/rc4.d/
41 ln -sf ../init.d/smack_device_labeling %{buildroot}/etc/rc.d/rc3.d/S44smack_device_labeling
42 ln -sf ../init.d/smack_device_labeling %{buildroot}/etc/rc.d/rc4.d/S44smack_device_labeling
43
44 mkdir -p %{buildroot}%{_libdir}/systemd/system/basic.target.wants
45 install -m 644 %{SOURCE2} %{buildroot}%{_libdir}/systemd/system/
46 ln -s ../smack-device-labeling.service %{buildroot}%{_libdir}/systemd/system/basic.target.wants/
47
48 %post
49 if [ ! -e "/lib/firmware/mdnie" ]
50 then
51         mkdir -p /lib/firmware/mdnie
52 fi
53
54 %postun
55
56 %files
57 %{_libdir}/*.so.*
58 %{_libdir}/udev/rules.d/*
59 %{_datadir}/license/device-node
60 %attr(755,root,root) %{_sysconfdir}/rc.d/*
61 %{_libdir}/systemd/system/smack-device-labeling.service
62 %{_libdir}/systemd/system/basic.target.wants/smack-device-labeling.service
63 %manifest %{_datadir}/%{name}.manifest
64
65 %files devel
66 %{_includedir}/device-node/*.h
67 %{_libdir}/*.so
68 %{_libdir}/pkgconfig/*.pc