lirc-vl.spec 12 KB

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