Imported Debian patch 1.4+222+hg5f9f7194267b-1~trusty
[deb_x265.git] / debian / rules
1 #!/usr/bin/make -f
2
3 include debian/confflags
4
5 API = $(shell debian/getapi.sh)
6 LIB = $(CURDIR)/debian/install/usr/lib/$(DEB_HOST_MULTIARCH)
7
8 builddir = compiling
9 x265-clean = rm -rf $(builddir) && mkdir -p $(builddir)
10 x265-install = $(MAKE) -C $(builddir) install DESTDIR=$(CURDIR)/debian/install
11 x265-build = dh_auto_build -D$(builddir)
12 test-build = \
13 $(builddir)/x265 --pass 1 --bitrate 10 -o /dev/null debian/test.y4m && \
14 $(builddir)/x265 --pass 2 --bitrate 10 -o test.hevc debian/test.y4m
15
16
17 %:
18 dh ${@} --parallel
19
20 override_dh_auto_clean:
21 dh_auto_clean
22 dh_auto_clean -Ddoc/reST || true
23 rm -rf $(builddir) debian/install debian/libx265-$(API).* \
24 debian/test.y4m x265_2pass.log* test.hevc
25
26 override_dh_auto_build:
27 sed -e 's/@API@/$(API)/g' debian/control.in > debian/control
28 cp -f debian/libx265N.install debian/libx265-$(API).install
29 unxz -fk debian/test.y4m.xz
30 # build x265 8-bit
31 mkdir -p $(builddir)
32 cd $(builddir) && cmake $(8bit_confflags) ../source
33 $(x265-build)
34 $(x265-install)
35 # test x265 8-bit
36 $(test-build)
37 # build x265 10-bit
38 $(x265-clean)
39 cd $(builddir) && cmake $(10bit_confflags) ../source
40 $(x265-build)
41 $(x265-install)
42 sed -e 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' \
43 debian/x265-10bit.in > $(builddir)/x265-10bit
44 install -c -D -m755 $(builddir)/x265-10bit $(CURDIR)/debian/install/usr/bin
45 # test x265 10-bit
46 $(test-build)
47 # build x265 8-bit static
48 $(x265-clean)
49 rm -f $(LIB)/libx265.a
50 cd $(builddir) && cmake $(8bit_static_confflags) ../source
51 $(x265-build)
52 install -c -D -m644 $(builddir)/libx265.a $(LIB)
53 # build x265 10-bit static
54 $(x265-clean)
55 rm -f $(LIB)/x265-10bit/libx265.a
56 cd $(builddir) && cmake $(10bit_static_confflags) -DENABLE_TESTS=ON ../source
57 $(x265-build)
58 install -c -D -m644 $(builddir)/libx265.a $(LIB)/x265-10bit
59 # build documentation
60 $(MAKE) -C doc/reST pickle html man
61
62 override_dh_auto_test:
63 $(builddir)/test/TestBench
64
65 override_dh_install:
66 dh_install --list-missing --sourcedir=$(CURDIR)/debian/install
67
68 override_dh_installchangelogs:
69 dh_installchangelogs -px265-doc -plibx265-$(API) ChangeLog
70
71 override_dh_installdocs:
72 dh_installdocs -plibx265-$(API) -px265-doc -X.buildinfo
73 dh_installdocs -px265 -px265-dbg -plibx265-dev --link-doc=libx265-$(API)
74
75 override_dh_strip:
76 dh_strip --dbg-package=x265-dbg
77
78 override_dh_builddeb:
79 dh_builddeb -- -Zxz -z9
80