File usbmuxd.spec of Package usbmuxd

# spec file for package usbmuxd
# Copyright (c) 2014 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

Name:           usbmuxd
Version:        1.0.9git20140528
Release:        0
Summary:        A socket daemon to multiplex connections from and to iOS devices
License:        GPL-2.0 or GPL-3.0
Group:          System/Libraries
# To update libimobiledevice4 to support iOS 7, we need libusbmuxd
# which requires usbmuxd to be updated to git snapshot as well
Source:         %{name}-%{version}.tar.bz2
Source99:       baselibs.conf
BuildRequires:  gcc-c++
BuildRequires:  libimobiledevice-devel >= 1.0.6
BuildRequires:  libplist-devel >= 1.11
BuildRequires:  libtool
BuildRequires:  libusb-1_0-devel >= 1.0.3
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(systemd)
BuildRequires:  pkgconfig(udev)
Requires:       libusbmuxd2 >= 1.0.9
Requires(pre):  pwdutils
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%{!?_udevrulesdir: %global _udevrulesdir %(pkg-config --variable=udevdir udev)/rules.d}

This package provides the usbmuxd daemon for software to use through the
libusbmuxd library to talk with iPhone/iPod Touch devices.

Usbmux is an encapsulation protocol (think IP, ATM, PPP) that allows
multiplexing several conversations onto a single pair of wires.

%setup -q

make %{?_smp_mflags}

make install DESTDIR=%{buildroot}
# install systemd service
mkdir -p %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
# fix udev rules
mkdir -p %{buildroot}%{_udevrulesdir}
mv %{buildroot}/lib/udev/rules.d/* %{buildroot}%{_udevrulesdir}/
rm -rf %{buildroot}/lib

getent passwd usbmux >/dev/null || useradd -r -g nogroup -d %{_localstatedir}/lib/%{name} -s /sbin/nologin -c "%{name} daemon" usbmux
%service_add_pre usbmuxd.service
exit 0

%service_del_preun usbmuxd.service

%service_add_post usbmuxd.service

%service_del_postun usbmuxd.service


openSUSE Build Service is sponsored by