lirc-vl.spec 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. %{!?python3_sitelib: %global python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
  2. %global _udevrulesdir /lib/udev/rules.d
  3. Summary: The Linux Infrared Remote Control package.
  4. Summary(ja): 赤外線リモートコントロールパッケージ
  5. Name: lirc
  6. Version: 0.9.4a
  7. Release: 1%{?_dist_release}
  8. License: GPL
  9. Group: System Environment/Daemons
  10. URL: http://www.lirc.org/
  11. Source0: http://prdownloads.sourceforge.net/lirc/%{name}-%{version}.tar.bz2
  12. Source1: lirc.init
  13. Source2: lircd.logrotate
  14. Source3: lirc.sysconfig
  15. Source4: 99-remote-control-lirc.rules
  16. Patch1: 0001-Changing-effective-user-default.patch
  17. # Vine patch
  18. BuildRequires: perl
  19. BuildRequires: libusb1-devel, python-devel
  20. BuildRequires: automake libtool
  21. BuildRequires: alsa-lib-devel
  22. BuildRequires: libXt-devel
  23. BuildRequires: libxslt
  24. BuildRequires: python3
  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. Vendor: Project Vine
  33. Distribution: Vine Linux
  34. Packager: owa, kazutaka
  35. %description
  36. LIRC stands for 'Linux Infra-red Remote Control'.
  37. This package provides the daemons and some utilities to support
  38. infra-red remote controls under Linux.
  39. %description -l ja
  40. LIRC は 'Linux Infra-red Remote Control' の略です。
  41. このパッケージには Linux で赤外線リモコンをサポートする為に
  42. 必要なデーモンといくつかのユーティリティが含まれています。
  43. %package devel
  44. Summary: Development files for LIRC
  45. Summary(ja): LIRCを用いた開発用のファイル
  46. Group: Development/Libraries
  47. Requires: lirc = %{version}-%{release}
  48. %description devel
  49. LIRC is a package that allows you to decode and send infra-red and
  50. other signals of many (but not all) commonly used remote controls.
  51. Included applications include daemons which decode the received
  52. signals as well as user space applications which allow controlling a
  53. computer with a remote control. This package includes files for
  54. developing applications that use LIRC.
  55. %package -n dkms-%{name}
  56. Summary: Kernel modules for LIRC
  57. Group: System Environment/Kernel
  58. Requires(post): dkms
  59. Requires(preun):dkms
  60. %description -n dkms-%{name}
  61. This package provides the kernel modules for LIRC.
  62. Install this package if the LIRC driver you are using requires
  63. them and your kernel doesn't include them.
  64. Note that lirc_gpio and lirc_parallel are in packages of their own.
  65. %description -n dkms-%{name} -l ja
  66. このパッケージには LIRC 用のカーネルモジュールが含まれています。
  67. もしあなたが使っている赤外線リモコン用のドライバがカーネルに
  68. 含まれていない場合は、このパッケージをインストールしてください。
  69. 注記: lirc_gpio と lirc_parallel は別のパッケージになっています。
  70. ## This package up (uni processor) kernel, but only smp kernel is supplied officially.
  71. ## So we don't create this sub package.
  72. #%package -n dkms-%{name}-parallel
  73. #Summary: Parallel port module for LIRC
  74. #Group: System/Kernel and hardware
  75. #Requires: dkms-%{name} = %version
  76. #Requires(post): dkms
  77. #Requires(preun):dkms
  78. #
  79. #%description -n dkms-%{name}-parallel
  80. #This package provides the parallel port module for LIRC.
  81. #
  82. #This module requires a non-SMP kernel.
  83. #
  84. #%description -n dkms-%{name}-parallel -l ja
  85. #このパッケージにはパラレルポート接続の LIRC 用のカーネル
  86. #モジュールが含まれています。
  87. #
  88. #このモジュールは SMP カーネルでは使用できません。
  89. ## Required header files (bttv.h ...) are not included in kernel-devel.
  90. ## So we can't build this package (now?).
  91. #%package -n dkms-%{name}-gpio
  92. #Summary: GPIO module for LIRC
  93. #Group: System/Kernel and hardware
  94. #Requires: dkms-%{name} = %version
  95. #Requires(post): dkms
  96. #Requires(preun):dkms
  97. #
  98. #%description -n dkms-%{name}-gpio
  99. #This package provides the GPIO module for LIRC.
  100. #
  101. #%description -n dkms-%{name}-gpio -l ja
  102. #このパッケージには GPIO 接続の LIRC 用のカーネルモジュールが
  103. #含まれています。
  104. %prep
  105. %setup -q
  106. %patch1 -p1
  107. sed -i -e 's|/usr/local/etc/|/etc/|' contrib/irman2lirc
  108. %build
  109. autoreconf -if
  110. %configure \
  111. --disable-static \
  112. --disable-manage-devices \
  113. --enable-sandboxed \
  114. --with-x \
  115. --with-transmitter \
  116. --with-driver=userspace \
  117. --with-kerneldir=$(pwd)
  118. %{__make}
  119. %install
  120. %{__rm} -rf $RPM_BUILD_ROOT __docs
  121. %{__make} install DESTDIR=$RPM_BUILD_ROOT
  122. %{__install} -Dpm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initdir}/lirc
  123. #%{__install} -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/lircd
  124. %{__install} -Dpm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/lirc
  125. cd $RPM_BUILD_ROOT%{_datadir}/lirc/contrib
  126. chmod 755 irman2lirc
  127. cd $OLDPWD
  128. rm $RPM_BUILD_ROOT%{_libdir}/*.la
  129. rm $RPM_BUILD_ROOT%{_libdir}/lirc/plugins/*.la
  130. install -pm 755 contrib/irman2lirc $RPM_BUILD_ROOT%{_bindir}
  131. install -Dpm 644 contrib/60-lirc.rules \
  132. $RPM_BUILD_ROOT%{_udevrulesdir}/60-lirc.rules
  133. install -Dpm 644 %{SOURCE4} \
  134. $RPM_BUILD_ROOT%{_udevrulesdir}/99-remote-control-lirc.rules
  135. cp -a %{SOURCE1} README.fedora
  136. ## For DKMS sub packagtes
  137. #
  138. #for lircsrcdir in %{name} %{name}-parallel %{name}-gpio; do
  139. for lircsrcdir in %{name}; do
  140. install -d -m755 $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release}
  141. cp -a Makefile Makefile.in Makefile.am \
  142. configure.ac config.status config.h \
  143. $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release}
  144. # Makefiles call there to unnecessarily regenerate files
  145. echo '#!/bin/true' > $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release}/configure
  146. chmod +x $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release}/configure
  147. done
  148. cp -a drivers $RPM_BUILD_ROOT/usr/src/%{name}-%{version}-%{release}
  149. #for drivername in parallel gpio; do
  150. #install -d -m755 $RPM_BUILD_ROOT/usr/src/%{name}-$drivername-%{version}-%{release}/drivers
  151. #mv $RPM_BUILD_ROOT/usr/src/%{name}-%{version}-%{release}/drivers/lirc_$drivername \
  152. # $RPM_BUILD_ROOT/usr/src/%{name}-$drivername-%{version}-%{release}/drivers/
  153. #cp -a drivers/*.h drivers/Makefile* drivers/lirc_dev \
  154. # $RPM_BUILD_ROOT/usr/src/%{name}-$drivername-%{version}-%{release}/drivers/
  155. #
  156. #done
  157. # get modulelist
  158. pushd drivers
  159. drivers=$(echo lirc_* | sed "s/lirc_parallel //" | sed "s/lirc_gpio //")
  160. popd
  161. # Anssi 2009-03 empty directory
  162. drivers="${drivers/lirc_cmdir /}"
  163. cat > $RPM_BUILD_ROOT/usr/src/%{name}-%{version}-%{release}/dkms.conf <<EOF
  164. PACKAGE_NAME="%{name}"
  165. PACKAGE_VERSION="%{version}-%{release}"
  166. MAKE[0]="droot=\\\$(pwd); for driver in $drivers; do cd \\\$droot/drivers/\\\$driver; make \
  167. KERNEL_LOCATION=\$kernel_source_dir AUTOMAKE=true AUTOCONF=true ACLOCAL=true; done"
  168. CLEAN="droot=\\\$(pwd); for driver in $drivers; do cd \\\$droot/drivers/\\\$driver; make \
  169. clean AUTOMAKE=true AUTOCONF=true ACLOCAL=true; done"
  170. AUTOINSTALL=yes
  171. EOF
  172. i=0
  173. for module in $drivers; do
  174. cat >> $RPM_BUILD_ROOT/usr/src/%{name}-%{version}-%{release}/dkms.conf <<-EOF
  175. BUILT_MODULE_NAME[$i]="$module"
  176. BUILT_MODULE_LOCATION[$i]="drivers/$module"
  177. DEST_MODULE_LOCATION[$i]="/kernel/drivers/input/misc"
  178. EOF
  179. i=$((i+1))
  180. done
  181. #for drivername in parallel gpio; do
  182. #cat > %{buildroot}/usr/src/%{name}-$drivername-%{version}-%{release}/dkms.conf <<EOF
  183. #PACKAGE_NAME="%{name}-$drivername"
  184. #PACKAGE_VERSION="%{version}-%{release}"
  185. #MAKE[0]="cd drivers/lirc_$drivername; make \
  186. # KERNEL_LOCATION=\$kernel_source_dir AUTOMAKE=true AUTOCONF=true ACLOCAL=true"
  187. #CLEAN="cd drivers/lirc_$drivername; make \
  188. # clean AUTOMAKE=true AUTOCONF=true ACLOCAL=true"
  189. #AUTOINSTALL=yes
  190. #BUILT_MODULE_NAME[0]="lirc_$drivername"
  191. #BUILT_MODULE_LOCATION[0]="drivers/lirc_$drivername"
  192. #DEST_MODULE_LOCATION[0]="/kernel/drivers/input/misc"
  193. #EOF
  194. #
  195. #done
  196. %pre
  197. getent group lirc >/dev/null || groupadd -r lirc
  198. getent passwd lirc >/dev/null || \
  199. useradd -r -g lirc -d /var/log/lirc -s /sbin/nologin \
  200. -c "LIRC daemon user, runs lircd." lirc
  201. usermod -a -G dialout lirc &> /dev/null || :
  202. usermod -a -G lock lirc &> /dev/null || :
  203. usermod -a -G input lirc &> /dev/null || :
  204. exit 0
  205. %post
  206. /sbin/chkconfig --add lirc
  207. # If we're upgrading, move config files into their new location, if need be
  208. if [ $1 -ge 2 ] ; then
  209. if [ -e %{_sysconfdir}/lircd.conf -a ! -e %{_sysconfdir}/lirc/lircd.conf ]; then
  210. mv %{_sysconfdir}/lircd.conf %{_sysconfdir}/lirc/lircd.conf
  211. fi
  212. if [ -e %{_sysconfdir}/lircmd.conf -a ! -e %{_sysconfdir}/lirc/lircmd.conf ]; then
  213. mv %{_sysconfdir}/lircmd.conf %{_sysconfdir}/lirc/lircmd.conf
  214. fi
  215. fi
  216. /sbin/ldconfig
  217. %preun
  218. if [ $1 -eq 0 ] ; then
  219. /sbin/service lirc stop || :
  220. /sbin/chkconfig --del lirc || :
  221. fi
  222. /sbin/ldconfig
  223. %postun
  224. if [ "$1" -ge "1" ]; then
  225. /sbin/service lirc condrestart || :
  226. fi
  227. %post -n dkms-%{name}
  228. dkms add -m %{name} -v %{version}-%{release} --rpm_safe_upgrade &&
  229. dkms build -m %{name} -v %{version}-%{release} --rpm_safe_upgrade &&
  230. dkms install -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --force || :
  231. %preun -n dkms-%{name}
  232. dkms remove -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --all || :
  233. #%post -n dkms-%{name}-parallel
  234. #dkms add -m %{name}-parallel -v %{version}-%{release} --rpm_safe_upgrade &&
  235. #dkms build -m %{name}-parallel -v %{version}-%{release} --rpm_safe_upgrade &&
  236. #dkms install -m %{name}-parallel -v %{version}-%{release} --rpm_safe_upgrade --force || :
  237. #
  238. #%preun -n dkms-%{name}-parallel
  239. #dkms remove -m %{name}-parallel -v %{version}-%{release} --rpm_safe_upgrade --all || :
  240. #%post -n dkms-%{name}-gpio
  241. #dkms add -m %{name}-gpio -v %{version}-%{release} --rpm_safe_upgrade &&
  242. #dkms build -m %{name}-gpio -v %{version}-%{release} --rpm_safe_upgrade &&
  243. #dkms install -m %{name}-gpio -v %{version}-%{release} --rpm_safe_upgrade --force || :
  244. #
  245. #%preun -n dkms-%{name}-gpio
  246. #dkms remove -m %{name}-gpio -v %{version}-%{release} --rpm_safe_upgrade --all || :
  247. %clean
  248. %{__rm} -rf $RPM_BUILD_ROOT
  249. %files
  250. %defattr(-, root, root)
  251. %license COPYING
  252. %doc ANNOUNCE AUTHORS ChangeLog NEWS README TODO
  253. %doc __docs/*
  254. %{_initdir}/lirc
  255. #/etc/logrotate.d/lircd
  256. %dir %{_sysconfdir}/lirc
  257. %dir %{_sysconfdir}/lirc/lircd.conf.d
  258. %ghost %config(noreplace) %{_sysconfdir}/lirc/*.conf
  259. %ghost %config(noreplace) %{_sysconfdir}/lirc/irexec.lircrc
  260. %ghost %config(noreplace) %{_sysconfdir}/lirc/lircd.conf.d/*
  261. %config(noreplace) %{_sysconfdir}/sysconfig/lirc
  262. %{_bindir}/*
  263. %{_sbindir}/*
  264. %{_libdir}/*.so.*
  265. %{_libdir}/lirc
  266. %{_datadir}/lirc/
  267. %{_docdir}/lirc
  268. %{_mandir}/man?/*
  269. %{_localstatedir}/lib/lirc
  270. %{_udevrulesdir}/*
  271. %{python3_sitelib}/lirc
  272. %files devel
  273. %{_includedir}/lirc/
  274. %{_includedir}/*.h
  275. %{_libdir}/*.so
  276. %{_libdir}/pkgconfig/*.pc
  277. %files -n dkms-%{name}
  278. %defattr(-,root,root)
  279. /usr/src/%{name}-%{version}-%{release}
  280. #%files -n dkms-%{name}-parallel
  281. #%defattr(-,root,root)
  282. #/usr/src/%{name}-parallel-%{version}-%{release}
  283. #%files -n dkms-%{name}-gpio
  284. #%defattr(-,root,root)
  285. #/usr/src/%{name}-gpio-%{version}-%{release}
  286. %changelog
  287. * Sat Jul 16 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.9.4-1
  288. - updated to 0.9.4.
  289. - dropped Patch0.
  290. - added a subpackage: lirc-devel.
  291. * Fri Dec 27 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.0-1
  292. - update to 0.9.0
  293. - remove Patch1 (lirc-0.8.6-standardized-remote-keycodes.patch)
  294. - remove Patch2 (lirc-0.8.4-make-remote-names-all-unique.patch)
  295. - remove Patch100 (lirc-0.8.7-mceusb-GV-MC7_RCKIT.patch)
  296. * Sun Oct 17 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 0.8.7-1
  297. - new upstream release
  298. - update Patch1, 2 and 100
  299. - drop Patch3 (already merged by upstream)
  300. * Fri Feb 05 2010 Shu KONNO <owa@bg.wakwak.com> 0.8.6-3
  301. - rebuilt with python-2.6.4-3
  302. * Wed Dec 23 2009 Kazutaka HARADA <kazutaka@vinelinux.org> 0.8.6-2
  303. - add Patch3 to fix compilation error against kernel-2.6.32
  304. * Sat Nov 14 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.8.6-1
  305. - new upstream release
  306. - drop obsolete patches
  307. - add new patches and configuration files from fedora package
  308. - rewrite spec
  309. - add dkms-lirc sub packages refer to mandriva package
  310. (but we don't build lirc-paralle and lirc-gpio sub packages)
  311. * Sat Aug 09 2008 Shu KONNO <owa@bg.wakwak.com> 0.6.5-1vl5
  312. - added lirc-0.6.5-config.patch for x86_64
  313. - applied new versioning policy
  314. - spec in utf-8
  315. * Mon Feb 16 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 0.6.5-0vl1
  316. - initial build for Vine Linux