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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
|
#!/usr/bin/make -f
HERE := $(shell pwd)
WORK := $(HERE)/work
DEST := $(HERE)/debian/tmp
TARS := $(wildcard $(HERE)/dist/*.tar.gz)
DIFF := $(wildcard $(HERE)/dist/*.diff)
# some build tweaks:
# - only i386 can do mmx. mmx works for the static library only,
# building a shared library with mmx makes lintian complain about
# it (shlib-with-non-pic-code). Probably the asm mmx code...
# - need to override the default cflags for non-i386 archs: -m486
# hardly works on anything but intel ...
SHARED := --no-mmx
STATIC :=
CFLAGS :=
ifneq ($(DEB_BUILD_ARCH),i386)
STATIC += --no-mmx
CFLAGS := -O2
endif
export CFLAGS
# shared library versioning
MAJOR := 0
MINOR := 0.1.3
# the tools distributed with quicktime4linux
TOOLS := dump qtinfo make_streamable dechunk yuv4toyuv recover
# debhelper
#export DH_VERBOSE=1
export DH_COMPAT=3
build: work build-shlib build-lib build-util
work:
@mkdir -p work.tmp
@mkdir -p work.tmp/libs
@mkdir -p work.tmp/util
@(cd work.tmp; set -e; \
echo "###"; \
for tar in $(TARS); do \
echo "### unpacking $$tar"; \
tar xzf $$tar; \
done; \
echo "###")
@(cd work.tmp/quicktime*; patch -p1 < $(DIFF))
@mv work.tmp work
# build shared library
build-shlib:
dh_testdir
cd $(WORK)/quicktime*; \
set -ex; \
make clean; \
./configure $(SHARED); \
echo "CFLAGS += -fPIC" >>global_config; \
make CC="set -x; gcc" libquicktime.a; \
rm -f libquicktime.so; \
sh $(HERE)/debian/shlib-hack `pwd`/libquicktime.a $(MAJOR) $(MINOR);\
mv libquicktime.so* $(HERE)/work/libs
touch $@
# build static library
build-lib:
dh_testdir
cd $(WORK)/quicktime*; \
set -ex; \
make clean; \
./configure $(STATIC); \
make CC="set -x; gcc" libquicktime.a; \
mv libquicktime.a $(HERE)/work/libs
touch $@
# build tools
build-util: build-shlib
cd $(WORK)/quicktime*; \
set -ex; \
make clean; \
rm -f $(TOOLS); \
make -f /dev/null LDLIBS="-L$(WORK)/libs -lquicktime -lpng -lz -lpthread -lglib -ldl" $(TOOLS); \
mv $(TOOLS) $(HERE)/work/util
touch $@
clean:
dh_testdir
dh_testroot
rm -rf work work.tmp
rm -f build-*
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# install dirs
rm -rf $(DEST)
mkdir -p $(DEST)/usr/lib
mkdir -p $(DEST)/usr/bin
# includes
cd $(WORK)/quicktime4linux*; \
find . -name \*.h | cpio -p --make-dir \
$(DEST)/usr/include/quicktime
rm -f $(DEST)/usr/include/quicktime/dv.h
rm -rf $(DEST)/usr/include/quicktime/libdv
rm -rf $(DEST)/usr/include/quicktime/libraw*
# libs + tools
cp -a $(WORK)/libs/* $(DEST)/usr/lib
cp -a $(WORK)/util/* $(DEST)/usr/bin
mv $(DEST)/usr/bin/dump $(DEST)/usr/bin/qtdump
mv $(DEST)/usr/bin/recover $(DEST)/usr/bin/qtrecover
dh_movefiles
binary-indep: build install
binary-arch: build install
dh_testdir
dh_testroot
# dh_installdebconf
dh_installdocs -p libquicktime4linux0 work/quicktime*/README
dh_installdocs -p libquicktime4linux-dev work/quicktime*/docs/*.html
dh_installdocs -p quicktime4linux-utils
# dh_installexamples
# dh_installmenu
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
# dh_installcron
# dh_installmanpages
# dh_installinfo
dh_undocumented -p quicktime4linux-utils dechunk.1 qtdump.1 \
make_streamable.1 qtinfo.1 qtrecover.1 yuv4toyuv.1
dh_installchangelogs
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_suidregister
dh_makeshlibs -V
dh_installdeb
# dh_perl
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
|