%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/*