[521] | 1 | %{?!WITH_SYSV: %define WITH_SYSV 1} |
---|
| 2 | |
---|
| 3 | Summary: CDEmu daemon |
---|
| 4 | Summary(ja): CDEmu デーモン |
---|
| 5 | Name: cdemu-daemon |
---|
| 6 | Version: 1.2.0 |
---|
| 7 | Release: 2%{?_dist_release} |
---|
| 8 | License: GPLv2+ |
---|
| 9 | Group: System Environment/Daemons |
---|
| 10 | URL: http://cdemu.sourceforge.net |
---|
| 11 | Source0: http://downloads.sourceforge.net/cdemu/%{name}-%{version}.tar.bz2 |
---|
| 12 | Source1: cdemu-daemon.init |
---|
| 13 | Source2: cdemu-daemon.sysconfig |
---|
| 14 | # should be fixed upstream? |
---|
| 15 | Patch10: %{name}-1.2.0-bigendian-fix.patch |
---|
| 16 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
---|
| 17 | BuildRequires: dbus-devel >= 0.90 |
---|
| 18 | BuildRequires: dbus-glib-devel >= 0.70 |
---|
| 19 | BuildRequires: libdaemon-devel >= 0.11 |
---|
| 20 | BuildRequires: glib2-devel >= 2.6 |
---|
| 21 | BuildRequires: libmirage-devel >= 1.2.0 |
---|
| 22 | BuildRequires: libao-devel >= 0.8.0 |
---|
| 23 | BuildRequires: sysfsutils-devel |
---|
| 24 | |
---|
| 25 | %description |
---|
| 26 | This is CDEmu daemon, the userspace daemon part of the userspace-cdemu suite, a |
---|
| 27 | free, GPL CD/DVD-ROM device emulator for linux. |
---|
| 28 | |
---|
| 29 | It receives SCSI commands from kernel module and processes them, passing the |
---|
| 30 | requested data back to the kernel. Daemon implements the actual virtual device; |
---|
| 31 | one instance per each device registered by kernel module. It uses libMirage, an |
---|
| 32 | image access library that is part of userspace-cdemu suite, for the image access |
---|
| 33 | (e.g. sector reading). |
---|
| 34 | |
---|
| 35 | The daemon registers itself on D-BUS' system or session bus (depending on the |
---|
| 36 | options passed to it) where it exposes an interface that can be used by clients |
---|
| 37 | to control it. |
---|
| 38 | |
---|
| 39 | %if %{WITH_SYSV} |
---|
| 40 | %package sysv |
---|
| 41 | Summary: SysV initscripts for cdemu-daemon |
---|
| 42 | Group: System Environment/Daemon |
---|
| 43 | Requires: %{name} = %{version} |
---|
| 44 | Requires(post): initscripts, chkconfig |
---|
| 45 | |
---|
| 46 | %description sysv |
---|
| 47 | This is CDEmu daemon, the userspace daemon part of the userspace-cdemu suite, a |
---|
| 48 | free, GPL CD/DVD-ROM device emulator for linux. |
---|
| 49 | |
---|
| 50 | This package provides SysV initscripts for running CDEmu daemon in daemon mode. |
---|
| 51 | %endif |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | %prep |
---|
| 55 | %setup -q |
---|
| 56 | %patch10 -p1 -b .bigendian |
---|
| 57 | cp -p %{SOURCE1} ./cdemu-daemon.init |
---|
| 58 | cp -p %{SOURCE2} ./cdemu-daemon.sysconfig |
---|
| 59 | |
---|
| 60 | %build |
---|
| 61 | %{configure} |
---|
| 62 | %{__make} %{?_smp_mflags} |
---|
| 63 | |
---|
| 64 | %install |
---|
| 65 | %{__rm} -rf $RPM_BUILD_ROOT |
---|
| 66 | %{__make} install DESTDIR=$RPM_BUILD_ROOT |
---|
| 67 | |
---|
| 68 | %if %{WITH_SYSV} |
---|
| 69 | %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig |
---|
| 70 | %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d |
---|
| 71 | %{__install} -Dpm 644 cdemu-daemon.init $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/cdemu-daemon |
---|
| 72 | %{__install} -Dpm 755 cdemu-daemon.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/cdemu-daemon |
---|
| 73 | %endif |
---|
| 74 | |
---|
| 75 | |
---|
| 76 | %clean |
---|
| 77 | rm -rf $RPM_BUILD_ROOT |
---|
| 78 | |
---|
| 79 | %post sysv |
---|
| 80 | # Run cdemu-daemon by default: |
---|
| 81 | /sbin/chkconfig --add cdemu-daemon >/dev/null 2>&1 || : |
---|
| 82 | |
---|
| 83 | %preun sysv |
---|
| 84 | if [ "$1" -eq 0 ]; then |
---|
| 85 | /sbin/service cdemu-daemon stop > /dev/null 2>&1 || : |
---|
| 86 | /sbin/chkconfig --del cdemu-daemon |
---|
| 87 | fi |
---|
| 88 | |
---|
| 89 | %postun sysv |
---|
| 90 | if [ "$1" -ge "1" ]; then |
---|
| 91 | /sbin/service cdemu-daemon condrestart >/dev/null 2>&1 || : |
---|
| 92 | fi |
---|
| 93 | |
---|
| 94 | %files |
---|
| 95 | %defattr(-,root,root,-) |
---|
| 96 | %doc AUTHORS ChangeLog COPYING NEWS README |
---|
| 97 | %config(noreplace) %{_sysconfdir}/dbus-1/system.d/cdemud-dbus.conf |
---|
| 98 | %{_bindir}/* |
---|
| 99 | %{_mandir}/man8/* |
---|
| 100 | |
---|
| 101 | %if %{WITH_SYSV} |
---|
| 102 | %files sysv |
---|
| 103 | %defattr(-,root,root,-) |
---|
| 104 | %config(noreplace) %{_sysconfdir}/sysconfig/cdemu-daemon |
---|
| 105 | %attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/cdemu-daemon |
---|
| 106 | %endif |
---|
| 107 | |
---|
| 108 | %changelog |
---|
| 109 | * Mon Oct 12 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.2.0-2 |
---|
| 110 | - add Patch10 to fix build failure on ppc |
---|
| 111 | |
---|
| 112 | * Sat Sep 26 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.2.0-1 |
---|
| 113 | - initial build for VineSeed |
---|
| 114 | |
---|
| 115 | * Sat Jun 28 2008 Rok Mandeljc <rok.mandeljc@email.si> - 1.1.0-1 |
---|
| 116 | - Updated to 1.1.0 |
---|
| 117 | |
---|
| 118 | * Thu Dec 20 2007 Rok Mandeljc <rok.mandeljc@email.si> - 1.0.0-1 |
---|
| 119 | - Initial RPM release. |
---|