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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
#!/usr/bin/make -f
libx264N := libx264-$(shell awk '/\#define X264_BUILD/{print $$3}' x264.h)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
include debian/confflags
DH_INSTALL_FILES = debian/$(libx264N).install \
debian/libx264-dev.install
%:
dh $@ --parallel --with autotools_dev
.PHONY: debian/control
debian/control:
sed -e 's/@libx264N@/$(libx264N)/g' $@.in > $@
$(DH_INSTALL_FILES):
sed -e 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $(subst $(libx264N),libx264N,$@).in > $@
override_dh_auto_build:
# Build static lib
LDFLAGS="$(LDFLAGS)" ./configure $(static_confflags) \
|| ( tail -v -n +0 config.log config.log ; exit 1 )
$(MAKE)
$(MAKE) install DESTDIR=$(CURDIR)/debian/install/static
$(MAKE) distclean
# Build shared lib
CFLAGS="$(shared_extra_cflags)" LDFLAGS="$(LDFLAGS)" ./configure $(shared_confflags) \
|| ( tail -v -n +0 config.log config.log ; exit 1 )
$(MAKE)
$(MAKE) install DESTDIR=$(CURDIR)/debian/install/shared
ifeq ($(do_opt),yes)
$(MAKE) distclean
# Build opt lib
LDFLAGS="$(LDFLAGS)" ./configure $(opt_confflags) \
|| ( tail -v -n +0 config.log config.log ; exit 1 )
$(MAKE)
$(MAKE) install DESTDIR=$(CURDIR)/debian/install/opt
endif
# now do the 10 bit builds
$(MAKE) distclean
CFLAGS="$(shared_extra_cflags)" LDFLAGS="$(LDFLAGS)" ./configure $(shared_confflags) --bit-depth=10 \
|| ( tail -v -n +0 config.log config.log ; exit 1 )
$(MAKE)
install -d -m755 $(CURDIR)/debian/install/shared/usr/lib/$(DEB_HOST_MULTIARCH)/x264-10bit
install -m755 libx264.so.* $(CURDIR)/debian/install/shared/usr/lib/$(DEB_HOST_MULTIARCH)/x264-10bit
sed -e 's,@DEB_HOST_MULTIARCH@,$(DEB_HOST_MULTIARCH),' \
debian/x264-10bit.in > $(CURDIR)/debian/install/shared/usr/bin/x264-10bit
chmod 755 $(CURDIR)/debian/install/shared/usr/bin/x264-10bit
ifeq ($(do_opt),yes)
$(MAKE) distclean
# Build opt lib
LDFLAGS="$(LDFLAGS)" ./configure $(opt_confflags) --bit-depth=10 \
|| ( tail -v -n +0 config.log config.log ; exit 1 )
$(MAKE)
install -d -m755 $(CURDIR)/debian/install/opt/usr/lib/$(DEB_HOST_MULTIARCH)/x264-10bit
install -m755 libx264.so.* $(CURDIR)/debian/install/opt/usr/lib/$(DEB_HOST_MULTIARCH)/x264-10bit
endif
override_dh_auto_configure:
# dh_auto_configure phase handled via dh_auto_build.
override_dh_auto_install:
# dh_auto_install phase handled via dh_auto_build.
override_dh_auto_clean: debian/control
rm -rf debian/install
$(MAKE) -o config.mak distclean
dh_clean config.mak2 $(DH_INSTALL_FILES)
override_dh_install: $(DH_INSTALL_FILES)
dh_install --list-missing --sourcedir=debian/install
ifeq ($(do_opt),yes)
mkdir -p debian/$(libx264N)$(opt_libdir)
cp -a debian/install/opt$(opt_libdir)/*.so.* debian/$(libx264N)$(opt_libdir)
endif
debian/x264.1: build
env LD_LIBRARY_PATH="$(LD_LIBRARY_PATH):$(CURDIR)/debian/install/shared/usr/lib/$(DEB_HOST_MULTIARCH)" \
help2man -n "fast h264 encoder" -N -s1 -S "Videolan project" -h '--fullhelp' \
debian/install/shared/usr/bin/x264 > debian/x264.1
|