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