rt2860-vl.spec 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. %define build_kmod 0
  2. %define kversion %(uname -r)
  3. %define kver %(uname -r | sed -e 's/-/_/g')
  4. %define kflavor %(uname -r | sed -e 's/.*vl.//')
  5. %if "%kflavor" == ""
  6. %undefine kflavor
  7. %endif
  8. %define kmod kernel-module%{?kflavor:-%{kflavor}}
  9. %define name rt2860
  10. %define ver 2.4.0.0
  11. %define rel 2%{?_dist_release}
  12. %define tgzname 2010_07_16_RT2860_Linux_STA_v%{ver}
  13. Summary: Linux kernel module for Ralink RT2860 WiFi adapters
  14. Summary(ja): Ralink RT2860 WiFi アダプタ用のカーネルモジュール
  15. Name: %{name}
  16. Version: %{ver}
  17. Release: %{rel}
  18. # $ file 2010_07_16_RT2860_Linux_STA_v2.4.0.0.tar.bz2
  19. # 2010_07_16_RT2860_Linux_STA_v2.4.0.0.tar.bz2: gzip compressed data, from Unix, last modified: Thu Jul 15 20:09:16 2010
  20. # so, repacked %{tgzname}.tar.bz2
  21. Source0: %{tgzname}.tar.bz2
  22. Source10: %{name}-kmp.spec
  23. Patch0: %{tgzname}-NetworkManager-support.patch
  24. License: GPLv2+
  25. Group: System Environment/Base
  26. URL: http://www.ralinktech.com/support.php?s=2
  27. BuildRequires: kernel-devel
  28. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  29. %description
  30. This package contains the rt2860 driver for Ralink RT2860 WiFi adapters.
  31. %description -l ja
  32. このパッケージには、Ralink RT2860 無線LANアダプタ用ドライバである
  33. rt2860 カーネルモジュールが収録されています。
  34. %package -n dkms-%{name}
  35. Summary: Linux kernel module for Ralink RT2860 WiFi adapters
  36. Summary(ja): Ralink RT2860 WiFi アダプタ用のカーネルモジュール
  37. License: GPLv2+
  38. Group: System Environment/Kernel
  39. Requires(pre): kernel, kernel-devel
  40. #Requires(pre): rt2860-firmware
  41. Requires(pre): linux-firmware >= 20110601
  42. Requires(post): dkms
  43. Requires(preun): dkms
  44. %description -n dkms-%{name}
  45. This package contains the rt2860 driver for Ralink RT2860 WiFi adapters.
  46. %description -l ja -n dkms-%{name}
  47. このパッケージには、Ralink RT2860 無線LANアダプタ用ドライバである
  48. rt2860 カーネルモジュールが収録されています。
  49. %prep
  50. %setup -q -n %{tgzname}
  51. %patch0 -p1 -b .mn
  52. ## fix permission
  53. find . -type f -print0 | xargs -0 chmod 644
  54. %install
  55. %__rm -rf %{buildroot}
  56. %__mkdir_p %{buildroot}/usr/src/%{name}-%{version}-%{release}
  57. %__cp -a * %{buildroot}/usr/src/%{name}-%{version}-%{release}
  58. ## DKMS.CONF ##
  59. cat > %{buildroot}/usr/src/%{name}-%{version}-%{release}/dkms.conf <<EOF
  60. PACKAGE_NAME="%{name}"
  61. PACKAGE_VERSION="%{version}-%{release}"
  62. MAKE[0]="make LINUX_SRC=\$kernel_source_dir HAS_WPA_SUPPLICANT=y HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y"
  63. BUILT_MODULE_NAME[0]="%{name}sta"
  64. BUILT_MODULE_LOCATION[0]="os/linux"
  65. DEST_MODULE_LOCATION[0]="/kernel/3rdparty/%{name}"
  66. AUTOINSTALL="yes"
  67. EOF
  68. %__mkdir_p %{buildroot}%{_sysconfdir}/Wireless/RT2860STA
  69. %__install -m 644 RT2860STA.dat %{buildroot}%{_sysconfdir}/Wireless/RT2860STA
  70. ## KMP.SPEC ##
  71. %__sed -e 's|##KMOD_NAME##|%{name}|g' \
  72. -e 's|##KMOD_VER##|%{version}-%{release}|g' \
  73. -e 's|##LICENSE##|%{license}|g' \
  74. %{SOURCE10} > \
  75. %{buildroot}/usr/src/%{name}-%{version}-%{release}/%{name}-kmp.spec
  76. %clean
  77. %__rm -rf %{buildroot}
  78. %post -n dkms-%{name}
  79. dkms add -m %{name} -v %{version}-%{release} --rpm_safe_upgrade
  80. dkms mkkmp -m %{name} -v %{version}-%{release}
  81. dkms build -m %{name} -v %{version}-%{release} --rpm_safe_upgrade
  82. dkms install -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --force
  83. exit 0
  84. %preun -n dkms-%{name}
  85. dkms remove -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --all
  86. exit 0
  87. %files -n dkms-%{name}
  88. %defattr(-,root,root)
  89. %doc README_STA *.txt
  90. %{_sysconfdir}/Wireless
  91. %dir /usr/src/%{name}-%{version}-%{release}
  92. /usr/src/%{name}-%{version}-%{release}/*
  93. %changelog
  94. * Sat Jul 02 2011 Munehiro Yamamoto <munepi@vinelinux.org> - 2.4.0.0-2
  95. - dropped Requires(pre): rt2860-firmware
  96. - added Requires(pre): linux-firmware >= 20110601
  97. * Sat Jan 01 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.4.0.0-1
  98. - initial package for Vine Linux