buildroot/package/python-web2py/python-web2py.mk
Victor Huesca b34ead55c0 package: remove non-conventional prefix/suffix from github-fetched packages
On Github, a large number of projects name their tag
<some-prefix>-0.3-<some-suffix> (i.e release-3.0, poco-0.1-release,
etc.). In fact majority of the cased adressed in this commit concerns
prefixes.

In most packages, we encode those prefix/suffix in the <pkg>_VERSION
variable.

The problem with this approach is that when used in conjunction with
release-monitoring.org, it doesn't work very well, because
release-monitoring.org has the concept of "version prefix/suffix" and
using that they drop the prefix/suffix to really get the version. For
example on https://release-monitoring.org/project/5418/ the latest
release of "poco" is "1.8.1", not "poco-1.8.1-release".

Therefore, a number of packages in Buildroot have a version that
doesn't match with release-monitoring.org.

Since really the version number of 1.8.1, is makes sense to update our
packages to drop these prefixes/suffixes.

This commit addreses the case of github-fetched packages with
non-conventional prefixes/suffixes.

Note that these changes modify the name of the files stored in DL_DIR,
which means that this will force a re-download of those package source
code for all users, and requires a change to their .hash file.

Signed-off-by: Victor Huesca <victor.huesca@bootlin.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2019-06-19 23:26:35 +02:00

78 lines
2.2 KiB
Makefile

################################################################################
#
# python-web2py
#
################################################################################
PYTHON_WEB2PY_VERSION = 2.17.2
PYTHON_WEB2PY_SITE = $(call github,web2py,web2py,R-$(PYTHON_WEB2PY_VERSION))
PYTHON_WEB2PY_LICENSE = LGPL-3.0
PYTHON_WEB2PY_LICENSE_FILES = LICENSE
PYTHON_WEB2PY_DEPENDENCIES = $(if $(BR2_PACKAGE_PYTHON3),host-python3 python3,host-python python) \
python-pydal host-python-pydal
PYTHON_WEB2PY_EXCLUSIONS = \
welcome.w2p \
applications/examples \
applications/welcome \
deposit \
docs \
examples \
extras \
handlers \
scripts \
ABOUT \
anyserver.py \
CHANGELOG \
Makefile \
MANIFEST.in \
README.markdown \
setup.py \
tox.ini
define PYTHON_WEB2PY_GENERATE_PASSWORD
$(HOST_DIR)/bin/python -c 'import os; \
os.chdir("$(@D)"); \
from gluon.main import save_password; \
save_password($(BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD),8000)'
endef
ifeq ($(BR2_PACKAGE_PYTHON_WEB2PY_INSTALL_ADMIN),y)
PYTHON_WEB2PY_POST_BUILD_HOOKS += PYTHON_WEB2PY_GENERATE_PASSWORD
else
PYTHON_WEB2PY_EXCLUSIONS += applications/admin
endif
define PYTHON_WEB2PY_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/var/www/web2py
rsync -a $(@D)/ $(TARGET_DIR)/var/www/web2py/ \
$(addprefix --exclude=,$(PYTHON_WEB2PY_EXCLUSIONS))
endef
define PYTHON_WEB2PY_INSTALL_INIT_SYSV
$(INSTALL) -m 0755 -D package/python-web2py/S51web2py \
$(TARGET_DIR)/etc/init.d/S51web2py
endef
define PYTHON_WEB2PY_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 0644 package/python-web2py/web2py.service \
$(TARGET_DIR)/usr/lib/systemd/system/web2py.service
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
ln -fs ../../../../usr/lib//systemd/system/web2py.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/web2py.service
endef
# www-data user and group are used for web2py. Because these user and group
# are already set by buildroot, it is not necessary to redefine them.
# See system/skeleton/etc/passwd
# username: www-data uid: 33
# groupname: www-data gid: 33
#
# So, we just need to create the directories used by web2py with the right
# ownership.
define PYTHON_WEB2PY_PERMISSIONS
/var/www/web2py r 750 33 33 - - - - -
endef
$(eval $(generic-package))