motion-4.0.1-r1.ebuild 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit autotools readme.gentoo-r1 user systemd
  5. DESCRIPTION="A software motion detector"
  6. HOMEPAGE="https://motion-project.github.io"
  7. SRC_URI="https://github.com/Motion-Project/${PN}/archive/release-${PV}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc x86"
  11. IUSE="ffmpeg libav mmal mysql postgres v4l"
  12. RDEPEND="
  13. ffmpeg? (
  14. libav? ( media-video/libav:= )
  15. !libav? ( media-video/ffmpeg:0= )
  16. )
  17. virtual/jpeg:=
  18. mmal? ( media-libs/raspberrypi-userland )
  19. mysql? ( virtual/mysql )
  20. postgres? ( dev-db/postgresql:= )
  21. "
  22. DEPEND="${RDEPEND}
  23. v4l? ( virtual/os-headers media-libs/libv4l )
  24. "
  25. DISABLE_AUTOFORMATTING="yes"
  26. DOC_CONTENTS="You need to setup /etc/${PN}/${PN}.conf before running
  27. ${PN} for the first time. You can use /etc/${PN}/${PN}-dist.conf as a
  28. template. Please note that the 'daemon' and 'process_id_file' settings
  29. are overridden by the bundled OpenRC init script and systemd unit where
  30. appropriate.
  31. To install ${PN} as a service, use:
  32. rc-update add ${PN} default # with OpenRC
  33. systemctl enable ${PN}.service # with systemd
  34. "
  35. pkg_setup() {
  36. enewuser ${PN} -1 -1 -1 video
  37. }
  38. S="${WORKDIR}"/${PN}-release-${PV}
  39. src_prepare() {
  40. eapply_user
  41. eautoreconf
  42. }
  43. src_configure() {
  44. econf \
  45. $(use_with ffmpeg) \
  46. $(use_with mmal) \
  47. $(use_with mysql) \
  48. $(use_with postgres pgsql) \
  49. $(use_with v4l) \
  50. --without-optimizecpu
  51. }
  52. src_install() {
  53. emake \
  54. DESTDIR="${D}" \
  55. docdir=/usr/share/doc/${PF} \
  56. examplesdir=/usr/share/doc/${PF}/examples \
  57. install
  58. newinitd "${FILESDIR}"/${PN}.initd-r3 ${PN}
  59. newconfd "${FILESDIR}"/${PN}.confd ${PN}
  60. systemd_dounit "${FILESDIR}"/${PN}.service
  61. systemd_dounit "${FILESDIR}"/${PN}_at.service
  62. systemd_dotmpfilesd "${FILESDIR}"/${PN}.conf
  63. keepdir /var/lib/motion
  64. fowners motion:video /var/lib/motion
  65. fperms 0750 /var/lib/motion
  66. readme.gentoo_create_doc
  67. }