diff --git a/usbmuxd-udevuser.patch b/usbmuxd-udevuser.patch new file mode 100644 index 0000000..5008354 --- /dev/null +++ b/usbmuxd-udevuser.patch @@ -0,0 +1,11 @@ +--- usbmuxd-1.0.0/udev/85-usbmuxd.rules.in.orig 2010-01-30 08:14:05.000000000 +0000 ++++ usbmuxd-1.0.0/udev/85-usbmuxd.rules.in 2010-01-30 08:14:56.000000000 +0000 +@@ -1,7 +1,7 @@ + # usbmuxd (iPhone "Apple Mobile Device" MUXer listening on /var/run/usbmuxd) + + # Forces iPhone 1.0, 3G, 3GS and iPodTouch 1 and 2 to USB configuration 3 and run usbmuxd +-ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[0-9]", ATTR{bConfigurationValue}!="$attr{bNumConfigurations}", ATTR{bConfigurationValue}="$attr{bNumConfigurations}", RUN+="@CMAKE_INSTALL_PREFIX@/sbin/usbmuxd -u -U" ++ACTION=="add", SUBSYSTEM=="usb", OWNER="usbmuxd", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[0-9]", ATTR{bConfigurationValue}!="$attr{bNumConfigurations}", ATTR{bConfigurationValue}="$attr{bNumConfigurations}", RUN+="@CMAKE_INSTALL_PREFIX@/sbin/usbmuxd -u -U" + + # Exit usbmuxd when the last phone is removed + ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/129[0-9]/*", ENV{INTERFACE}=="255/*", RUN+="@CMAKE_INSTALL_PREFIX@/sbin/usbmuxd -x" diff --git a/usbmuxd.spec b/usbmuxd.spec index 8d2187c..1f70399 100644 --- a/usbmuxd.spec +++ b/usbmuxd.spec @@ -1,17 +1,19 @@ Name: usbmuxd Version: 1.0.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Daemon for communicating with Apple's iPod Touch and iPhone Group: Applications/System # All code is dual licenses as GPLv3+ or GPLv2+, except libusbmuxd which is LGPLv2+. License: GPLv3+ or GPLv2+ and LGPLv2+ URL: http://marcansoft.com/uploads/ -Source0: http://marcansoft.com/uploads/usbmuxd/%{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Source0: http://marcansoft.com/uploads/usbmuxd/%{name}-%{version}.tar.bz2 +Patch0: usbmuxd-udevuser.patch BuildRequires: libusb1-devel BuildRequires: cmake +Requires(pre): shadow-utils %description usbmuxd is a daemon used for communicating with Apple's iPod Touch and iPhone @@ -23,12 +25,14 @@ Summary: Development package for %{name} Group: Development/Libraries Requires: usbmuxd = %{version}-%{release} Requires: pkgconfig +Requires: libusb1-devel %description devel Files for development with %{name}. %prep %setup -q +%patch0 -p1 -b .udevuser %build export CMAKE_PREFIX_PATH=/usr @@ -44,6 +48,13 @@ make install DESTDIR=$RPM_BUILD_ROOT %clean rm -rf $RPM_BUILD_ROOT +%pre +getent group usbmuxd >/dev/null || groupadd -r usbmuxd +getent passwd usbmuxd >/dev/null || \ +useradd -r -g usbmuxd -d / -s /sbin/nologin \ +-c "usbmuxd user" usbmuxd +exit 0 + %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -64,6 +75,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/libusbmuxd.pc %changelog +* Fri Jan 29 2010 Peter Robinson 1.0.0-2 +- Run deamon under the usbmuxd user + * Mon Dec 7 2009 Peter Robinson 1.0.0-1 - New stable 1.0.0 release