lirc-vl.spec 12 KB

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