dkms-vhba-vl.spec 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. Summary: VHBA virtual host bus adapter module
  2. Summary(ja): VHBA(仮想ホストバスアダプタ)モジュール
  3. Name: dkms-vhba
  4. #Version: 1.2.1
  5. Version: 20100822
  6. Release: 1%{?_dist_release}
  7. License: GPLv2+
  8. Group: System Environment/Kernel
  9. URL: http://cdemu.sourceforge.net
  10. Source: http://downloads.sourceforge.net/cdemu/vhba-module-%{version}.tar.gz
  11. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  12. BuildArch: noarch
  13. Requires: gcc, make
  14. Requires(post): dkms
  15. Requires(preun): dkms
  16. %description
  17. VHBA kernel module, a virtual SCSI host bus adapter used by CDEmu daemon from
  18. userspace-cdemu suite.
  19. %prep
  20. %setup -q -n vhba-module-%{version}
  21. %build
  22. %install
  23. %{__rm} -rf %{buildroot}
  24. %define dkms_name vhba
  25. %define dkms_vers %{version}-%{release}
  26. %define quiet -q
  27. # Kernel module sources install for dkms
  28. %{__mkdir_p} %{buildroot}%{_usrsrc}/%{dkms_name}-%{dkms_vers}/
  29. %{__cp} -a * %{buildroot}%{_usrsrc}/%{dkms_name}-%{dkms_vers}/
  30. # Configuration for dkms
  31. %{__cat} > %{buildroot}%{_usrsrc}/%{dkms_name}-%{dkms_vers}/dkms.conf << 'EOF'
  32. PACKAGE_NAME=%{dkms_name}
  33. PACKAGE_VERSION=%{dkms_vers}
  34. MAKE[0]="make"
  35. BUILT_MODULE_NAME[0]=vhba
  36. DEST_MODULE_LOCATION[0]=/kernel/drivers/misc
  37. AUTOINSTALL="YES"
  38. EOF
  39. # Configuration for udev
  40. %{__mkdir_p} %{buildroot}/etc/udev/rules.d
  41. %{__cat} > %{buildroot}/etc/udev/rules.d/60-vhba.rules << 'EOF'
  42. # Make vhba
  43. KERNEL=="vhba_ctl", NAME="%k", MODE="0660", OWNER="root", GROUP="users"
  44. EOF
  45. %clean
  46. %{__rm} -rf %{buildroot}
  47. %post
  48. # Add to DKMS registry
  49. dkms add -m %{dkms_name} -v %{dkms_vers} %{?quiet} || :
  50. # Rebuild and make available for the currenty running kernel
  51. dkms build -m %{dkms_name} -v %{dkms_vers} %{?quiet} || :
  52. dkms install -m %{dkms_name} -v %{dkms_vers} %{?quiet} --force || :
  53. %preun
  54. # Remove all versions from DKMS registry
  55. dkms remove -m %{dkms_name} -v %{dkms_vers} %{?quiet} --all || :
  56. %files
  57. %defattr(-,root,root,-)
  58. #%doc AUTHORS ChangeLog COPYING NEWS README
  59. /etc/udev/rules.d/60-vhba.rules
  60. %{_usrsrc}/%{dkms_name}-%{dkms_vers}/
  61. %changelog
  62. * Fri Sep 3 2010 Toshiharu Kudoh <toshi.kd1@gmail.com> - 20100822-1
  63. - new upstream release
  64. * Sat Sep 26 2009 Toshiharu Kudoh <toshi.kd1@gmail.com> - 1.2.1-1
  65. - initial build for VineSeed
  66. * Sat Jun 28 2008 Rok Mandeljc <rok.mandeljc@email.si> - 1.1.0-1
  67. - Updated to 1.1.0
  68. * Sun Dec 23 2007 Rok Mandeljc <rok.mandeljc@email.si> 1.0.0-2
  69. - Fixed udev rule (it's OWNER, not USER).
  70. * Thu Dec 20 2007 Rok Mandeljc <rok.mandeljc@email.si> 1.0.0-1
  71. - Initial RPM release.