%define name cdemu %define version 0.8 %define svnsnap 203 %define rel 4 Summary: CD drive simulator Name: %name Version: %version %if %svnsnap Release: %mkrel 3.%svnsnap.%rel %else Release: %mkrel %rel %endif URL: http://cdemu.sourceforge.net/ License: GPL Group: System/Kernel and hardware %if %svnsnap Source: %name-%svnsnap.tar.bz2 %else Source: http://prdownloads.sourceforge.net/cdemu/%name-%version.tar.bz2 %endif Patch0: cdemu-203-recent-kernels.patch BuildArch: noarch Requires: kmod(cdemu) python-cdemu BuildRequires: rpm-mandriva-setup >= 1.13-1mdk BuildRequires: python-devel BuildRoot: %{_tmppath}/%{name}-buildroot %description CDemu is designed to simulate a CD drive + CD with just simple cue/bin files, which are pretty common in the Windows world. It includes an user space program to control the kernel module. You can use it to watch an SVCD or mount the data track of an bin/cue. This package includes an user space console program to control the cdemu kernel module. %package -n python-cdemu Summary: CD drive simulator - python module Group: System/Kernel and hardware %description -n python-cdemu CDemu is designed to simulate a CD drive + CD with just simple cue/bin files, which are pretty common in the Windows world. It includes an user space program to control the kernel module. You can use it to watch an SVCD or mount the data track of an bin/cue. This package contains the python module. %package -n dkms-%name Summary: CD drive simulator Group: System/Kernel and hardware Requires: dkms Requires(post): dkms Requires(preun): dkms %description -n dkms-%name CDemu is designed to simulate a CD drive + CD with just simple cue/bin files, which are pretty common in the Windows world. It includes an user space program to control the kernel module. You can use it to watch an SVCD or mount the data track of an bin/cue. This package contains the kernel module necessary to operate CDemu. %prep %if %svnsnap %setup -q -n %name-%svnsnap %else %setup -q %endif %patch0 -p0 # From INSTALL cat > cdemu.rules <<EOF KERNEL=="cdemu[0-9]*", NAME="cdemu/%%n", SYMLINK="%%n" EOF python -O -c "import compileall; compileall.compile_dir('.')" python -c "import compileall; compileall.compile_dir('.')" %install rm -rf %{buildroot} install -d -m755 %{buildroot}%{_bindir} install -m755 cdemu %{buildroot}%{_bindir}/cdemu install -d -m755 %{buildroot}%{py_puresitedir} install -m644 libcdemu.py* %{buildroot}%{py_puresitedir} install -d -m755 %{buildroot}%{_sysconfdir}/udev/rules.d install -m644 cdemu.rules %{buildroot}%{_sysconfdir}/udev/rules.d install -d -m755 %{buildroot}/usr/src/%{name}-%{version}-%{release} cp -a *.c *.h Makefile mk %{buildroot}/usr/src/%{name}-%{version}-%{release} cat > %{buildroot}/usr/src/%{name}-%{version}-%{release}/dkms.conf <<EOF PACKAGE_NAME="%{name}" PACKAGE_VERSION="%{version}-%{release}" MAKE[0]="make KERN_VER=\$kernelver KERN_DIR=\$kernel_source_dir" CLEAN="make clean" BUILT_MODULE_NAME[0]="cdemu" DEST_MODULE_LOCATION[0]="/kernel/drivers/block" AUTOINSTALL=yes EOF %post -n dkms-%{name} dkms add -m %{name} -v %{version}-%{release} --rpm_safe_upgrade dkms build -m %{name} -v %{version}-%{release} --rpm_safe_upgrade dkms install -m %{name} -v %{version}-%{release} --rpm_safe_upgrade %preun -n dkms-%{name} dkms remove -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --all %clean rm -rf %{buildroot} %files %defattr(-,root,root) %doc AUTHORS ChangeLog TODO ANNOUNCE %{_bindir}/cdemu %files -n python-cdemu %defattr(-,root,root) %doc ChangeLog %{py_puresitedir}/libcdemu.py %{py_puresitedir}/libcdemu.pyc %{py_puresitedir}/libcdemu.pyo %files -n dkms-%name %defattr(-,root,root) %doc ChangeLog TODO %{_sysconfdir}/udev/rules.d/cdemu.rules /usr/src/%{name}-%{version}-%{release} %changelog * Wed Apr 23 2008 Anssi Hannula <anssi@mandriva.org> 0.8-3.203.4mdv2008.1 + Revision: 196886 - fix support for recent kernels (P0, fixes #40248) + Olivier Blin <oblin@mandriva.com> - restore BuildRoot + Thierry Vignaud <tvignaud@mandriva.com> - kill re-definition of %%buildroot on Pixel's request * Wed Oct 03 2007 Anssi Hannula <anssi@mandriva.org> 0.8-3.203.3mdv2008.0 + Revision: 95094 - require kmod(cdemu) instead of dkms-cdemu * Tue Oct 02 2007 Olivier Blin <oblin@mandriva.com> 0.8-3.203.2mdv2008.0 + Revision: 94434 - update to new version * Sun Jul 08 2007 Anssi Hannula <anssi@mandriva.org> 0.8-3.203.1mdv2008.0 + Revision: 49801 - new snapshot (support for recent kernels) - precompile python bytecode * Tue Dec 12 2006 Nicolas Lécureuil <neoclust@mandriva.org> 0.8-3mdv2007.0 + Revision: 96001 - Rebuild for new python - import cdemu-0.8-2mdv2007.0 * Mon Aug 14 2006 Anssi Hannula <anssi@mandriva.org> 0.8-2mdv2007.0 - fix dkms package (#24327) * Mon Aug 07 2006 Anssi Hannula <anssi@mandriva.org> 0.8-1mdv2007.0 - 0.8 * Tue Jul 18 2006 Anssi Hannula <anssi@mandriva.org> 0.7-2mdv2007.0 - fix buildrequires - split python-cdemu * Wed Jun 07 2006 Anssi Hannula <anssi@mandriva.org> 0.7-1mdv2007.0 - initial Mandriva release