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