lirc-vl.spec 14 KB

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