dkms-vhba-vl.spec 2.3 KB

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