mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH v2] django: new package to provide Django 1.6.5
Date: Thu, 31 Jul 2014 21:34:30 +0200	[thread overview]
Message-ID: <1406835270-5541-1-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20140731095906.GE29377@pengutronix.de>

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---

Notes:
    Changes since (implicit) v1:
    
     - rename package to python-django
     - drop -O2 in install stage because that results in a bigger installation without
       measureable gain
     - use cd && find instead of plain find to get a list of files to install.
     - make list of locales a single Kconfig variable
     - don't install .po and .py files for locales

 rules/python-django.in   | 22 ++++++++++++
 rules/python-django.make | 92 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 114 insertions(+)
 create mode 100644 rules/python-django.in
 create mode 100644 rules/python-django.make

diff --git a/rules/python-django.in b/rules/python-django.in
new file mode 100644
index 000000000000..cf2a16489d55
--- /dev/null
+++ b/rules/python-django.in
@@ -0,0 +1,22 @@
+## SECTION=networking
+
+menuconfig PYTHON_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 PYTHON_DJANGO
+
+	config PYTHON_DJANGO_LOCALES
+		string
+		prompt "Django locales"
+		default "de en"
+		help
+		  Space separated list of locales to install, e.g. "de en"
+
+endif
diff --git a/rules/python-django.make b/rules/python-django.make
new file mode 100644
index 000000000000..dab38db57717
--- /dev/null
+++ b/rules/python-django.make
@@ -0,0 +1,92 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2014 by Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
+#
+# 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_PYTHON_DJANGO) += python-django
+
+#
+# Paths and names
+#
+PYTHON_DJANGO_VERSION	:= 1.6.5
+PYTHON_DJANGO_MD5	:= e4c5b2d35ecb3807317713afa70a0c77
+PYTHON_DJANGO		:= Django-$(PYTHON_DJANGO_VERSION)
+PYTHON_DJANGO_SUFFIX	:= tar.gz
+PYTHON_DJANGO_URL	:= https://www.djangoproject.com/download/$(PYTHON_DJANGO_VERSION)/tarball/
+PYTHON_DJANGO_SOURCE	:= $(SRCDIR)/$(PYTHON_DJANGO).$(PYTHON_DJANGO_SUFFIX)
+PYTHON_DJANGO_DIR	:= $(BUILDDIR)/$(PYTHON_DJANGO)
+PYTHON_DJANGO_LICENSE	:= BSD
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+PYTHON_DJANGO_PATH	:= PATH=$(CROSS_PATH)
+PYTHON_DJANGO_CONF_TOOL	:= NO
+PYTHON_DJANGO_MAKE_ENV	:= $(CROSS_ENV)
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/python-django.compile:
+	@$(call targetinfo)
+	cd $(PYTHON_DJANGO_DIR) && \
+		$(PYTHON_DJANGO_PATH) $(PYTHON_DJANGO_MAKE_ENV) \
+		$(CROSS_PYTHON) setup.py build
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/python-django.install:
+	@$(call targetinfo)
+	cd $(PYTHON_DJANGO_DIR) && \
+		$(PYTHON_DJANGO_PATH) $(PYTHON_DJANGO_MAKE_ENV) \
+		$(CROSS_PYTHON) setup.py install --root=$(PYTHON_DJANGO_PKGDIR) --prefix=/usr
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+PYTHON_DJANGO_PYTHON_PATH = /usr/lib/python$(PYTHON_MAJORMINOR)/site-packages/django
+
+$(STATEDIR)/python-django.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, python-django)
+	@$(call install_fixup, python-django, PRIORITY, optional)
+	@$(call install_fixup, python-django, SECTION, base)
+	@$(call install_fixup, python-django, AUTHOR, "Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>")
+	@$(call install_fixup, python-django, DESCRIPTION, missing)
+
+	# everything but locales
+	cd "$(PYTHON_DJANGO_PKGDIR)$(PYTHON_DJANGO_PYTHON_PATH)" && find -type d -name locale -prune -o -type f -printf '%P\n' | while read fn; do \
+		$(call install_copy, python-django, 0, 0, 0644, -, $(PYTHON_DJANGO_PYTHON_PATH)/$$fn); \
+	done
+
+	# locales
+	cd "$(PYTHON_DJANGO_PKGDIR)$(PYTHON_DJANGO_PYTHON_PATH)" && find -type d -name locale -printf '/%P\n' | while read localedir; do \
+		for locale in $(shell echo $(PTXCONF_PYTHON_DJANGO_LOCALES)); do \
+			cd "$(PYTHON_DJANGO_PKGDIR)$(PYTHON_DJANGO_PYTHON_PATH)/$$localedir/$$locale" && \
+					find -type f -not \( -name \*.py -o -name \*.po \) -printf "%P\n" | while read fn; do \
+				$(call install_copy, python-django, 0, 0, 0644, -, $(PYTHON_DJANGO_PYTHON_PATH)/$$localedir/$$locale/$$fn); \
+			done; \
+		done; \
+	done
+
+	@$(call install_finish, python-django)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.0.1


-- 
ptxdist mailing list
ptxdist@pengutronix.de

      reply	other threads:[~2014-07-31 19:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30 18:12 [ptxdist] [PATCH] " Uwe Kleine-König
2014-07-31  8:14 ` Michael Olbrich
2014-07-31  8:44   ` Uwe Kleine-König
2014-07-31  9:08     ` Michael Olbrich
2014-07-31  9:17       ` Uwe Kleine-König
2014-07-31  9:59         ` Michael Olbrich
2014-07-31 19:34           ` Uwe Kleine-König [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1406835270-5541-1-git-send-email-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox