summaryrefslogtreecommitdiffstats
path: root/rules/python-django.make
blob: ae5946e320c304f53ff0a27f8c2f9a95af16a7f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# -*-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_CONF_TOOL	:= python

# ----------------------------------------------------------------------------
# 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 $(call remove_quotes, $(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