mirror of
https://github.com/Motion-Project/motion.git
synced 2026-02-25 02:47:14 -05:00
109 lines
3.1 KiB
Makefile
Executable File
109 lines
3.1 KiB
Makefile
Executable File
#!/usr/bin/make -f
|
|
# export DH_VERBOSE=1
|
|
|
|
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
|
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
|
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
|
|
|
|
CFLAGS = -Wall -g
|
|
LDFLAGS = -Wl,--as-needed
|
|
|
|
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
|
CFLAGS += -O0
|
|
else
|
|
CFLAGS += -O2
|
|
endif
|
|
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
|
INSTALL_PROGRAM += -s
|
|
endif
|
|
|
|
config.status:
|
|
dh_testdir
|
|
dh_autoreconf
|
|
# Add here commands to configure the package.
|
|
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure \
|
|
--prefix=/usr \
|
|
--bindir=\$${prefix}/bin \
|
|
--build=${DEB_BUILD_GNU_TYPE} \
|
|
--host=${DEB_HOST_GNU_TYPE} \
|
|
--datadir=\$${prefix}/share \
|
|
--mandir=\$${datadir}/man \
|
|
--infodir=\$${datadir}/info \
|
|
--sysconfdir=/etc/motion \
|
|
--with-ffmpeg \
|
|
--with-mysql \
|
|
--with-mysql-lib=/usr/lib/$(DEB_HOST_MULTIARCH) \
|
|
--with-pgsql \
|
|
--without-optimizecpu \
|
|
--without-jpeg-mmx
|
|
touch configure-stamp
|
|
|
|
build: build-arch build-indep
|
|
build-arch: build-stamp
|
|
build-indep: build-stamp
|
|
|
|
build-stamp: config.status
|
|
dh_testdir
|
|
$(MAKE)
|
|
touch build-stamp
|
|
|
|
clean:
|
|
dh_testdir
|
|
dh_testroot
|
|
rm -f build-stamp configure-stamp
|
|
-[ ! -f Makefile ] || $(MAKE) distclean
|
|
dh_autoreconf_clean
|
|
dh_clean
|
|
|
|
install: build-stamp
|
|
dh_testdir
|
|
dh_testroot
|
|
dh_clean -k
|
|
dh_installdirs
|
|
# Add here commands to install the package into debian/motion.
|
|
$(MAKE) install DESTDIR=$(CURDIR)/debian/motion
|
|
# Offer a minimal default config file.
|
|
cp thread*.conf debian/motion/etc/motion
|
|
cp debian/NEWS debian/motion/usr/share/doc/motion
|
|
# Remove unwanted/misplaced files.
|
|
rm -rf $(CURDIR)/debian/motion/usr/share/doc/motion*
|
|
rm -f $(CURDIR)/debian/motion/etc/motion/motion-dist.conf
|
|
# Fix mode Daemon
|
|
cat $(CURDIR)/motion-dist.conf | sed 's/^daemon on/daemon off/g' > motion.conf
|
|
mv motion.conf $(CURDIR)/debian/motion/etc/motion/motion.conf
|
|
# Fix path directory for pictures and films
|
|
cat $(CURDIR)/debian/motion/etc/motion/motion.conf | sed 's/target_dir \/usr\/local\/apache2\/htdocs\/cam1/target_dir \/tmp\/motion/g' > motion.conf
|
|
mv motion.conf $(CURDIR)/debian/motion/etc/motion/motion.conf
|
|
# Fix default format encoding
|
|
cat $(CURDIR)/debian/motion/etc/motion/motion.conf | sed 's/^ffmpeg_video_codec mpeg4/ffmpeg_video_codec swf/g' > motion.conf
|
|
mv motion.conf $(CURDIR)/debian/motion/etc/motion/motion.conf
|
|
# Remove dir/files unnecessary
|
|
rm -rf $(CURDIR)/debian/motion/usr/share/motion-3.2.12
|
|
|
|
# Build architecture-independent files here.
|
|
binary-indep: build-stamp install
|
|
# We have nothing to do by default.
|
|
|
|
# Build architecture-dependent files here.
|
|
binary-arch: build-stamp install
|
|
dh_testdir
|
|
dh_testroot
|
|
dh_installchangelogs CHANGELOG
|
|
dh_installdocs
|
|
dh_installinit --init-script=motion \
|
|
--update-rcd-params='start 60 2 3 4 5 . stop 60 0 1 6 .'
|
|
dh_installman debian/motion.1
|
|
dh_installdebconf
|
|
dh_link
|
|
dh_strip
|
|
dh_compress
|
|
dh_fixperms
|
|
dh_installdeb
|
|
dh_shlibdeps
|
|
dh_gencontrol
|
|
dh_md5sums
|
|
dh_builddeb
|
|
|
|
binary: binary-indep binary-arch
|
|
.PHONY: build-stamp clean binary-indep binary-arch binary install
|