Remove BR2_DEPRECATED
[buildroot-gz.git] / package / motion / motion.mk
blobde29a2a8e2e879644138b02e730eb494970539a6
1 ################################################################################
3 # motion
5 ################################################################################
7 MOTION_VERSION = release-3.4.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 and configure.ac is patched
13 MOTION_AUTORECONF = YES
15 # This patch fixes detection of sqlite when cross-compiling
16 MOTION_PATCH = \
17 https://github.com/Motion-Project/motion/commit/709f626b7ef83a2bb3ef1f77205276207ab27196.patch
19 # This patch adds --with-sdl=[DIR] option to fix detection of sdl-config
20 MOTION_PATCH += \
21 https://github.com/Motion-Project/motion/commit/72193ccaff83fcb074c9aaa37c5691a8d8a18c7c.patch
23 # motion does not use any specific function of jpeg-turbo, so just relies on
24 # jpeg selection
25 MOTION_CONF_OPTS += --without-jpeg-turbo
27 ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE),y)
28 MOTION_DEPENDENCIES += ffmpeg
29 MOTION_CONF_OPTS += --with-ffmpeg
30 else
31 MOTION_CONF_OPTS += --without-ffmpeg
32 endif
34 ifeq ($(BR2_PACKAGE_MYSQL),y)
35 MOTION_DEPENDENCIES += mysql
36 MOTION_CONF_OPTS += \
37 --with-mysql \
38 --with-mysql-include=$(STAGING_DIR)/usr/include/mysql \
39 --with-mysql-lib=$(STAGING_DIR)/usr/lib
40 else
41 MOTION_CONF_OPTS += --without-mysql
42 endif
44 ifeq ($(BR2_PACKAGE_POSTGRESQL),y)
45 MOTION_DEPENDENCIES += postgresql
46 MOTION_CONF_OPTS += \
47 --with-postgresql \
48 --with-pgsql-include=$(STAGING_DIR)/usr/include \
49 --with-pgsql-lib=$(STAGING_DIR)/usr/lib
50 else
51 MOTION_CONF_OPTS += --without-postgresql
52 endif
54 ifeq ($(BR2_PACKAGE_SDL),y)
55 MOTION_DEPENDENCIES += sdl
56 MOTION_CONF_OPTS += --with-sdl=$(STAGING_DIR)/usr
57 else
58 MOTION_CONF_OPTS += --without-sdl
59 endif
61 ifeq ($(BR2_PACKAGE_SQLITE),y)
62 MOTION_DEPENDENCIES += sqlite
63 MOTION_CONF_OPTS += --with-sqlite3
64 else
65 MOTION_CONF_OPTS += --without-sqlite3
66 endif
68 # Do not use default install target as it installs many unneeded files and
69 # directories: docs, examples and init scripts
70 define MOTION_INSTALL_TARGET_CMDS
71 $(INSTALL) -D -m 0644 $(@D)/motion-dist.conf \
72 $(TARGET_DIR)/etc/motion.conf
73 $(INSTALL) -D -m 0755 $(@D)/motion $(TARGET_DIR)/usr/bin/motion
74 endef
76 define MOTION_INSTALL_INIT_SYSV
77 $(INSTALL) -D -m 0755 package/motion/S99motion \
78 $(TARGET_DIR)/etc/init.d/S99motion
79 endef
81 define MOTION_INSTALL_INIT_SYSTEMD
82 $(INSTALL) -D -m 644 package/motion/motion.service \
83 $(TARGET_DIR)/usr/lib/systemd/system/motion.service
84 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
85 ln -sf ../../../../usr/lib/systemd/system/motion.service \
86 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/motion.service
87 endef
89 $(eval $(autotools-package))