Add packaging directory
[platform/upstream/neard.git] / packaging / neard.spec
1 Name:       neard
2 Summary:    Near Field Communication Manager
3 Version:    0.14
4 Release:    1
5 Group:      Connectivity/NFC
6 License:    GPL-2.0
7 URL:        http://git.kernel.org/pub/scm/network/nfc/neard.git
8 Source0:    http://www.kernel.org/pub/linux/network/nfc/neard-%{version}.tar.bz2
9 Source1:    neard.service
10 Source1001: neard.manifest
11 BuildRequires:  pkgconfig(glib-2.0)
12 BuildRequires:  pkgconfig(dbus-1)
13 BuildRequires:  pkgconfig(libnl-3.0)
14
15 Requires:   libnl3
16 Requires(post):   systemd
17 Requires(preun):  systemd
18 Requires(postun): systemd
19
20 %description
21 Near Field Communication Manager
22
23
24
25 %package devel
26 Summary:    Development files for NFC Manager
27 Requires:   %{name} = %{version}-%{release}
28
29 %description devel
30 neard-devel contains development files for use with neard.
31
32 %package test
33 Summary:    Test Scripts for NFC Manager
34 Requires:   %{name} = %{version}-%{release}
35 Requires:   dbus-python
36 Requires:   pygobject
37
38 %description test
39 Scripts for testing neard and its functionality
40
41 %prep
42 %setup -q
43 cp %{SOURCE1001} .
44
45 %build
46 ./bootstrap
47 %configure \
48                 --enable-debug \
49                 --prefix=/usr \
50                 --sysconfdir=/etc \
51                 --enable-nfctype1=builtin \
52                 --enable-nfctype2=builtin \
53                 --enable-nfctype3=builtin \
54                 --enable-nfctype4=builtin \
55                 --enable-p2p=builtin \
56                 --enable-test
57
58 make %{?jobs:-j%jobs}
59
60 %install
61 %make_install
62
63 # Systemd service file
64 install -d %{buildroot}%{_unitdir}
65 install -m 644 %{S:1} %{buildroot}%{_unitdir}/neard.service
66 install -d %{buildroot}%{_unitdir}/network.target.wants/
67 ln -s ../neard.service %{buildroot}%{_unitdir}/network.target.wants/neard.service
68
69
70 mkdir -p %{buildroot}%{_sysconfdir}/neard
71 cp src/main.conf %{buildroot}%{_sysconfdir}/neard/main.conf
72
73 %post
74 systemctl daemon-reload
75 systemctl restart neard.service
76
77 %preun
78 systemctl stop neard.service
79
80 %postun
81 systemctl daemon-reload
82
83 %files
84 %manifest %{name}.manifest
85 %license COPYING
86 %{_mandir}/man*/*
87 %{_libexecdir}/nfc/neard
88 %config %{_sysconfdir}/neard/main.conf
89 %config %{_sysconfdir}/dbus-1/system.d/org.neard.conf
90 %{_unitdir}/neard.service
91 %{_unitdir}/network.target.wants/neard.service
92
93 %files devel
94 %manifest %{name}.manifest
95 %{_includedir}/near/*.h
96 %{_libdir}/pkgconfig/*.pc
97
98 %files test
99 %manifest %{name}.manifest
100 %defattr(-,root,root,-)
101 %{_libdir}/neard/test/*