lirc-vl.spec 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  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.2
  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. # Vine patch
  25. Patch1000: lirc-fix-build.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(preun): /sbin/chkconfig
  44. %endif
  45. %description
  46. LIRC stands for 'Linux Infra-red Remote Control'.
  47. This package provides the daemons and some utilities to support
  48. infra-red remote controls under Linux.
  49. %description -l ja
  50. LIRC は 'Linux Infra-red Remote Control' の略です。
  51. このパッケージには Linux で赤外線リモコンをサポートする為に
  52. 必要なデーモンといくつかのユーティリティが含まれています。
  53. %package devel
  54. Summary: Development files for LIRC
  55. Summary(ja): LIRCを用いた開発用のファイル
  56. Group: programming
  57. Requires: lirc = %{version}-%{release}
  58. %description devel
  59. LIRC is a package that allows you to decode and send infra-red and
  60. other signals of many (but not all) commonly used remote controls.
  61. Included applications include daemons which decode the received
  62. signals as well as user space applications which allow controlling a
  63. computer with a remote control. This package includes files for
  64. developing applications that use LIRC.
  65. %package -n dkms-%{name}
  66. Summary: Kernel modules for LIRC
  67. Group: system
  68. Requires(post): dkms
  69. Requires(preun):dkms
  70. %description -n dkms-%{name}
  71. This package provides the kernel modules for LIRC.
  72. Install this package if the LIRC driver you are using requires
  73. them and your kernel doesn't include them.
  74. Note that lirc_gpio and lirc_parallel are in packages of their own.
  75. %description -n dkms-%{name} -l ja
  76. このパッケージには LIRC 用のカーネルモジュールが含まれています。
  77. もしあなたが使っている赤外線リモコン用のドライバがカーネルに
  78. 含まれていない場合は、このパッケージをインストールしてください。
  79. 注記: lirc_gpio と lirc_parallel は別のパッケージになっています。
  80. %debug_packate
  81. %prep
  82. %autosetup -p1 -n %{name}-%{version}%{?tag:-}%{?tag}
  83. sed -i -e 's/#effective-user/effective-user /' lirc_options.conf
  84. sed -i -e '/^effective-user/s/=$/= lirc/' lirc_options.conf
  85. sed -i '/User=/s/; *//' systemd/lircd.service
  86. sed -i '/Group=/s/; *//' systemd/lircd.service
  87. sed -i 's/; *user=/User=/' systemd/irexec.service
  88. sed -i 's/; *group=/Group=/' systemd/irexec.service
  89. sed -i -e 's|/usr/local/etc/|/etc/|' contrib/irman2lirc
  90. %build
  91. autoreconf -if
  92. %configure \
  93. --disable-static \
  94. --disable-manage-devices \
  95. --enable-sandboxed \
  96. --with-x \
  97. --with-transmitter \
  98. --with-driver=userspace \
  99. --with-kerneldir=$(pwd)
  100. make LANG=C.utf8 V=0 %{?_smp_mflags}
  101. %install
  102. %{__rm} -rf $RPM_BUILD_ROOT __docs
  103. make -s V=0 LIBTOOLFLAGS="--silent %{?Wnone}" DESTDIR=$RPM_BUILD_ROOT install
  104. chmod 755 $RPM_BUILD_ROOT%{_datadir}/lirc/contrib/irman2lirc
  105. find $RPM_BUILD_ROOT%{_libdir}/ -name \*.la -delete
  106. install -pm 755 contrib/irman2lirc $RPM_BUILD_ROOT%{_bindir}
  107. install -Dpm 644 contrib/60-lirc.rules \
  108. $RPM_BUILD_ROOT%{_udevrulesdir}/60-lirc.rules
  109. install -Dpm 644 %{SOURCE2} \
  110. $RPM_BUILD_ROOT%{_udevrulesdir}/99-remote-control-lirc.rules
  111. %if %{with systemd}
  112. mkdir -p $RPM_BUILD_ROOT/%{_tmpfilesdir}
  113. echo "d %{_rundir}/lirc 0755 lirc lirc -" \
  114. > $RPM_BUILD_ROOT%{_tmpfilesdir}/lirc.conf
  115. %else
  116. %{__install} -Dpm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initdir}/lirc
  117. %{__install} -Dpm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/lirc
  118. %endif
  119. #%{__install} -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/lircd
  120. ## For DKMS sub packagtes
  121. #
  122. #for lircsrcdir in %{name} %{name}-parallel %{name}-gpio; do
  123. for lircsrcdir in %{name}; do
  124. install -d -m755 $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release}
  125. cp -a Makefile Makefile.in Makefile.am \
  126. configure.ac config.status config.h \
  127. $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release}
  128. # Makefiles call there to unnecessarily regenerate files
  129. echo '#!/bin/true' > $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release}/configure
  130. chmod +x $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release}/configure
  131. done
  132. cp -a drivers $RPM_BUILD_ROOT/usr/src/%{name}-%{version}-%{release}
  133. # get modulelist
  134. pushd drivers
  135. drivers=$(echo lirc_* | sed "s/lirc_parallel //" | sed "s/lirc_gpio //")
  136. popd
  137. # Anssi 2009-03 empty directory
  138. drivers="${drivers/lirc_cmdir /}"
  139. cat > $RPM_BUILD_ROOT/usr/src/%{name}-%{version}-%{release}/dkms.conf <<EOF
  140. PACKAGE_NAME="%{name}"
  141. PACKAGE_VERSION="%{version}-%{release}"
  142. MAKE[0]="droot=\\\$(pwd); for driver in $drivers; do cd \\\$droot/drivers/\\\$driver; make \
  143. KERNEL_LOCATION=\$kernel_source_dir AUTOMAKE=true AUTOCONF=true ACLOCAL=true; done"
  144. CLEAN="droot=\\\$(pwd); for driver in $drivers; do cd \\\$droot/drivers/\\\$driver; make \
  145. clean AUTOMAKE=true AUTOCONF=true ACLOCAL=true; done"
  146. AUTOINSTALL=yes
  147. EOF
  148. i=0
  149. for module in $drivers; do
  150. cat >> $RPM_BUILD_ROOT/usr/src/%{name}-%{version}-%{release}/dkms.conf <<-EOF
  151. BUILT_MODULE_NAME[$i]="$module"
  152. BUILT_MODULE_LOCATION[$i]="drivers/$module"
  153. DEST_MODULE_LOCATION[$i]="/kernel/drivers/input/misc"
  154. EOF
  155. i=$((i+1))
  156. done
  157. %pre
  158. getent group lirc >/dev/null || groupadd -r lirc
  159. getent passwd lirc >/dev/null || \
  160. useradd -r -g lirc -d /var/log/lirc -s /sbin/nologin \
  161. -c "LIRC daemon user, runs lircd." lirc
  162. usermod -a -G dialout lirc &> /dev/null || :
  163. usermod -a -G lock lirc &> /dev/null || :
  164. usermod -a -G input lirc &> /dev/null || :
  165. exit 0
  166. %post
  167. %if %{with systemd}
  168. %systemd_post lircd.service lircmd.service
  169. systemd-tmpfiles --create %{_tmpfilesdir}/lirc.conf
  170. %else
  171. /sbin/chkconfig --add lirc
  172. %endif
  173. # If we're upgrading, move config files into their new location, if need be
  174. if [ $1 -ge 2 ] ; then
  175. if [ -e %{_sysconfdir}/lircd.conf -a ! -e %{_sysconfdir}/lirc/lircd.conf ]; then
  176. mv %{_sysconfdir}/lircd.conf %{_sysconfdir}/lirc/lircd.conf
  177. fi
  178. if [ -e %{_sysconfdir}/lircmd.conf -a ! -e %{_sysconfdir}/lirc/lircmd.conf ]; then
  179. mv %{_sysconfdir}/lircmd.conf %{_sysconfdir}/lirc/lircmd.conf
  180. fi
  181. fi
  182. %preun
  183. %if %{with systemd}
  184. %systemd_preun lircd.service lircmd.service
  185. %else
  186. if [ $1 -eq 0 -o -x /bin/systemctl ] ; then
  187. /sbin/service lirc stop || :
  188. /sbin/chkconfig --del lirc || :
  189. fi
  190. %endif
  191. %postun
  192. %if %{with systemd}
  193. %systemd_postun_with_restart lircd.service lircmd.service
  194. %else
  195. if [ "$1" -ge "1" ]; then
  196. /sbin/service lirc condrestart || :
  197. fi
  198. %endif
  199. %post -n dkms-%{name}
  200. dkms add -m %{name} -v %{version}-%{release} --rpm_safe_upgrade &&
  201. dkms build -m %{name} -v %{version}-%{release} --rpm_safe_upgrade &&
  202. dkms install -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --force || :
  203. %preun -n dkms-%{name}
  204. dkms remove -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --all || :
  205. %files
  206. %defattr(-, root, root)
  207. %license COPYING
  208. %doc AUTHORS NEWS README
  209. %doc %{_docdir}/lirc/*
  210. #/etc/logrotate.d/lircd
  211. %dir %{_sysconfdir}/lirc
  212. %dir %{_sysconfdir}/lirc/lircd.conf.d
  213. %ghost %config(noreplace) %{_sysconfdir}/lirc/*.conf
  214. %ghost %config(noreplace) %{_sysconfdir}/lirc/irexec.lircrc
  215. %ghost %config(noreplace) %{_sysconfdir}/lirc/lircd.conf.d/*
  216. %{_bindir}/*
  217. %{_sbindir}/*
  218. %{_libdir}/*.so.*
  219. %{_libdir}/lirc
  220. %{_datadir}/lirc/
  221. %{_mandir}/man?/*
  222. %{_localstatedir}/lib/lirc
  223. %{_udevrulesdir}/*
  224. %{_libdir}/python%{python3_version}/site-packages/lirc
  225. %{_libdir}/python%{python3_version}/site-packages/lirc-setup
  226. %if %{with systemd}
  227. %{_tmpfilesdir}/lirc.conf
  228. %{_unitdir}/lirc*
  229. %{_unitdir}/irexec.service
  230. %else
  231. %{_initdir}/lirc
  232. %config(noreplace) %{_sysconfdir}/sysconfig/lirc
  233. %endif
  234. %files devel
  235. %{_includedir}/lirc/
  236. %{_includedir}/*.h
  237. %{_libdir}/*.so
  238. %{_libdir}/pkgconfig/*.pc
  239. %files -n dkms-%{name}
  240. %defattr(-,root,root)
  241. /usr/src/%{name}-%{version}-%{release}
  242. %changelog
  243. * Mon Jul 08 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.10.2-1
  244. - new upstream release.
  245. - dropped ldconfig scriptlets.
  246. * Sun Aug 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.10.1-1
  247. - new upstream release.
  248. - added systemd support (disabled as default).
  249. * Sat Jul 16 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.9.4-1
  250. - updated to 0.9.4.
  251. - dropped Patch0.
  252. - added a subpackage: lirc-devel.
  253. * Fri Dec 27 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.0-1
  254. - update to 0.9.0
  255. - remove Patch1 (lirc-0.8.6-standardized-remote-keycodes.patch)
  256. - remove Patch2 (lirc-0.8.4-make-remote-names-all-unique.patch)
  257. - remove Patch100 (lirc-0.8.7-mceusb-GV-MC7_RCKIT.patch)
  258. * Sun Oct 17 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 0.8.7-1
  259. - new upstream release
  260. - update Patch1, 2 and 100
  261. - drop Patch3 (already merged by upstream)
  262. * Fri Feb 05 2010 Shu KONNO <owa@bg.wakwak.com> 0.8.6-3
  263. - rebuilt with python-2.6.4-3
  264. * Wed Dec 23 2009 Kazutaka HARADA <kazutaka@vinelinux.org> 0.8.6-2
  265. - add Patch3 to fix compilation error against kernel-2.6.32
  266. * Sat Nov 14 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.8.6-1
  267. - new upstream release
  268. - drop obsolete patches
  269. - add new patches and configuration files from fedora package
  270. - rewrite spec
  271. - add dkms-lirc sub packages refer to mandriva package
  272. (but we don't build lirc-paralle and lirc-gpio sub packages)
  273. * Sat Aug 09 2008 Shu KONNO <owa@bg.wakwak.com> 0.6.5-1vl5
  274. - added lirc-0.6.5-config.patch for x86_64
  275. - applied new versioning policy
  276. - spec in utf-8
  277. * Mon Feb 16 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 0.6.5-0vl1
  278. - initial build for Vine Linux