motion: bump to version 4.0.1
[buildroot-gz.git] / package / motion / motion.mk
blob49c0c6a04776d7a2cc73a9bd1e1c0c1dcbc5e980
1 ################################################################################
3 # motion
5 ################################################################################
7 MOTION_VERSION = release-4.0.1
8 MOTION_SITE = $(call github,Motion-Project,motion,$(MOTION_VERSION))
9 MOTION_LICENSE = GPLv2
10 MOTION_LICENSE_FILES = COPYING
11 MOTION_DEPENDENCIES = host-pkgconf jpeg
12 # From git
13 MOTION_AUTORECONF = YES
15 # motion does not use any specific function of jpeg-turbo, so just relies on
16 # jpeg selection
17 MOTION_CONF_OPTS += --without-jpeg-turbo
19 ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE),y)
20 MOTION_DEPENDENCIES += ffmpeg
21 MOTION_CONF_OPTS += --with-ffmpeg
22 else
23 MOTION_CONF_OPTS += --without-ffmpeg
24 endif
26 ifeq ($(BR2_PACKAGE_MYSQL),y)
27 MOTION_DEPENDENCIES += mysql
28 MOTION_CONF_OPTS += \
29 --with-mysql \
30 --with-mysql-include=$(STAGING_DIR)/usr/include/mysql \
31 --with-mysql-lib=$(STAGING_DIR)/usr/lib
32 else
33 MOTION_CONF_OPTS += --without-mysql
34 endif
36 ifeq ($(BR2_PACKAGE_POSTGRESQL),y)
37 MOTION_DEPENDENCIES += postgresql
38 MOTION_CONF_OPTS += \
39 --with-pgsql \
40 --with-pgsql-include=$(STAGING_DIR)/usr/include \
41 --with-pgsql-lib=$(STAGING_DIR)/usr/lib
42 else
43 MOTION_CONF_OPTS += --without-pgsql
44 endif
46 ifeq ($(BR2_PACKAGE_SDL),y)
47 MOTION_DEPENDENCIES += sdl
48 MOTION_CONF_OPTS += --with-sdl=$(STAGING_DIR)/usr
49 # overwrite ac_cv_path_CONFIG_SDL in case sdl development is
50 # installed on the host
51 MOTION_CONF_ENV += ac_cv_path_CONFIG_SDL=$(STAGING_DIR)/usr/bin/sdl-config
52 else
53 MOTION_CONF_OPTS += --without-sdl
54 endif
56 ifeq ($(BR2_PACKAGE_SQLITE),y)
57 MOTION_DEPENDENCIES += sqlite
58 MOTION_CONF_OPTS += --with-sqlite3
59 else
60 MOTION_CONF_OPTS += --without-sqlite3
61 endif
63 # Do not use default install target as it installs many unneeded files and
64 # directories: docs, examples and init scripts
65 define MOTION_INSTALL_TARGET_CMDS
66 $(INSTALL) -D -m 0644 $(@D)/motion-dist.conf \
67 $(TARGET_DIR)/etc/motion.conf
68 $(INSTALL) -D -m 0755 $(@D)/motion $(TARGET_DIR)/usr/bin/motion
69 endef
71 define MOTION_INSTALL_INIT_SYSV
72 $(INSTALL) -D -m 0755 package/motion/S99motion \
73 $(TARGET_DIR)/etc/init.d/S99motion
74 endef
76 define MOTION_INSTALL_INIT_SYSTEMD
77 $(INSTALL) -D -m 644 package/motion/motion.service \
78 $(TARGET_DIR)/usr/lib/systemd/system/motion.service
79 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
80 ln -sf ../../../../usr/lib/systemd/system/motion.service \
81 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/motion.service
82 endef
84 $(eval $(autotools-package))