| 1 |
#!/usr/bin/make -f |
| 2 |
export DH_VERBOSE=1 |
| 3 |
export PYTHON_EGG_CACHE=$(CURDIR)/debian/tmp |
| 4 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 5 |
|
| 6 |
export SYSTEM_SASS = 1 |
| 7 |
|
| 8 |
%: .libsass-upstream-version |
| 9 |
dh $@ --buildsystem=pybuild |
| 10 |
|
| 11 |
.libsass-upstream-version: |
| 12 |
dpkg-query -f '$${Version}\n' -W libsass-dev|sed 's/-.*//' > .libsass-upstream-version |
| 13 |
|
| 14 |
override_dh_auto_build: |
| 15 |
pybuild --build -p "$(shell py3versions -vr)" |
| 16 |
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) |
| 17 |
# build doc once |
| 18 |
pybuild -s custom --build -p $(shell py3versions -vd) \ |
| 19 |
--build-args="env PYTHONPATH={build_dir} python3 -m sphinx -N -bman docs/ build/man" |
| 20 |
endif |
| 21 |
|
| 22 |
execute_after_dh_auto_install: |
| 23 |
mkdir -p $(CURDIR)/debian/tmp/usr/share/man/man1 |
| 24 |
mkdir -p $(CURDIR)/debian/tmp/usr/share/man/man3 |
| 25 |
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) |
| 26 |
cp $(CURDIR)/build/man/pysassc.1 $(CURDIR)/debian/tmp/usr/share/man/man1/ |
| 27 |
cp $(CURDIR)/build/man/libsass.3 $(CURDIR)/debian/tmp/usr/share/man/man3/ |
| 28 |
else |
| 29 |
touch $(CURDIR)/debian/tmp/usr/share/man/man1/pysassc.1 |
| 30 |
touch $(CURDIR)/debian/tmp/usr/share/man/man3/libsass.3 |
| 31 |
endif |
| 32 |
rm $(CURDIR)/debian/tmp/usr/lib/python*/dist-packages/sasstests.py |
| 33 |
sed -i '1c#!/usr/bin/python3' $(CURDIR)/debian/tmp/usr/bin/pysassc |
| 34 |
|
| 35 |
override_dh_auto_test: |
| 36 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 37 |
# Skip DistutilsTestCase.* to not rebuild sass again |
| 38 |
pybuild -s custom --test -p "$(shell py3versions -vr)" \ |
| 39 |
--test-args="cd {build_dir}; \ |
| 40 |
{interpreter} -m pytest -k 'not DistutilsTestCase' sasstests.py" |
| 41 |
endif |