blob: b4729ab13f09c66c86213ed6c2578fa37875808e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
%define kernel_version 3.5
%define kernel_target adaptation-intel-automotive
Name: neard
Summary: Near Field Communication Manager
Version: 0.7
Release: 2
Group: System Environment/Daemons
License: GPLv2
Source0: http://www.kernel.org/pub/linux/network/nfc/%{name}-%{version}.tar.bz2
Source1: init
Source2: %{name}.service
Requires(post): /bin/ln
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(libnl-1)
BuildRequires: kernel-adaptation-intel-automotive-devel
Requires: systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%description
Near Field Communication Manager
%package devel
Summary: Development files for NFC Manager
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
neard-devel contains development files for use with neard.
%package test
Summary: Test Scripts for NFC Manager
Group: Development/Tools
Requires: %{name} = %{version}-%{release}
Requires: dbus-python
Requires: pygobject
Requires: python-xml
%description test
Scripts for testing neard and its functionality
%prep
%setup -q
%build
kver=`find /lib/modules -name "%{kernel_version}*%{kernel_target}" | cut -c 14-`
CFLAGS+=" -I/usr/src/kernels/${kver}/include"
%configure \
--enable-debug \
--enable-nfctype1=builtin \
--enable-nfctype2=builtin \
--enable-nfctype3=builtin \
--enable-nfctype4=builtin \
--enable-p2p=builtin \
--enable-test
make %{?jobs:-j%jobs}
%install
%make_install
mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
cp %{SOURCE1} %{buildroot}%{_sysconfdir}/rc.d/init.d/neard
chmod +x %{buildroot}%{_sysconfdir}/rc.d/init.d/neard
# Systemd service file
install -d %{buildroot}%{_libdir}/systemd/system/
install -m 644 %{S:2} %{buildroot}%{_libdir}/systemd/system/neard.service
install -d %{buildroot}%{_libdir}/systemd/system/network.target.wants/
ln -s ../neard.service %{buildroot}%{_libdir}/systemd/system/network.target.wants/neard.service
%post
ln -sf ../init.d/neard /etc/rc.d/rc3.d/S64neard
systemctl daemon-reload
systemctl restart neard.service
%preun
systemctl stop neard.service
%postun
systemctl daemon-reload
%files
%doc COPYING
%{_libexecdir}/neard
%{_sysconfdir}/dbus-1/system.d/org.neard.conf
%{_sysconfdir}/rc.d/init.d/*
%{_libdir}/systemd/system/neard.service
%{_libdir}/systemd/system/network.target.wants/neard.service
%files devel
%{_includedir}/near/*.h
%{_libdir}/pkgconfig/*.pc
%files test
%defattr(-,root,root,-)
%{_libdir}/%{name}/test/*
|