3 build
clean install binary-arch binary-indep binary
:
4 +dh
$@
--parallel
$(opt_no_act
)
6 # Runs tests, too, if and only if nocheck is unset (see below).
7 build-arch
:: build-plain build-static build-small
9 build-indep
: debian
/normal-build
/Makefile
10 cd debian
/normal-build
&& doxygen Doxyfile
12 autoreconf_sources
:= $(wildcard Makefile.am
*/Makefile.am
*/*/Makefile.am
)
13 autoreconf_sources
+= configure.ac
15 autoreconf_products
:= $(wildcard Makefile.in
*/Makefile.in
*/*/Makefile.in
)
16 autoreconf_products
+= configure
# and more, but these will do
18 configure_input
:= $(autoreconf_products
)
19 configure_input
+= Doxyfile.in
20 configure_input
+= src
/liblzma
/liblzma.
pc.in
21 configure_input
+= $(wildcard src
/scripts
/*.in
)
23 override_dh_auto_clean
:
25 dh_auto_clean
--builddirectory debian
/xzdec-build
26 dh_auto_clean
--builddirectory debian
/normal-build
27 dh_auto_clean
--builddirectory debian
/static-build
30 override_dh_auto_install
:
31 dh_auto_install
--builddirectory debian
/xzdec-build
32 dh_auto_install
--builddirectory debian
/normal-build
33 dh_auto_install
--builddirectory debian
/static-build
34 set
-e
; arch
=$$(dpkg-architecture
-qDEB_HOST_MULTIARCH
); \
35 install -d debian
/tmp
/lib
/$$arch; \
36 mv debian
/tmp
/usr
/lib
/$$arch/liblzma.so.
* debian
/tmp
/lib
/$$arch/; \
37 dso
=$$(basename $$(readlink debian
/tmp
/usr
/lib
/$$arch/liblzma.so
)); \
38 ln
-s
-f
/lib
/$$arch/$$dso debian
/tmp
/usr
/lib
/$$arch/liblzma.so
40 override_dh_installchangelogs
:
41 dh_installchangelogs ChangeLog
43 build-plain
: debian
/normal-build
/Makefile
44 dh_auto_build
--builddirectory debian
/normal-build
46 build-static
: debian
/static-build
/Makefile
47 dh_auto_build
--builddirectory debian
/static-build
49 build-small
: debian
/xzdec-build
/Makefile
50 dh_auto_build
--builddirectory debian
/xzdec-build
52 debian
/test-plain-stamp
: | build-plain
53 dh_auto_test
--builddirectory debian
/normal-build
56 debian
/test-static-stamp
: | build-static
57 dh_auto_test
--builddirectory debian
/static-build
60 debian
/test-xzdec-stamp
: | build-small
61 $(MAKE
) -C debian
/xzdec-build
/tests create_compress_files
62 $(MAKE
) -C debian
/xzdec-build
/tests \
63 TESTS
="test_check test_files.sh test_compress.sh" \
67 debian
/normal-build
/Makefile debian
/normal-build
/Doxyfile
: $(configure_input
)
68 dh_auto_configure
--builddirectory debian
/normal-build
-- \
70 --enable-threads
--disable-static \
71 $(opt_optimize
) $(opt_quiet
) \
72 --disable-xzdec
--disable-lzmadec
74 debian
/static-build
/Makefile
: $(configure_input
)
75 dh_auto_configure
--builddirectory debian
/static-build
-- \
77 --disable-threads
--disable-shared \
78 --enable-liblzma2-compat \
79 $(opt_optimize
) $(opt_quiet
) \
80 --disable-lzmainfo
--disable-scripts \
81 --disable-xzdec
--disable-lzmadec \
82 --disable-xz
--disable-lzma-links
84 debian
/xzdec-build
/Makefile
: $(configure_input
)
85 dh_auto_configure
--builddirectory debian
/xzdec-build
-- \
87 --disable-shared
--disable-nls
--disable-encoders \
88 --enable-small
--disable-threads \
89 --disable-liblzma2-compat \
90 $(opt_optimize_small
) $(opt_quiet
) \
91 --disable-lzmainfo
--disable-scripts \
92 --disable-xz
--disable-lzma-links
94 $(autoreconf_products
): $(autoreconf_sources
)
98 small_flags_env
+= DEB_CFLAGS_MAINT_STRIP
='-O2 -O3'
99 small_flags_env
+= DEB_CFLAGS_MAINT_PREPEND
=-Os
100 flags_cmd
= dpkg-buildflags
--export=configure
101 opt_optimize
= $(shell $(flags_cmd
))
102 opt_optimize_small
= $(shell $(small_flags_env
) $(flags_cmd
))
103 opt_reproduce
= gl_cv_posix_shell
=/bin
/sh
108 # Unless noopt is set, use optimized CRC32 routine on the Hurd.
109 ifeq (hurd
,$(shell dpkg-architecture
-qDEB_HOST_ARCH_OS
))
110 cputype
:= $(shell dpkg-architecture
-qDEB_HOST_ARCH_CPU
)
111 ifeq (i386
,$(cputype
))
112 opt_optimize
+= --enable-assembler
=x86
113 opt_optimize_small
+= --enable-assembler
=x86
115 ifeq (amd64
,$(cputype
))
116 opt_optimize
+= --enable-assembler
=x86_64
117 opt_optimize_small
+= --enable-assembler
=x86_64
121 ifneq (,$(filter noopt
,$(DEB_BUILD_OPTIONS
)))
122 opt_optimize
+= --disable-assembler
123 opt_optimize_small
+= --disable-assembler
126 ifneq (,$(findstring n
,$(MAKEFLAGS
)))
127 opt_no_act
= --no-act
130 ifneq (,$(filter quiet
,$(DEB_BUILD_OPTIONS
)))
135 ifeq (,$(filter nocheck
,$(DEB_BUILD_OPTIONS
)))
136 build-arch
:: debian
/test-plain-stamp
137 build-arch
:: debian
/test-static-stamp
138 build-arch
:: debian
/test-xzdec-stamp
141 # Build a tarball with the latest upstream version.
142 # This is made complicated by the need to choose a nice version number.
143 REPO
= https
://git.tukaani.org
/xz.git
146 mkdir debian-orig-source
147 -set
-e
; cd debian-orig-source
; \
148 : Fetch latest upstream version.
; \
150 git fetch
-q
--tags $(REPO
); \
151 git fetch
-q
$(REPO
) $(BRANCH
); \
152 : Determine version number.
; \
153 commit_name
=$$(git describe FETCH_HEAD
); \
154 release
=$${commit_name
%%-*}; \
155 date
=$$(date
--utc
--date
="$$( \
156 git log -1 --pretty=format:%cD "$$commit_name" \
158 if
test "$$commit_name" = "$$release"; \
159 then upstream_version
=$${commit_name
#v}; \
160 else upstream_version
="$${release#v}+$${date}"; \
162 : Generate tarball.
; \
163 echo
"packaging $$commit_name"; \
164 git archive
--format
=tar "$$commit_name" \
165 --prefix="xz-utils-$$upstream_version/" | \
166 gzip
-n
--rsyncable
-9 \
167 > "../xz-utils_$$upstream_version.orig.tar.gz"
168 rm -fr debian-orig-source