summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 39a0cae7d382d4315824c3ac98cafee25c27dd76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Maintainer: Sebastiaan Lokhorst <sebastiaanlokhorst@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=motion-git
_pkgname=motion
pkgver=release.4.0.r178.ga801f19
pkgrel=1
pkgdesc="A software motion detector which grabs images from video4linux devices and/or from webcams"
arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64')
license=('GPL')
url="https://motion-project.github.io/"
depends=('libjpeg' 'v4l-utils' 'ffmpeg')
provides=('motion')
conflicts=('motion')
backup=('etc/motion/motion.conf')
source=($_pkgname::git+https://github.com/Motion-Project/${_pkgname}.git)
md5sums=('SKIP')

pkgver() {
  cd "${_pkgname}"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "${srcdir}/${_pkgname}"
  autoreconf
  ./configure --prefix=/usr --sysconfdir=/etc --without-mysql --without-pgsql
  make
}

package(){
  cd "${srcdir}/${_pkgname}"
  make DESTDIR="${pkgdir}" install
  mv "${pkgdir}"/etc/motion/motion{-dist,}.conf
  mv "${pkgdir}"/etc/motion/camera1{-dist,}.conf
  mv "${pkgdir}"/etc/motion/camera2{-dist,}.conf
  mv "${pkgdir}"/etc/motion/camera3{-dist,}.conf
  mv "${pkgdir}"/etc/motion/camera4{-dist,}.conf
  install -Dm644 "${pkgdir}/usr/share/motion/examples/motion.service" "${pkgdir}/usr/lib/systemd/system/motion.service"
}