File usbip.spec of Package usbip
#
# spec file for package usbip
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
BuildRequires: glib2-devel libtool pkg-config tcpd-devel
BuildRequires: automake >= 1.9, autoconf >= 2.5.0
%if 0%{?suse_version} > 1130
BuildRequires: sysfsutils-devel, libudev-devel >= 2.0
%else
BuildRequires: sysfsutils
%endif
%if 0%{?suse_version} >= 1210
BuildRequires: systemd
%{?systemd_requires}
%endif
Name: usbip
License: GPL-2.0+
Group: Hardware/Other
Summary: The USB/IP shared USB system over IP network
Version: 1.1.2
Release: 0
Url: http://usbip.sourceforge.net/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# userspace code from linux kernel git commit fde7d904
Source0: %{name}-%{version}.tar.gz
Source1: usbip-client.service
Source2: usbip-server.service
Source3: usbip
# [PATCH 1/5] staging: usbip: userspace: fix build breakage in doc directory
Patch1: usbip-1_5.patch
#[PATCH 2/5] staging: usbip: userspace: add gitignore file
Patch2: usbip-2_5.patch
# [PATCH 3/5] staging: usbip: userspace: eliminate glib dependency
Patch3: usbip-3_5.patch
# [PATCH 4/5] staging: usbip: userspace: add option to turn fortify on or off
Patch4: usbip-4_5.patch
# [PATCH 5/5] staging: usbip: userspace: suppress a bogus error
#Patch5: usbip-5_5.patch
#Patch6: usbip-common.patch
Requires: lib%{name}0 = %{version}-%{release}
%description
The USB/IP Project aims to develop a general USB device sharing system
over IP network. To share USB devices between computers with their full
functionality, USB/IP encapsulates "USB I/O messages" into IP packets
and transmits them between computers. Original USB device drivers and
applications can be also used for remote USB devices without any
modification of them. A computer can use remote USB devices as if they
were directly attached.
%package -n lib%{name}0
Summary: Library for USB/IP
Group: Hardware/Other
%description -n lib%{name}0
This package contains libraries for USB/IP
%package -n lib%{name}-devel
License: GPL-2.0+
Summary: Headers and static libraries
Group: Development/Libraries/Other
Requires: lib%{name}0 = %{version}-%{release} glibc-devel
%description -n lib%{name}-devel
This package contains headers and static libraries for USB/IP
development
%prep
%setup -q -n %{name}-%{version} -n linux-v3.1-rc6-1332-g18e42dc
%patch1 -p5
%patch2 -p5
%patch3 -p5
%patch4 -p5
#%patch6
%service_add_pre usbip-client.service usbip-server.service
%post -n lib%{name}0 -p /sbin/ldconfig
%post
%service_add_post usbip-client.service usbip-server.service
%preun
%service_del_preun usbip-client.service usbip-server.service
%postun -n lib%{name}0 -p /sbin/ldconfig
%postun
%service_del_postun usbip-client.service usbip-server.service
%build
./autogen.sh
%configure --disable-static --with-pic --with-usbids-dir=/usr/share/ --prefix=/usr
%{__make} %{?jobs:-j%jobs}
%install
%makeinstall
%{__rm} -f %{buildroot}%{_libdir}/*.la
%{__mkdir} -pv %{buildroot}/%_unitdir
%{__mkdir} -pv %{buildroot}/etc/default
install -D -m 644 %{S:1} %{buildroot}/%_unitdir/%{name}-client.service
install -D -m 644 %{S:2} %{buildroot}/%_unitdir/%{name}-server.service
install -D -m 644 %{S:3} %{buildroot}/etc/default/%{name}
%files
%defattr(-,root,root,-)
%{_sbindir}/usbip
%{_sbindir}/usbipd
%doc %{_mandir}/man8/usbip*
%_unitdir/%{name}-client.service
%_unitdir/%{name}-server.service
%config(noreplace) %{_sysconfdir}/default/usbip
%files -n lib%{name}0
%defattr(-,root,root,-)
%{_libdir}/libusbip.so.0
%{_libdir}/libusbip.so.0.0.1
%files -n lib%{name}-devel
%defattr(-,root,root,-)
%dir %{_includedir}/usbip
%{_includedir}/usbip/*.h
%{_libdir}/libusbip.so
%changelog