/[python-modules]/packages/python-django/trunk/debian/rules
ViewVC logotype

Contents of /packages/python-django/trunk/debian/rules

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16214 - (show annotations) (download)
Thu Mar 24 15:23:58 2011 UTC (2 years, 1 month ago) by lamby
File size: 2515 byte(s)
Add workaround for missing "backup~" file in release tarball. See <http://code.djangoproject.com/ticket/15677>.
1 #!/usr/bin/make -f
2
3 -include /usr/share/python/python.mk
4 ifeq (,$(py_sitename))
5 py_sitename = site-packages
6 py_libdir = /usr/lib/python$(subst python,,$(1))/site-packages
7 py_sitename_sh = $(py_sitename)
8 py_libdir_sh = $(py_libdir)
9 endif
10
11
12 PREFIX = debian/python-django
13 DJANGO_DIR = $(PREFIX)/$(call py_libdir_sh,`pyversions -d`)/django
14
15 # FIXME: if the build is run while non-default python version are
16 # available, the build process will install files in
17 # /usr/lib/pyshared/pythonX.Y while we don't need them
18
19 %:
20 dh $@
21
22 override_dh_auto_clean:
23 rm -rf docs.debian tests/__init__.py
24 rm -f tests/regressiontests/staticfiles_tests/apps/test/static/test/backup~
25 find -name "*.DS_Store" -delete
26 dh_auto_clean
27
28 override_dh_auto_build:
29 dh_auto_build
30
31 # Build the HTML documentation.
32 # We programmatically replace most instances of django-admin.py with
33 # django-admin and remove the source files from the target _build.
34 cp -r docs docs.debian
35 find docs.debian -type f -print0 | xargs -0r perl -pi -e 's|(?<!/)(django-admin)\.py|$$1|'
36 make -C docs.debian html
37 rm -rf docs.debian/_build/html/_sources/
38
39 override_dh_auto_test:
40 touch tests/__init__.py
41 echo 'should be ignored' > \
42 tests/regressiontests/staticfiles_tests/apps/test/static/test/backup~
43 LC_ALL=en_US.utf8 PYTHONPATH=. tests/runtests.py --settings=tests.test_sqlite --verbosity=2
44
45 override_dh_install:
46 dh_install
47
48 # Use default shebang
49 perl -pi -e 's|^#!/usr/bin/env python.*|#!/usr/bin/python|' $(DJANGO_DIR)/conf/project_template/manage.py
50 chmod +x $(DJANGO_DIR)/conf/project_template/manage.py
51
52 # Move scripts to /usr/lib/python-django
53 mkdir -p $(PREFIX)/usr/lib/python-django
54 mv $(DJANGO_DIR)/bin $(PREFIX)/usr/lib/python-django
55
56 # Fix permissions
57 chmod 644 $(PREFIX)/etc/bash_completion.d/django_bash_completion
58 find $(PREFIX)/usr/lib/python-django/bin/ -name '*.py' -not -name '__init__.py' -print0 | xargs -0r chmod 755
59
60 # Rename django-admin.py to django-admin
61 mv $(PREFIX)/usr/bin/django-admin.py $(PREFIX)/usr/bin/django-admin
62
63 # Remove embedded Javascript libraries
64 for FILENAME in jquery.js jquery.min.js; do \
65 find $(PREFIX) -name $$FILENAME -exec \
66 ln -sf /usr/share/javascript/jquery/$$FILENAME {} \;; \
67 done
68
69 override_dh_installdocs:
70 dh_installdocs
71 # Remove embedded copy of libjs-jquery
72 cd debian/python-django-doc/usr/share/doc/python-django-doc/html/_static \
73 && rm jquery.js \
74 && ln -s ../../../../javascript/jquery/jquery.js .
75
76 override_dh_compress:
77 dh_compress -X.js -Xobjects.inv

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5