/[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 18533 - (hide annotations) (download)
Thu Sep 15 10:39:41 2011 UTC (20 months, 1 week ago) by hertzog
File size: 2525 byte(s)
* New patch 02_disable-sources-in-sphinxdoc.diff to not generate
  the _sources directory that we used to remove manually within the rules
  file. But must be kept disabled until #641710 is fixed.
* Properly support DEB_BUILD_OPTIONS=nocheck despite the override
  of dh_auto_test.
1 brettp-guest 1388 #!/usr/bin/make -f
2    
3 evgeni 14768 -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 brettp-guest 1388
11 evgeni 14768
12 lamby 7816 PREFIX = debian/python-django
13 brettp-guest 1388
14 lamby 7816 %:
15 hertzog 18531 dh $@ --with sphinxdoc,python2
16 lamby 7816
17 lamby 9320 override_dh_auto_clean:
18 hertzog 14443 rm -rf docs.debian tests/__init__.py
19 lamby 12992 find -name "*.DS_Store" -delete
20 hertzog 18530 chmod a-x django/contrib/gis/tests/data/texas.dbf
21 lamby 9320 dh_auto_clean
22 lamby 7816
23     override_dh_auto_build:
24     dh_auto_build
25 lamby 7968
26     # Build the HTML documentation.
27     # We programmatically replace most instances of django-admin.py with
28     # django-admin and remove the source files from the target _build.
29     cp -r docs docs.debian
30     find docs.debian -type f -print0 | xargs -0r perl -pi -e 's|(?<!/)(django-admin)\.py|$$1|'
31     make -C docs.debian html
32 netzwurm 6401
33 hertzog 14443 override_dh_auto_test:
34 hertzog 18533 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
35 hertzog 14443 touch tests/__init__.py
36 hertzog 18528 mkdir -p tmp-locales
37     localedef -i /usr/share/i18n/locales/en_US -c -f UTF-8 -A /usr/share/locale/locale.alias tmp-locales/en_US.UTF-8
38     LOCPATH=$(CURDIR)/tmp-locales LC_ALL=en_US.UTF-8 PYTHONPATH=. tests/runtests.py --settings=tests.test_sqlite --verbosity=2
39     rm -rf tmp-locales
40 hertzog 18533 endif
41 lamby 9321
42 lamby 16217 override_dh_clean:
43     # backup~ is used in tests
44     dh_clean -Xbackup~
45    
46 lamby 7816 override_dh_install:
47     dh_install
48    
49 piotr 16864 # Use default shebang and m move scripts to /usr/lib/python-django
50 piotr 16865 set -e; for ver in $(shell pyversions -vr); do \
51 piotr 16866 [ -f /usr/bix/python$$ver ] || continue;\
52 piotr 16864 FILE=$(PREFIX)/$(call py_libdir_sh,$$ver)/django/conf/project_template/manage.py; \
53     if [ -f $$FILE ]; then\
54     perl -pi -e 's|^#!/usr/bin/env python.*|#!/usr/bin/python|' $$FILE;\
55     chmod +x $$FILE;\
56     fi;\
57     if [ -d $(PREFIX)/usr/lib/python-django ]; then\
58     rm -rf $(PREFIX)/$(call py_libdir_sh,$$ver)/django/bin;\
59     else\
60     mkdir -p $(PREFIX)/usr/lib/python-django;\
61     mv $(PREFIX)/$(call py_libdir_sh,$$ver)/django/bin $(PREFIX)/usr/lib/python-django;\
62     fi;\
63     done
64 lamby 7816 # Fix permissions
65     chmod 644 $(PREFIX)/etc/bash_completion.d/django_bash_completion
66     find $(PREFIX)/usr/lib/python-django/bin/ -name '*.py' -not -name '__init__.py' -print0 | xargs -0r chmod 755
67    
68 brettp-guest 1686 # Rename django-admin.py to django-admin
69 lamby 7816 mv $(PREFIX)/usr/bin/django-admin.py $(PREFIX)/usr/bin/django-admin
70 lamby 12992
71     # Remove embedded Javascript libraries
72 piotr 16865 set -e; for FILENAME in jquery.js jquery.min.js; do \
73 lamby 12992 find $(PREFIX) -name $$FILENAME -exec \
74     ln -sf /usr/share/javascript/jquery/$$FILENAME {} \;; \
75     done
76 lamby 7843
77 lamby 7816 override_dh_compress:
78 hertzog 15240 dh_compress -X.js -Xobjects.inv

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5