pcc-acpi-vl.spec 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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 pcc-acpi
  10. %define ver 0.9
  11. %define rel 5%{?_dist_release}
  12. Summary: Hotkey Driver for Panasonic Let's note
  13. Summary(ja): Panasonic Let's note 用ホットキードライバ
  14. Name: %{name}
  15. Version: %{ver}
  16. Release: %{rel}
  17. Source0: %{name}-%{version}.tar.bz2
  18. Patch10: %{name}-0.9-kernel-2.6.23.patch
  19. Patch11: %{name}-0.9-kernel-2.6.23_apichange.patch
  20. Patch12: %{name}-0.9-check_input_register_device.patch
  21. Patch13: %{name}-0.9-kernel-2.6.26_inputdev_apichange.patch
  22. Source10: %{name}-kmp.spec
  23. License: GPL2
  24. Group: System Environment/Base
  25. URL: http://www.da-cha.org/letsnote/
  26. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  27. %description
  28. The Panasonic Hotkey Driver implements hotkey functionality for Panasonic R1(N
  29. variant), R2, R3, T2, W2, and Y2 laptops on linux for machines running a 2.6
  30. kernel.
  31. %description -l ja
  32. Panasonic ホットキードライバは Panasonic の Let's note R1(N以降), R2, R3,
  33. T2, W2, Y2 のホットキー機能を linux-2.6 で利用するためのドライバです。
  34. %package -n dkms-%{name}
  35. Summary: Panasonic Hotkey Driver
  36. Summary(ja): Panasonic Let's note 用ホットキードライバ
  37. License: GPL2
  38. Group: System Environment/Kernel
  39. Requires(pre): kernel, kernel-devel
  40. Requires(preun): dkms
  41. Requires(post): dkms
  42. %description -n dkms-%{name}
  43. The Panasonic Hotkey Driver implements hotkey functionality for Panasonic R1(N
  44. variant), R2, R3, T2, W2, and Y2 laptops on linux for machines running a 2.6
  45. kernel.
  46. %description -l ja -n dkms-%{name}
  47. Panasonic ホットキードライバは Panasonic の Let's note R1(N以降), R2, R3,
  48. T2, W2, Y2 のホットキー機能を linux-2.6 で利用するためのドライバです。
  49. %prep
  50. %setup -q
  51. %patch10 -p1
  52. %patch11 -p1
  53. %patch12 -p1
  54. %patch13 -p1
  55. %build
  56. %install
  57. %__rm -rf %{buildroot}
  58. mkdir -p %{buildroot}/usr/src/%{name}-%{version}-%{release}
  59. cp -r * %{buildroot}/usr/src/%{name}-%{version}-%{release}/
  60. ## DKMS.CONF ##
  61. cat > %{buildroot}/usr/src/%{name}-%{version}-%{release}/dkms.conf << EOF
  62. PACKAGE_NAME="pcc-acpi"
  63. PACKAGE_VERSION="%{version}-%{release}"
  64. BUILT_MODULE_NAME[0]="pcc_acpi"
  65. DEST_MODULE_LOCATION[0]="/extra/acpi"
  66. MAKE[0]="make -C \${kernel_source_dir} SUBDIRS=\${dkms_tree}/\${PACKAGE_NAME}/\${PACKAGE_VERSION}/build modules"
  67. AUTOINSTALL="YES"
  68. EOF
  69. ## KMP.SPEC ##
  70. sed -e 's|##KMOD_NAME##|%{name}|g' \
  71. -e 's|##KMOD_VER##|%{version}-%{release}|g' \
  72. -e 's|##LICENSE##|%{license}|g' \
  73. %{SOURCE10} > \
  74. %{buildroot}/usr/src/%{name}-%{version}-%{release}/%{name}-kmp.spec
  75. %clean
  76. %__rm -rf ${RPM_BUILD_ROOT}
  77. %post -n dkms-%{name}
  78. dkms add -m pcc-acpi -v %{version}-%{release} --rpm_safe_upgrade
  79. dkms mkkmp -m pcc-acpi -v %{version}-%{release}
  80. dkms build -m pcc-acpi -v %{version}-%{release} --rpm_safe_upgrade
  81. dkms install -m pcc-acpi -v %{version}-%{release} --rpm_safe_upgrade
  82. %preun -n dkms-%{name}
  83. dkms remove -m pcc-acpi -v %{version}-%{release} --rpm_safe_upgrade --all || :
  84. %files -n dkms-%{name}
  85. %defattr(-,root,root)
  86. %doc COPYING INSTALL readme.html
  87. %dir /usr/src/%{name}-%{version}-%{release}
  88. /usr/src/%{name}-%{version}-%{release}/*
  89. %changelog
  90. * Sun Apr 26 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.9-5
  91. - add Source10 for mkkmp feature
  92. * Thu Apr 9 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.9-4
  93. - drop kernel-module-pcc-acpi subpackage; make DKMS-compatible
  94. * Tue Jan 28 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.9-3
  95. - add kflavor(pae,smp..) to package name
  96. * Mon Jul 21 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 0.9-2
  97. - add Patch12 to check return value of input_register_device
  98. and fix minor bug (mdk)
  99. - add Patch13 to build with kernel-2.6.26
  100. * Wed Mar 26 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 0.9-1
  101. - use new versioning policy
  102. * Thu Oct 25 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 0.9-0vl2
  103. - add Patch11 to fix kernel>=2.6.23 apichange (<BTS:0552>)
  104. * Mon Oct 22 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 0.9-0vl1
  105. - new upstream release
  106. * Wed Sep 06 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.8.4-0vl2
  107. - fix typo of Group <BTS:VineLinux:148>.
  108. * Wed Aug 02 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.4-0vl1
  109. - initial build for Vine Linux