| 1 |
#!/usr/bin/make -f
|
| 2 |
|
| 3 |
include /usr/share/quilt/quilt.make
|
| 4 |
include /usr/share/python/python.mk
|
| 5 |
|
| 6 |
PREFIX = debian/python-django
|
| 7 |
DJANGO_DIR = $(PREFIX)/$(call py_libdir_sh,`pyversions -d`)/django
|
| 8 |
|
| 9 |
%:
|
| 10 |
dh $@
|
| 11 |
|
| 12 |
build: $(QUILT_STAMPFN)
|
| 13 |
dh $@
|
| 14 |
|
| 15 |
clean: unpatch
|
| 16 |
rm -rf docs.debian
|
| 17 |
dh $@
|
| 18 |
|
| 19 |
override_dh_auto_build:
|
| 20 |
dh_auto_build
|
| 21 |
|
| 22 |
# Build the HTML documentation.
|
| 23 |
# We programmatically replace most instances of django-admin.py with
|
| 24 |
# django-admin and remove the source files from the target _build.
|
| 25 |
cp -r docs docs.debian
|
| 26 |
find docs.debian -type f -print0 | xargs -0r perl -pi -e 's|(?<!/)(django-admin)\.py|$$1|'
|
| 27 |
make -C docs.debian html
|
| 28 |
rm -rf docs.debian/_build/html/_sources/
|
| 29 |
|
| 30 |
override_dh_install:
|
| 31 |
dh_install
|
| 32 |
|
| 33 |
# Use default shebang
|
| 34 |
perl -pi -e 's|^#!/usr/bin/env python.*|#!/usr/bin/python|' $(DJANGO_DIR)/conf/project_template/manage.py
|
| 35 |
chmod +x $(DJANGO_DIR)/conf/project_template/manage.py
|
| 36 |
|
| 37 |
# Move scripts to /usr/lib/python-django
|
| 38 |
mkdir -p $(PREFIX)/usr/lib/python-django
|
| 39 |
mv $(DJANGO_DIR)/bin $(PREFIX)/usr/lib/python-django
|
| 40 |
|
| 41 |
# Fix permissions
|
| 42 |
chmod 644 $(PREFIX)/etc/bash_completion.d/django_bash_completion
|
| 43 |
find $(PREFIX)/usr/lib/python-django/bin/ -name '*.py' -not -name '__init__.py' -print0 | xargs -0r chmod 755
|
| 44 |
|
| 45 |
# Rename django-admin.py to django-admin
|
| 46 |
mv $(PREFIX)/usr/bin/django-admin.py $(PREFIX)/usr/bin/django-admin
|
| 47 |
|
| 48 |
override_dh_installdocs:
|
| 49 |
dh_installdocs
|
| 50 |
# Remove embedded copy of libjs-jquery
|
| 51 |
cd debian/python-django-doc/usr/share/doc/python-django-doc/html/_static \
|
| 52 |
&& rm jquery.js \
|
| 53 |
&& ln -s ../../../../javascript/jquery/jquery.js .
|
| 54 |
|
| 55 |
override_dh_compress:
|
| 56 |
dh_compress -X.js
|