PKGBUILD 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Maintainer: Luke Shumaker <lukeshu@lukeshu.com>
  2. # Maintainer (arch:django): Dan McGee <dan@archlinux.org>
  3. # Contributor: Shahar Weiss <sweiss4@gmx.net>
  4. # Rational for inclusion in [libre]:
  5. # - Used by libre/parabolaweb-utils
  6. pkgbase=django
  7. pkgname=('python-django' 'python2-django')
  8. pkgbase=${pkgbase}1.8
  9. pkgname=("${pkgname[@]/%/1.8}")
  10. pkgver=1.8.18
  11. pkgrel=2
  12. pkgdesc="A high-level Python Web framework that encourages rapid development and clean design"
  13. arch=('any')
  14. license=('BSD')
  15. url="http://www.djangoproject.com/"
  16. makedepends=('python2' 'python2-setuptools' 'python' 'python-setuptools')
  17. source=("https://www.djangoproject.com/m/releases/${pkgver:0:3}/Django-$pkgver.tar.gz")
  18. md5sums=('ffc3767f5a06c346fd2d07a18c0ebc54')
  19. sha256sums=('c7611cdd5e2539a443b7960c7cafd867d986c2720a1b44808deaa60ce3da50c7')
  20. prepare() {
  21. cp -a "$srcdir/Django-$pkgver" "$srcdir/Django-$pkgver-python2"
  22. find "$srcdir/Django-$pkgver-python2" -name '*.py' | \
  23. xargs sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|"
  24. }
  25. build() {
  26. cd "$srcdir/Django-$pkgver"
  27. python setup.py build
  28. cd "$srcdir/Django-$pkgver-python2"
  29. python2 setup.py build
  30. }
  31. package_python-django1.8() {
  32. depends=('python' 'python-setuptools')
  33. optdepends=('python-psycopg2: for PostgreSQL backend')
  34. provides=("python-django=$pkgver")
  35. conflicts=('python-django')
  36. replaces+=('python-django17')
  37. cd "$srcdir/Django-$pkgver"
  38. python setup.py install --root="$pkgdir" --optimize=1
  39. ln -s django-admin.py "$pkgdir"/usr/bin/django-admin3.py
  40. ln -s django-admin "$pkgdir"/usr/bin/django-admin3
  41. install -Dm644 extras/django_bash_completion \
  42. "$pkgdir"/usr/share/bash-completion/completions/django-admin.py
  43. ln -s django-admin.py \
  44. "$pkgdir"/usr/share/bash-completion/completions/django-admin
  45. ln -s django-admin.py \
  46. "$pkgdir"/usr/share/bash-completion/completions/manage.py
  47. install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
  48. }
  49. package_python2-django1.8() {
  50. depends=('python2' 'python2-setuptools')
  51. optdepends=('mysql-python: for MySQL backend'
  52. 'python2-psycopg2: for PostgreSQL backend')
  53. replaces=('django')
  54. conflicts=('django')
  55. provides=("python2-django=$pkgver")
  56. conflicts+=('python2-django')
  57. replaces+=('python2-django17')
  58. cd "$srcdir/Django-$pkgver-python2"
  59. python2 setup.py install --root="$pkgdir" --optimize=1
  60. mv "$pkgdir"/usr/bin/django-admin.py "$pkgdir"/usr/bin/django-admin2.py
  61. mv "$pkgdir"/usr/bin/django-admin "$pkgdir"/usr/bin/django-admin2
  62. # TODO: this probably won't work due to the `complete` command within not
  63. # knowing about modified our exectuable names
  64. install -Dm644 extras/django_bash_completion \
  65. "$pkgdir"/usr/share/bash-completion/completions/django-admin2.py
  66. ln -s django-admin2.py \
  67. "$pkgdir"/usr/share/bash-completion/completions/django-admin2
  68. install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
  69. }