django: convert to python pkg format + add python3 variant

This also updates all dependencies to use the new `python-django` package.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
This commit is contained in:
Alexandru Ardelean
2019-06-03 15:25:39 +03:00
parent 83277d8bf3
commit f026dba26e
14 changed files with 62 additions and 57 deletions

View File

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=django
PKG_VERSION:=1.11.17
PKG_RELEASE=3
PKG_RELEASE=4
PKG_SOURCE:=Django-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/D/Django
@@ -21,46 +21,50 @@ PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE LICENSE.python
PKG_CPE_ID:=cpe:/a:djangoproject:django
PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-django-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include ../python-package.mk
include ../python3-package.mk
define Package/django
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=The web framework for perfectionists with deadlines.
URL:=https://www.djangoproject.com/
DEPENDS:=+python +python-pytz
PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
define Package/django/Default
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=The web framework for perfectionists with deadlines.
URL:=https://www.djangoproject.com/
endef
define Package/django/description
define Package/python-django
$(call Package/django/Default)
DEPENDS:= \
+PACKAGE_python-django:python \
+PACKAGE_python-django:python-pytz
VARIANT:=python
endef
define Package/python-django/description
The web framework for perfectionists with deadlines.
endef
define Build/Compile
$(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
define Package/python3-django
$(call Package/django/Default)
DEPENDS:= \
+PACKAGE_python3-django:python3 \
+PACKAGE_python3-django:python3-pytz
VARIANT:=python3
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
$(INSTALL_DIR) $(1)/usr/bin
$(CP) \
$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
$(1)$(PYTHON_PKG_DIR)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/django-admin.py \
$(1)/usr/bin
define Package/python3-django/description
$(call Package/python-django/description)
.
(Variant for Python3)
endef
define Package/django/install
$(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
$(INSTALL_DIR) $(1)/usr/bin
$(CP) \
$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
$(1)$(PYTHON_PKG_DIR)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/django-admin.py \
$(1)/usr/bin
# fix python exec path
sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/bin/django-admin.py
endef
$(eval $(call PyPackage,python-django))
$(eval $(call BuildPackage,python-django))
$(eval $(call BuildPackage,django))
$(eval $(call Py3Package,python3-django))
$(eval $(call BuildPackage,python3-django))