package/python-web2py: move password generation
authorAngelo Compagnucci <angelo.compagnucci@gmail.com>
Wed, 28 Jun 2017 08:15:13 +0000 (10:15 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 31 Jul 2017 20:46:19 +0000 (22:46 +0200)
This commit moves the password generation as a post build step.
This prepares the option to remove the admin panel from
installation.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/python-web2py/python-web2py.mk

index 250453d39a1820675ddd1ccbddf0ba03c970017f..3f9d089bcd54dcd464683cfb9cf4331639cc6afe 100644 (file)
@@ -29,11 +29,16 @@ PYTHON_WEB2PY_EXCLUSIONS = \
        setup.py \
        tox.ini
 
-define PYTHON_WEB2PY_INSTALL_TARGET_CMDS
+define PYTHON_WEB2PY_GENERATE_PASSWORD
        $(HOST_DIR)/bin/python2 -c 'import os; \
                os.chdir("$(@D)"); \
                from gluon.main import save_password; \
                save_password($(BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD),8000)'
+endef
+
+PYTHON_WEB2PY_POST_BUILD_HOOKS += PYTHON_WEB2PY_GENERATE_PASSWORD
+
+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))