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
|
#!/usr/bin/make -f
TWIG_RELEASE_VERSION := $(shell dpkg-parsechangelog | grep -E -e '^Version:' | sed -r 's/^[^:]+: (.*)-[^-]+$$/\1/')
TWIG_VERSION := $(shell echo $(TWIG_RELEASE_VERSION) | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
%:
dh $@ --with phpcomposer
override_dh_auto_clean:
cd ext/twig && \
if which phpize 1>/dev/null; then \
phpize --clean; \
fi
rm -f ext/twig/tmp-php.ini
rm -rf debian/build-tmp/php-twig-doc
rmdir debian/build-tmp || true
override_dh_auto_configure:
cd ext/twig && \
phpize && \
./configure
override_dh_auto_build:
cd ext/twig && \
make
sphinx-build -C \
-b html \
-D source_suffix='.rst' \
-D master_doc='index' \
-D project='php-twig-doc' \
-D copyright='by the Twig Team' \
-D version='${TWIG_VERSION}' \
-D release='${TWIG_RELEASE_VERSION}' \
-D pygments_style='sphinx' \
-D html_theme='default' \
doc debian/build-tmp/php-twig-doc
set -e; \
for embedded_js_lib in \
doctools \
jquery \
searchtools \
sidebar \
underscore; \
do \
rm -f debian/build-tmp/php-twig-doc/_static/$$embedded_js_lib.js; \
ln -s /usr/share/javascript/sphinxdoc/1.0/$$embedded_js_lib.js \
debian/build-tmp/php-twig-doc/_static/$$embedded_js_lib.js; \
done
rm -f debian/build-tmp/php-twig-doc/genindex.html
ln -s /usr/share/doc/php-twig-doc/manual/index.html debian/build-tmp/php-twig-doc/genindex.html
override_dh_auto_test:
cd ext/twig && \
make test
phpunit
override_dh_install-indep:
dh_install --fail-missing --package=php-twig lib/Twig usr/share/php/
rm -f debian/php-twig/usr/share/php/Twig/Test/*.php
rmdir debian/php-twig/usr/share/php/Twig/Test
dh_install --fail-missing --package=php-twig-doc debian/build-tmp/php-twig-doc/* usr/share/doc/php-twig-doc/manual/
override_dh_install-arch:
cd ext/twig && \
make install INSTALL_ROOT=../../debian/php5-twig
echo "php:Depends=phpapi-`php-config5 --phpapi`" >> debian/php5-twig.substvars
dh_install --fail-missing
|