summaryrefslogtreecommitdiffstats
path: root/testing/motion/APKBUILD
blob: 731ae5ad8366fb028bc51f59bc68dab46910d1b1 (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
49
50
51
52
53
54
55
56
# Contributor: Mika Havela <mika.havela@gmail.com>
# Maintainer: Mika Havela <mika.havela@gmail.com>
pkgname=motion
pkgver=3.2.12
pkgrel=0
pkgdesc="Detect if a significant part of the picture has changed (e.g. from a webcam)."
url="http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome"
arch="all"
license="GPL2"
pkgusers="motion"
pkggroups="motion"
depends="jpeg v4l-utils"   # Add ffmpeg (when motion is patched/fixed for this)
depends_dev=""
makedepends="$depends_dev bash jpeg-dev v4l-utils-dev"  # Add ffmpeg-dev (when motion is patched/fixed for this)
install="$pkgname.pre-install"
subpackages="$pkgname-doc"
source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
motion.confd
motion.initd
motion-dist.conf.in.patch"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	sed -i 's@<linux/videodev.h>@<libv4l1.h>\n#include <linux/videodev2.h>@' *.c *.h
}

build() {
	cd "$_builddir"
	./configure \
	  --prefix=/usr \
	  --sysconfdir=/etc/motion

	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	install -d -o "$pkgusers" -g "$pkggroups" "$pkgdir"/var/run/motion
	install -d -o "$pkgusers" -g "$pkggroups" "$pkgdir"/home/motion/motion_captures    # Default config is configured to store captures here
	install -Dm644 "$srcdir"/"$pkgname".confd "$pkgdir"/etc/conf.d/"$pkgname"
	install -Dm755 "$srcdir"/"$pkgname".initd "$pkgdir"/etc/init.d/"$pkgname"
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}

md5sums="1ba0065ed50509aaffb171594c689f46  motion-3.2.12.tar.gz
c444bfd48ac8d6272d5191836ceb544a  motion.confd
3acfe162df3fec28c88c1688e7385189  motion.initd
2ee4fa214987e7643025732f016e9296  motion-dist.conf.in.patch"