summaryrefslogtreecommitdiff
path: root/community/motion/PKGBUILD
blob: d4b737918459762accd588aa040a1e0c6685a1f9 (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
41
42
43
44
45
46
47
48
# $Id: PKGBUILD 90689 2013-05-13 14:29:50Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=motion
pkgver=3.2.12
pkgrel=9
pkgdesc="A software motion detector which grabs images from video4linux devices and/or from webcams"
arch=('i686' 'x86_64')
license=('GPL')
url="http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome"
depends=('libjpeg' 'v4l-utils' 'ffmpeg-compat')
backup=('etc/motion/motion.conf')
options=('!makeflags')
source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz
	motion.service
	motion.tmpfiles
	ffmpeg-0.8.patch
	linux-headers.patch
	ffmpeg-compat.patch)
md5sums=('1ba0065ed50509aaffb171594c689f46'
         'b5b589f8f39939b7a1802cbd9dbe2e1a'
         'f863f8c025f7f025b2178def8418decd'
         'd36687710837d69fbce4608b1345fa34'
         'd8c3c4fdded5cfbd729710475559a21d'
         'e85c596292aceb425fcf17e5072e2fff')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  export PKG_CONFIG_PATH=/usr/lib/ffmpeg-compat/pkgconfig:$PKG_CONFIG_PATH
  patch -Np1 -i $srcdir/ffmpeg-0.8.patch
  patch -Np1 -i $srcdir/linux-headers.patch
  patch -Np1 -i $srcdir/ffmpeg-compat.patch
  autoreconf
  ./configure --prefix=/usr \
    --without-pgsql \
    --without-mysql \
    --sysconfdir=/etc/motion \
    --with-ffmpeg
  make
}

package(){
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  mv "${pkgdir}/etc/motion/motion-dist.conf" "${pkgdir}/etc/motion/motion.conf"
  install -Dm644 "${srcdir}/motion.service" "${pkgdir}/usr/lib/systemd/system/motion.service"
  install -Dm644 "${srcdir}/motion.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/motion.conf"
}