From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:6f8:1178:2:5054:ff:fec0:8e10] ident=Debian-exim) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1XClV9-0006QN-0F for ptxdist@pengutronix.de; Thu, 31 Jul 2014 10:14:15 +0200 Received: from mol by ptx.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1XClV8-0004te-Ut for ptxdist@pengutronix.de; Thu, 31 Jul 2014 10:14:14 +0200 Date: Thu, 31 Jul 2014 10:14:14 +0200 From: Michael Olbrich Message-ID: <20140731081414.GB29377@pengutronix.de> References: <1406743955-30185-1-git-send-email-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1406743955-30185-1-git-send-email-u.kleine-koenig@pengutronix.de> Subject: Re: [ptxdist] [PATCH] django: new package to provide Django 1.6.5 Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Wed, Jul 30, 2014 at 08:12:35PM +0200, Uwe Kleine-K=F6nig wrote: > Signed-off-by: Uwe Kleine-K=F6nig > --- > 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=3Dnetworking > + > +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" Hmmm, I think a string with a proper comment here is better. 'Space separated list of locales, e.g. "de en"...' No need to make it harder than necessary to add new 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 > +# > +# See CREDITS for details about who has contributed to this project. > +# > +# For further information about the PTXdist project and license conditio= ns > +# see the README file. > +# > + > +# > +# We provide this package > +# > +PACKAGES-$(PTXCONF_DJANGO) +=3D django > + > +# > +# Paths and names > +# > +DJANGO_VERSION :=3D 1.6.5 > +DJANGO_MD5 :=3D e4c5b2d35ecb3807317713afa70a0c77 > +DJANGO :=3D Django-$(DJANGO_VERSION) > +DJANGO_SUFFIX :=3D tar.gz > +DJANGO_URL :=3D https://www.djangoproject.com/download/$(DJANGO_VERSION)= /tarball/ > +DJANGO_SOURCE :=3D $(SRCDIR)/$(DJANGO).$(DJANGO_SUFFIX) > +DJANGO_DIR :=3D $(BUILDDIR)/$(DJANGO) > +DJANGO_LICENSE :=3D BSD > + > +# ----------------------------------------------------------------------= ------ > +# Prepare > +# ----------------------------------------------------------------------= ------ > + > +DJANGO_PATH :=3D PATH=3D$(CROSS_PATH) > +DJANGO_CONF_TOOL :=3D NO > +DJANGO_MAKE_ENV :=3D $(CROSS_ENV) > + > +DJANGO_LOCALES-y :=3D > +DJANGO_LOCALES-$(PTXCONF_DJANGO_LOCALE_DE) +=3D de > +DJANGO_LOCALES-$(PTXCONF_DJANGO_LOCALE_EN) +=3D en > + > +# ----------------------------------------------------------------------= ------ > +# Compile > +# ----------------------------------------------------------------------= ------ > + > +$(STATEDIR)/django.compile: > + @$(call targetinfo) > + cd $(DJANGO_DIR) && \ > + $(DJANGO_PATH) $(DJANGO_MAKE_ENV) \ > + $(CROSS_PYTHON) setup.py build I think the prefix should be added here as well, in case it's used in some code generation etc. > + @$(call touch) > + > +# ----------------------------------------------------------------------= ------ > +# Install > +# ----------------------------------------------------------------------= ------ > + > +$(STATEDIR)/django.install: > + @$(call targetinfo) > + cd $(DJANGO_DIR) && \ > + $(DJANGO_PATH) $(DJANGO_MAKE_ENV) \ > + $(CROSS_PYTHON) setup.py install --root=3D$(DJANGO_PKGDIR) --prefix=3D= /usr -O2 Why '-O2' here and not in the compile stage? > + @$(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 ") > + @$(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 I dislike just dumping everything in the package, e.g. the egg-info is not needed. Install /usr/bin/django-admin.py explicitly and then use: @cd /usr/lib/python$(PYTHON_MAJORMINOR)/site-packages/django/ && find ... This way it breaks in case something went wrong and the directory is missing. > + > + # locales > + find "$(DJANGO_PKGDIR)" -type d -name locale -printf '/%P\n' | while re= ad localedir; do \ > + for locale in $(DJANGO_LOCALES-y); do \ > + find "$(DJANGO_PKGDIR)$$localedir/$$locale" -type f -printf "$$locale= dir/$$locale/%P\n" | while read fn; do \ Same here with 'cd' and I think the django.po files are not needed, just the Python stuff and the compiled django.mo Michael > + $(call install_copy, django, 0, 0, 0644, -, $$fn); \ > + done; \ > + done; \ > + done > + > + @$(call install_finish, django) > + > + @$(call touch) > + > +# vim: syntax=3Dmake > -- = > 2.0.1 > = > = > -- = > ptxdist mailing list > ptxdist@pengutronix.de -- = Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- = ptxdist mailing list ptxdist@pengutronix.de