summaryrefslogtreecommitdiffstats
path: root/gpsd-devices.spec
blob: f3b99fa10934db4dd0457473df04eda2b288a97c (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
Name:		gpsd-devices
Version:	0.0.0
Release:	2%{?dist}
Summary:	GPS Devices for navigation

Group:		System Environment/Daemons
License:	GPLv2+
URL:		http://none/
Source0:	gps-devices-information.fdi
Source1:	gpsd-devices-policy.fdi
Source11:	gps-device.fc
Source12:	gps-device.if
Source13:	gps-device.te
Source21:	gpsd-devices.fc
Source22:	gpsd-devices.if
Source23:	gpsd-devices.te
Source30:	README
BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

BuildArch:	noarch

BuildRequires:	selinux-policy
Requires:	hal
Requires:	gpsd >= 2.39-3.0.1
Requires(pre):	shadow-utils


%description
Automatic setup and use of GPS devices (Global Positioning System)
for navigational purposes.

Set up gpsd such that it is run as a system service. USB devices will
be added to and removed from gpsd automatically.


%prep
%setup -c -T
cp %{SOURCE11} %{SOURCE12} %{SOURCE13} .
cp %{SOURCE21} %{SOURCE22} %{SOURCE23} .
cp %{SOURCE30} .


%build
make -f /usr/share/selinux/devel/Makefile


%install
rm -rf "%{buildroot}"

install -d "%{buildroot}/usr/share/hal/fdi/information"
install %{SOURCE0} "%{buildroot}/usr/share/hal/fdi/information/"

install -d "%{buildroot}/usr/share/hal/fdi/policy"
install %{SOURCE1} "%{buildroot}/usr/share/hal/fdi/policy/"

# FIXME: HACK!
install -d "%{buildroot}/usr/share/selinux/targeted"
install gps-device.pp gpsd-devices.pp "%{buildroot}/usr/share/selinux/targeted/"


%pre
getent group gps >/dev/null || groupadd -r gps
exit 0


%post
semodule -i gps_device gpsd_devices
mkfifo "%{_datadir}/gpsd/dummy-device"
chown root.gps "%{_datadir}/gpsd/dummy-device"
chmod 0644 "%{_datadir}/gpsd/dummy-device"


%preun
rm -f "%{_datadir}/gpsd/dummy-device"
semodule -r gpsd_devices gps_device


%clean
rm -rf "%{buildroot}"


%files
%defattr(-,root,root,-)
%doc README
%{_datadir}/hal/fdi/information/gps-devices-information.fdi
%{_datadir}/hal/fdi/policy/gpsd-devices-policy.fdi
%{_datadir}/selinux/targeted/gps-device.pp
%{_datadir}/selinux/targeted/gpsd-devices.pp


%changelog