lirc-vl.spec 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. Summary: The Linux Infrared Remote Control package.
  2. Summary(ja): 赤外線リモートコントロールパッケージ
  3. Name: lirc
  4. Version: 0.8.6
  5. Release: 3%{?_dist_release}
  6. License: GPL
  7. Group: System Environment/Daemons
  8. URL: http://www.lirc.org/
  9. Source0: http://prdownloads.sourceforge.net/lirc/%{name}-%{version}.tar.bz2
  10. Source1: lirc.init
  11. Source2: lircd.logrotate
  12. Source3: lirc.sysconfig
  13. Patch0: lirc-use-new-instead-of-conf-as-filename-suffix.patch
  14. # https://bugzilla.redhat.com/show_bug.cgi?id=457273
  15. # http://thread.gmane.org/gmane.comp.hardware.lirc/6884
  16. Patch1: lirc-0.8.6-standardized-remote-keycodes.patch
  17. Patch2: lirc-0.8.4-make-remote-names-all-unique.patch
  18. # http://sourceforge.net/mailarchive/forum.php?thread_name=453E54B8-5C11-41E1-84E9-5EFF3CF9B3F1%40wilsonet.com&forum_name=lirc-list
  19. Patch3: lirc-0.8.6-linux-2.6.32.patch
  20. # Vine patch
  21. Patch100: lirc-0.8.6-mceusb-GV-MC7_RCKIT.patch
  22. BuildRequires: perl
  23. BuildRequires: libusb-devel, python-devel
  24. BuildRequires: automake libtool
  25. BuildRequires: alsa-lib-devel
  26. BuildRequires: libXt-devel
  27. ## Currently not supportd (yet) for Vine Linux
  28. #BuildRequires: libftdi-devel, libirman-devel
  29. Requires(post): /sbin/chkconfig
  30. Requires(post): /sbin/ldconfig
  31. Requires(preun): /sbin/chkconfig
  32. Requires(postun): /sbin/ldconfig
  33. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  34. %description
  35. LIRC stands for 'Linux Infra-red Remote Control'.
  36. This package provides the daemons and some utilities to support
  37. infra-red remote controls under Linux.
  38. %description -l ja
  39. LIRC は 'Linux Infra-red Remote Control' の略です。
  40. このパッケージには Linux で赤外線リモコンをサポートする為に
  41. 必要なデーモンといくつかのユーティリティが含まれています。
  42. %package -n dkms-%{name}
  43. Summary: Kernel modules for LIRC
  44. Group: System Environment/Kernel
  45. Requires(post): dkms
  46. Requires(preun):dkms
  47. %description -n dkms-%{name}
  48. This package provides the kernel modules for LIRC.
  49. Install this package if the LIRC driver you are using requires
  50. them and your kernel doesn't include them.
  51. Note that lirc_gpio and lirc_parallel are in packages of their own.
  52. %description -n dkms-%{name} -l ja
  53. このパッケージには LIRC 用のカーネルモジュールが含まれています。
  54. もしあなたが使っている赤外線リモコン用のドライバがカーネルに
  55. 含まれていない場合は、このパッケージをインストールしてください。
  56. 注記: lirc_gpio と lirc_parallel は別のパッケージになっています。
  57. ## This package up (uni processor) kernel, but only smp kernel is supplied officially.
  58. ## So we don't create this sub package.
  59. #%package -n dkms-%{name}-parallel
  60. #Summary: Parallel port module for LIRC
  61. #Group: System/Kernel and hardware
  62. #Requires: dkms-%{name} = %version
  63. #Requires(post): dkms
  64. #Requires(preun):dkms
  65. #
  66. #%description -n dkms-%{name}-parallel
  67. #This package provides the parallel port module for LIRC.
  68. #
  69. #This module requires a non-SMP kernel.
  70. #
  71. #%description -n dkms-%{name}-parallel -l ja
  72. #このパッケージにはパラレルポート接続の LIRC 用のカーネル
  73. #モジュールが含まれています。
  74. #
  75. #このモジュールは SMP カーネルでは使用できません。
  76. ## Required header files (bttv.h ...) are not included in kernel-devel.
  77. ## So we can't build this package (now?).
  78. #%package -n dkms-%{name}-gpio
  79. #Summary: GPIO module for LIRC
  80. #Group: System/Kernel and hardware
  81. #Requires: dkms-%{name} = %version
  82. #Requires(post): dkms
  83. #Requires(preun):dkms
  84. #
  85. #%description -n dkms-%{name}-gpio
  86. #This package provides the GPIO module for LIRC.
  87. #
  88. #%description -n dkms-%{name}-gpio -l ja
  89. #このパッケージには GPIO 接続の LIRC 用のカーネルモジュールが
  90. #含まれています。
  91. %prep
  92. %setup -q
  93. %patch0 -p1 -b .suffix
  94. %patch3 -p1 -b .kcompat
  95. %patch100 -p1 -b .rckit
  96. %{__chmod} 644 contrib/*
  97. %{__chmod} +x contrib/hal
  98. %{__sed} -i -e 's|/usr/local/etc/|/etc/|' contrib/irman2lirc
  99. %{__sed} -i -e 's/\r//' remotes/hercules/lircd.conf.smarttv_stereo \
  100. remotes/adstech/lircd.conf.usbx-707
  101. %{__sed} -i -e 's|/sbin/init.d/lircd|%{_initdir}/lirc|' contrib/lircs
  102. for f in remotes/chronos/lircd.conf.chronos \
  103. remotes/creative/lircd.conf.livedrive \
  104. remotes/atiusb/lircd.conf.atiusb \
  105. NEWS ChangeLog AUTHORS contrib/lircrc ; do
  106. iconv -f iso-8859-1 -t utf-8 $f > $f.utf8 ; mv $f.utf8 $f
  107. done
  108. # use /dev/lirc0 by default instead of /dev/lirc
  109. %{__sed} -i -e 's|#define DEV_LIRC "lirc"|#define DEV_LIRC "lirc0"|' config.h.in
  110. # use fixed instead of Courier w/xmode2, should be more prevalent on linux boxen
  111. %{__sed} -i -e 's|char.*font1_name.*Courier.*$|char font1_name[]="-misc-fixed-*-r-*-*-12-*-*-*-*-*-iso8859-1";|g' tools/xmode2.c
  112. # lib64 rpath
  113. %{__sed} -i -e 's|"/lib /usr/lib |"/%{_lib} %{_libdir} |' configure
  114. # *cough* I wish there was a good way to disable portaudio/svgalib...
  115. %{__sed} -i -e 's/portaudio.h/PORTAUDIO_DISABLED/g' configure*
  116. %{__sed} -i -e 's/vga.h/SVGALIB_DISABLED/g' configure*
  117. # avoid autofoo re-run
  118. touch -r aclocal.m4 configure.ac
  119. # Do this after, as we're touching the remote definitions earlier
  120. # Don't create a backup, or the original definitions will get installed
  121. %patch1 -p1 -b .keycode
  122. %patch2 -p1 -b .uniq
  123. %build
  124. %configure \
  125. --disable-static \
  126. --disable-manage-devices \
  127. --enable-sandboxed \
  128. --with-x \
  129. --with-transmitter \
  130. --with-driver=userspace \
  131. --with-kerneldir=$(pwd)
  132. %{__make}
  133. %install
  134. %{__rm} -rf $RPM_BUILD_ROOT __docs
  135. %{__make} install DESTDIR=$RPM_BUILD_ROOT
  136. %{__install} -Dpm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initdir}/lirc
  137. %{__perl} -pi -e \
  138. 's|/etc/|%{_sysconfdir}/|g ;
  139. s|/var/|%{_localstatedir}/|g ;
  140. s|/usr/sbin/|%{_sbindir}/|g' \
  141. $RPM_BUILD_ROOT%{_initdir}/lirc
  142. #%{__install} -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/lircd
  143. %{__install} -Dpm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/lirc
  144. %{__install} -Dpm 644 doc/lirc.hwdb $RPM_BUILD_ROOT%{_datadir}/lirc/lirc.hwdb
  145. %{__install} -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/lirc
  146. touch $RPM_BUILD_ROOT%{_sysconfdir}/lirc/lirc{d,md}.conf
  147. %{__install} -dm 755 $RPM_BUILD_ROOT%{_localstatedir}/run/lirc/
  148. touch $RPM_BUILD_ROOT%{_localstatedir}/run/lirc/lirc{d,m}
  149. # Put remote definitions in place
  150. cp -ar remotes $RPM_BUILD_ROOT%{_datadir}/lirc-remotes
  151. # Remove unpacked file
  152. %{__rm} $RPM_BUILD_ROOT%{_libdir}/liblirc_client.la
  153. # Remove unnecessary documents
  154. %{__mkdir} __docs
  155. %{__cp} -pR doc contrib __docs
  156. pushd __docs
  157. %{__rm} -rf doc/Makefile* doc/.libs doc/man* doc/lirc.hwdb
  158. %{__rm} -rf contrib/irman2lirc contrib/lirc.* contrib/sendxevent.c
  159. popd
  160. ## For DKMS sub packagtes
  161. #
  162. #for lircsrcdir in %{name} %{name}-parallel %{name}-gpio; do
  163. for lircsrcdir in %{name}; do
  164. install -d -m755 $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release}
  165. cp -a Makefile Makefile.in Makefile.am acinclude.m4 \
  166. configure.ac config.status config.h \
  167. $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release}
  168. # Makefiles call there to unnecessarily regenerate files
  169. echo '#!/bin/true' > $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release}/configure
  170. chmod +x $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release}/configure
  171. done
  172. cp -a drivers $RPM_BUILD_ROOT/usr/src/%{name}-%{version}-%{release}
  173. #for drivername in parallel gpio; do
  174. #install -d -m755 $RPM_BUILD_ROOT/usr/src/%{name}-$drivername-%{version}-%{release}/drivers
  175. #mv $RPM_BUILD_ROOT/usr/src/%{name}-%{version}-%{release}/drivers/lirc_$drivername \
  176. # $RPM_BUILD_ROOT/usr/src/%{name}-$drivername-%{version}-%{release}/drivers/
  177. #cp -a drivers/*.h drivers/Makefile* drivers/lirc_dev \
  178. # $RPM_BUILD_ROOT/usr/src/%{name}-$drivername-%{version}-%{release}/drivers/
  179. #
  180. #done
  181. # get modulelist
  182. pushd drivers
  183. drivers=$(echo lirc_* | sed "s/lirc_parallel //" | sed "s/lirc_gpio //")
  184. popd
  185. # Anssi 2009-03 empty directory
  186. drivers="${drivers/lirc_cmdir /}"
  187. cat > $RPM_BUILD_ROOT/usr/src/%{name}-%{version}-%{release}/dkms.conf <<EOF
  188. PACKAGE_NAME="%{name}"
  189. PACKAGE_VERSION="%{version}-%{release}"
  190. MAKE[0]="droot=\\\$(pwd); for driver in $drivers; do cd \\\$droot/drivers/\\\$driver; make \
  191. KERNEL_LOCATION=\$kernel_source_dir AUTOMAKE=true AUTOCONF=true ACLOCAL=true; done"
  192. CLEAN="droot=\\\$(pwd); for driver in $drivers; do cd \\\$droot/drivers/\\\$driver; make \
  193. clean AUTOMAKE=true AUTOCONF=true ACLOCAL=true; done"
  194. AUTOINSTALL=yes
  195. EOF
  196. i=0
  197. for module in $drivers; do
  198. cat >> $RPM_BUILD_ROOT/usr/src/%{name}-%{version}-%{release}/dkms.conf <<-EOF
  199. BUILT_MODULE_NAME[$i]="$module"
  200. BUILT_MODULE_LOCATION[$i]="drivers/$module"
  201. DEST_MODULE_LOCATION[$i]="/kernel/drivers/input/misc"
  202. EOF
  203. i=$((i+1))
  204. done
  205. #for drivername in parallel gpio; do
  206. #cat > %{buildroot}/usr/src/%{name}-$drivername-%{version}-%{release}/dkms.conf <<EOF
  207. #PACKAGE_NAME="%{name}-$drivername"
  208. #PACKAGE_VERSION="%{version}-%{release}"
  209. #MAKE[0]="cd drivers/lirc_$drivername; make \
  210. # KERNEL_LOCATION=\$kernel_source_dir AUTOMAKE=true AUTOCONF=true ACLOCAL=true"
  211. #CLEAN="cd drivers/lirc_$drivername; make \
  212. # clean AUTOMAKE=true AUTOCONF=true ACLOCAL=true"
  213. #AUTOINSTALL=yes
  214. #BUILT_MODULE_NAME[0]="lirc_$drivername"
  215. #BUILT_MODULE_LOCATION[0]="drivers/lirc_$drivername"
  216. #DEST_MODULE_LOCATION[0]="/kernel/drivers/input/misc"
  217. #EOF
  218. #
  219. #done
  220. %post
  221. /sbin/chkconfig --add lirc
  222. # If we're upgrading, move config files into their new location, if need be
  223. if [ $1 -ge 2 ] ; then
  224. if [ -e %{_sysconfdir}/lircd.conf -a ! -e %{_sysconfdir}/lirc/lircd.conf ]; then
  225. mv %{_sysconfdir}/lircd.conf %{_sysconfdir}/lirc/lircd.conf
  226. fi
  227. if [ -e %{_sysconfdir}/lircmd.conf -a ! -e %{_sysconfdir}/lirc/lircmd.conf ]; then
  228. mv %{_sysconfdir}/lircmd.conf %{_sysconfdir}/lirc/lircmd.conf
  229. fi
  230. fi
  231. /sbin/ldconfig
  232. %preun
  233. if [ $1 -eq 0 ] ; then
  234. /sbin/service lirc stop || :
  235. /sbin/chkconfig --del lirc || :
  236. fi
  237. /sbin/ldconfig
  238. %postun
  239. if [ "$1" -ge "1" ]; then
  240. /sbin/service lirc condrestart || :
  241. fi
  242. %post -n dkms-%{name}
  243. dkms add -m %{name} -v %{version}-%{release} --rpm_safe_upgrade &&
  244. dkms build -m %{name} -v %{version}-%{release} --rpm_safe_upgrade &&
  245. dkms install -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --force || :
  246. %preun -n dkms-%{name}
  247. dkms remove -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --all || :
  248. #%post -n dkms-%{name}-parallel
  249. #dkms add -m %{name}-parallel -v %{version}-%{release} --rpm_safe_upgrade &&
  250. #dkms build -m %{name}-parallel -v %{version}-%{release} --rpm_safe_upgrade &&
  251. #dkms install -m %{name}-parallel -v %{version}-%{release} --rpm_safe_upgrade --force || :
  252. #
  253. #%preun -n dkms-%{name}-parallel
  254. #dkms remove -m %{name}-parallel -v %{version}-%{release} --rpm_safe_upgrade --all || :
  255. #%post -n dkms-%{name}-gpio
  256. #dkms add -m %{name}-gpio -v %{version}-%{release} --rpm_safe_upgrade &&
  257. #dkms build -m %{name}-gpio -v %{version}-%{release} --rpm_safe_upgrade &&
  258. #dkms install -m %{name}-gpio -v %{version}-%{release} --rpm_safe_upgrade --force || :
  259. #
  260. #%preun -n dkms-%{name}-gpio
  261. #dkms remove -m %{name}-gpio -v %{version}-%{release} --rpm_safe_upgrade --all || :
  262. %clean
  263. %{__rm} -rf $RPM_BUILD_ROOT
  264. %files
  265. %defattr(-, root, root)
  266. %doc ANNOUNCE AUTHORS ChangeLog COPYING NEWS README TODO
  267. %doc __docs/*
  268. %{_initdir}/lirc
  269. #/etc/logrotate.d/lircd
  270. %ghost %config(noreplace) %{_sysconfdir}/lirc/lirc*d.conf
  271. %config(noreplace) %{_sysconfdir}/sysconfig/lirc
  272. %{_bindir}/*
  273. %{_sbindir}/*
  274. %{_includedir}/lirc
  275. %{_libdir}/liblirc_*
  276. %{_datadir}/lirc/
  277. %{_datadir}/lirc-remotes/
  278. %{_mandir}/man?/*
  279. %ghost %{_localstatedir}/run/lirc/lirc*
  280. %files -n dkms-%{name}
  281. %defattr(-,root,root)
  282. /usr/src/%{name}-%{version}-%{release}
  283. #%files -n dkms-%{name}-parallel
  284. #%defattr(-,root,root)
  285. #/usr/src/%{name}-parallel-%{version}-%{release}
  286. #%files -n dkms-%{name}-gpio
  287. #%defattr(-,root,root)
  288. #/usr/src/%{name}-gpio-%{version}-%{release}
  289. %changelog
  290. * Fri Feb 05 2010 Shu KONNO <owa@bg.wakwak.com> 0.8.6-3
  291. - rebuilt with python-2.6.4-3
  292. * Wed Dec 23 2009 Kazutaka HARADA <kazutaka@vinelinux.org> 0.8.6-2
  293. - add Patch3 to fix compilation error against kernel-2.6.32
  294. * Sat Nov 14 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.8.6-1
  295. - new upstream release
  296. - drop obsolete patches
  297. - add new patches and configuration files from fedora package
  298. - rewrite spec
  299. - add dkms-lirc sub packages refer to mandriva package
  300. (but we don't build lirc-paralle and lirc-gpio sub packages)
  301. * Sat Aug 09 2008 Shu KONNO <owa@bg.wakwak.com> 0.6.5-1vl5
  302. - added lirc-0.6.5-config.patch for x86_64
  303. - applied new versioning policy
  304. - spec in utf-8
  305. * Mon Feb 16 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 0.6.5-0vl1
  306. - initial build for Vine Linux