summaryrefslogtreecommitdiff
path: root/vrpn.spec
blob: c1fd7b02dfd40e3ca8619dab79abc6700723eb35 (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# TODO: openhaptics, ghost, wiiuse(GPL v3), libnifalcon, intersense, nidaqmx, viewpoint, phasespace, libfreespace
# NATIONAL_INSTRUMENTS, NIDAQ, USDIGITAL, MICROSCRIBE, MONITONNODE, TRIVISIOCOLIBRI ???
#
# Conditional build:
%bcond_without	apidocs		# do not build and package API docs
%bcond_without	gpm		# GPM Linux mouse interface support (GPL v2+)
%bcond_without	modbus		# Modbus support
%bcond_with	mpi		# MPI support
%bcond_without	java		# Java binding
#
%define	with_gpl	0%{?with_gpm:1}
Summary:	Virtual Reality Peripheral Network
Summary(pl.UTF-8):	Sieć peryferiów do rzeczywistości wirtualnej (VR)
Name:		vrpn
Version:	07.32
%define	fver	%(echo %{version} | tr . _)
Release:	1
License:	Boost v1.0 (VRPN)%{?with_gpl:, depends on GPL libraries}
Group:		Libraries
Source0:	http://www.cs.unc.edu/Research/vrpn/downloads/%{name}_%{fver}.zip
# Source0-md5:	6cb32e51e6420385f2006f1aae58b457
Patch0:		%{name}-install.patch
Patch1:		%{name}-jsoncpp.patch
Patch2:		%{name}-modbus.patch
URL:		http://www.cs.unc.edu/Research/vrpn/
BuildRequires:	cmake >= 2.8.3
%{?with_apidocs:BuildRequires:	doxygen}
%{?with_gpm:BuildRequires:	gpm-devel}
BuildRequires:	hidapi-devel >= 0.7.0
BuildRequires:	jdk
BuildRequires:	jsoncpp-devel >= 0.7.0
%{?with_modbus:BuildRequires:	libmodbus-devel}
BuildRequires:	libstdc++-devel
BuildRequires:	libusb-devel >= 1.0
%{?with_mpi:BuildRequires:	mpi-devel}
BuildRequires:	perl-Parse-RecDescent
BuildRequires:	perl-base
BuildRequires:	python-devel >= 1:2.7
BuildRequires:	swig-python
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
The Virtual-Reality Peripheral Network (VRPN) is a set of classes
within a library and a set of servers that are designed to implement a
network-transparent interface between application programs and the set
of physical devices (tracker, etc.) used in a virtual-reality (VR)
system. The idea is to have a PC or other host at each VR station that
controls the peripherals (tracker, button device, haptic device,
analog inputs, sound, etc). VRPN provides connections between the
application and all of the devices using the appropriate
class-of-service for each type of device sharing this link. The
application remains unaware of the network topology. Note that it is
possible to use VRPN with devices that are directly connected to the
machine that the application is running on, either using separate
control programs or running all as a single program.

%description -l pl.UTF-8
VRPN (Virtual-Reality Peripheral Network) to biblioteka klas i zestaw
serwerów zaprojektowanych jako implementacja przezroczystego sieciowo
interfejsu między aplikacjami a zbiorem urządzeń fizycznych (takich
jak tracker), używanych w systemie wirtualnej rzeczywistości (VR).
Idea polega na umieszczeniu komputera PC lub innego na każdej stacji
kontrolującej urządzenia peryferyjne (tracker, przyciski, urządzenie
haptyczne, wejścia analogowe, dźwiękowe itp.). VRPN zapewnia
połączenia między aplikacją a wszystkimi urządzeniami używającymi
odpowiedniej klasy usług dla każdego typu urządzeń współdzielących to
połączenie. Dla aplikacji topologia sieci nie ma znaczenia. Należy
zauważyć, że można używać oprogramowania VRPN z urządzeniami
podłączonymi bezpośrednio do maszyny, na której działa aplikacja -
albo przy użyciu osobnych programów sterujących, albo w ramach
jednego programu.

%package devel
Summary:	Header files for VRPN library
Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki VRPN
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}

%description devel
Header files for VRPN library.

%description devel -l pl.UTF-8
Pliki nagłówkowe biblioteki VRPN.

%package apidocs
Summary:	VRPN API documentation
Summary(pl.UTF-8):	Dokumentacja API biblioteki VRPN
Group:		Documentation

%description apidocs
API documentation for VRPN library.

%description apidocs -l pl.UTF-8
Dokumentacja API biblioteki VRPN.

%package -n java-vrpn
Summary:	Java binding to VRPN
Summary(pl.UTF-8):	Wiązanie Javy do bibliotek VRPN
Group:		Libraries/Java
Requires:	%{name} = %{version}-%{release}

%description -n java-vrpn
Java binding to VRPN.

%description -n java-vrpn -l pl.UTF-8
Wiązanie Javy do bibliotek VRPN.

%package -n python-vrpn
Summary:	Python binding to VRPN
Summary(pl.UTF-8):	Wiązania Pythona do bibliotek VRPN
Group:		Libraries/Java
Requires:	%{name} = %{version}-%{release}

%description -n python-vrpn
Python binding to VRPN.

%description -n python-vrpn -l pl.UTF-8
Wiązania Pythona do bibliotek VRPN.

%prep
%setup -q -n %{name}
%patch0 -p1
%patch1 -p1
%patch2 -p1

%build
install -d build
cd build
%cmake .. \
	-DSYSCONF_INSTALL_DIR=%{_sysconfdir}/vrpn \
	%{?with_gpl:-DVRPN_GPL_SERVER=ON} \
	-DVRPN_USE_GPM_MOUSE=%{?with_gpm:ON}%{!?with_gpm:OFF} \
	-DVRPN_USE_LOCAL_HIDAPI=OFF \
	-DVRPN_USE_LOCAL_JSONCPP=OFF \
	%{?with_modbus:-DVRPN_USE_MODBUS=ON} \
	-DVRPN_USE_MPI=%{?with_mpi:ON}%{!?with_mpi:OFF} \
	-DVRPN_BUILD_PYTHON=ON

%{__make}

%if %{with apidocs}
%{__make} doc
%endif

%install
rm -rf $RPM_BUILD_ROOT

%{__make} -C build install \
	DESTDIR=$RPM_BUILD_ROOT

%{__rm} $RPM_BUILD_ROOT%{_bindir}/{c_interface_example,checklogfile,client_and_server,clock_drift_estimator,forcedevice_test_client,forward,forwarderClient,last_of_sequence,logfilesenders,logfiletypes,printcereal,printvals,run_auxiliary_logger,sample_analog,sample_server,test*,text,textServer,tracker_to_poser}

%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/source-docs

%py_comp $RPM_BUILD_ROOT%{py_sitedir}
%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
%py_postclean

%clean
rm -rf $RPM_BUILD_ROOT

%post	-p /sbin/ldconfig
%postun	-p /sbin/ldconfig

%files
%defattr(644,root,root,755)
%doc ChangeLog Format README README.Legal
%attr(755,root,root) %{_bindir}/add_vrpn_cookie
%attr(755,root,root) %{_bindir}/bdbox_client
%attr(755,root,root) %{_bindir}/ff_client
%attr(755,root,root) %{_bindir}/phan_client
%attr(755,root,root) %{_bindir}/sound_client
%attr(755,root,root) %{_bindir}/sphere_client
%attr(755,root,root) %{_bindir}/vrpn_HID_device_watcher
%attr(755,root,root) %{_bindir}/vrpn_LamportClock
%attr(755,root,root) %{_bindir}/vrpn_ping
%attr(755,root,root) %{_bindir}/vrpn_print_devices
%attr(755,root,root) %{_bindir}/vrpn_print_messages
%attr(755,root,root) %{_bindir}/vrpn_print_performance
%attr(755,root,root) %{_bindir}/vrpn_server
%attr(755,root,root) %{_bindir}/vrpn_streamPrint
%dir %{_sysconfdir}/vrpn
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vrpn/vrpn.cfg
%attr(755,root,root) %{_libdir}/libgpsnmea.so
%attr(755,root,root) %{_libdir}/libquat.so
%attr(755,root,root) %{_libdir}/libvrpn.so
%attr(755,root,root) %{_libdir}/libvrpn_atmel.so
%attr(755,root,root) %{_libdir}/libvrpn_timecode_generator.so
%attr(755,root,root) %{_libdir}/libvrpnserver.so

%files devel
%defattr(644,root,root,755)
%{_includedir}/latLonCoord.h
%{_includedir}/nmeaParser.h
%{_includedir}/quat.h
%{_includedir}/utmCoord.h
%{_includedir}/vrpn_*.h

%if %{with java}
%files -n java-vrpn
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libjava_vrpn.so
%{_javadir}/vrpn-%{version}.jar
%endif

%files -n python-vrpn
%defattr(644,root,root,755)
# swig bindings
%attr(755,root,root) %{py_sitedir}/_vrpn_*.so
%attr(755,root,root) %{py_sitedir}/vrpn_*.py[co]
# "handwritten" binding
%attr(755,root,root) %{py_sitedir}/vrpn.so

%if %{with apidocs}
%files apidocs
%defattr(644,root,root,755)
%doc build/doxygen/docs-generated/html/*
%endif