Signed-off-by: Uwe Kleine-König <[email protected]>
---
 rules/django.in   | 29 +++++++++++++++++
 rules/django.make | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 122 insertions(+)
 create mode 100644 rules/django.in
 create mode 100644 rules/django.make

diff --git a/rules/django.in b/rules/django.in
new file mode 100644
index 000000000000..8b66702d4c67
--- /dev/null
+++ b/rules/django.in
@@ -0,0 +1,29 @@
+## SECTION=networking
+
+menuconfig DJANGO
+       tristate
+       select PYTHON
+       select PYTHON_SQLITE
+       select PYTHON_ZLIB
+       prompt "Django                        "
+       help
+         Django is a high-level Python Web framework that encourages rapid
+         development and clean, pragmatic design.
+
+if DJANGO
+
+menu "locales"
+
+       config DJANGO_LOCALE_DE
+               bool
+               prompt "de"
+
+       config DJANGO_LOCALE_EN
+               bool
+               prompt "en"
+
+       # add more if needed
+
+endmenu
+
+endif
diff --git a/rules/django.make b/rules/django.make
new file mode 100644
index 000000000000..256f7b8dab0a
--- /dev/null
+++ b/rules/django.make
@@ -0,0 +1,93 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2014 by Uwe Kleine-Koenig <[email protected]>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_DJANGO) += django
+
+#
+# Paths and names
+#
+DJANGO_VERSION := 1.6.5
+DJANGO_MD5     := e4c5b2d35ecb3807317713afa70a0c77
+DJANGO         := Django-$(DJANGO_VERSION)
+DJANGO_SUFFIX  := tar.gz
+DJANGO_URL     := 
https://www.djangoproject.com/download/$(DJANGO_VERSION)/tarball/
+DJANGO_SOURCE  := $(SRCDIR)/$(DJANGO).$(DJANGO_SUFFIX)
+DJANGO_DIR     := $(BUILDDIR)/$(DJANGO)
+DJANGO_LICENSE := BSD
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+DJANGO_PATH            := PATH=$(CROSS_PATH)
+DJANGO_CONF_TOOL       := NO
+DJANGO_MAKE_ENV                := $(CROSS_ENV)
+
+DJANGO_LOCALES-y :=
+DJANGO_LOCALES-$(PTXCONF_DJANGO_LOCALE_DE) += de
+DJANGO_LOCALES-$(PTXCONF_DJANGO_LOCALE_EN) += en
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/django.compile:
+       @$(call targetinfo)
+       cd $(DJANGO_DIR) && \
+               $(DJANGO_PATH) $(DJANGO_MAKE_ENV) \
+               $(CROSS_PYTHON) setup.py build
+       @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/django.install:
+       @$(call targetinfo)
+       cd $(DJANGO_DIR) && \
+               $(DJANGO_PATH) $(DJANGO_MAKE_ENV) \
+               $(CROSS_PYTHON) setup.py install --root=$(DJANGO_PKGDIR) 
--prefix=/usr -O2
+       @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/django.targetinstall:
+       @$(call targetinfo)
+
+       @$(call install_init, django)
+       @$(call install_fixup, django, PRIORITY, optional)
+       @$(call install_fixup, django, SECTION, base)
+       @$(call install_fixup, django, AUTHOR, "Robert Schwebel 
<[email protected]>")
+       @$(call install_fixup, django, DESCRIPTION, missing)
+
+       # everything but locales
+       find "$(DJANGO_PKGDIR)" -type d -name locale -prune -o -type f -printf 
'/%P\n' | while read fn; do \
+               $(call install_copy, django, 0, 0, 0644, -, $$fn); \
+       done
+
+       # locales
+       find "$(DJANGO_PKGDIR)" -type d -name locale -printf '/%P\n' | while 
read localedir; do \
+               for locale in $(DJANGO_LOCALES-y); do \
+                       find "$(DJANGO_PKGDIR)$$localedir/$$locale" -type f 
-printf "$$localedir/$$locale/%P\n" | while read fn; do \
+                               $(call install_copy, django, 0, 0, 0644, -, 
$$fn); \
+                       done; \
+               done; \
+       done
+
+       @$(call install_finish, django)
+
+       @$(call touch)
+
+# vim: syntax=make
-- 
2.0.1


-- 
ptxdist mailing list
[email protected]

Reply via email to