2016-03-14 05:26:59 -05:00
########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2016, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
#########################################################################
SHELL = /bin/sh
#########################################################################
# High-level targets
#########################################################################
all : install -pip -requirements pip
clean : clean -pip
#########################################################################
# Python PIP package
#########################################################################
ERROR_PERMISSIONS = by 'make install-pip-requirements' . The user must have permission to add files to site-packages for Python installation/virtual environment
IS_WHEEL_INSTALLED = 0
WHEEL_CHECK_CMD = which pip & > /dev/null && pip list wheel | grep wheel 2> /dev/null
WHEEL_INSTALL_CMD = pip install wheel
IS_PIP_INSTALLED = 0
PIP_INSTALL_CMD = easy_install pip
PIP_CHECK_CMD = which pip & > /dev/null && pip show pip | grep Metadata-Version 2>/dev/null
PGADMIN_SRC_DIR = pgadmin4
PGADMIN_EGG = ${ PGADMIN_SRC_DIR } .egg-info
PGADMIN_BUILD = build
2016-03-15 06:46:04 -05:00
PGADMIN_DIST = dist
2016-03-14 05:26:59 -05:00
PGADMIN_MANIFEST = MANIFEST.in
PGADMIN_INSTALL_CMD = pip install --use-wheel --find-links= ${ PGADMIN_DIST } ${ PGADMIN_SRC_DIR }
d e f i n e c r e a t e _ m a n i f e s t
2016-03-15 06:46:04 -05:00
@ p r i n t f 'recursive-include ${PGADMIN_SRC_DIR} *\nglobal-exclude pgadmin4.db *.pyc' > $ { P G A D M I N _ M A N I F E S T }
2016-03-14 05:26:59 -05:00
e n d e f
d e f i n e b u i l d
python pkg/pip/setup_pip.py bdist_wheel
e n d e f
install-pip-requirements :
i f e q ( $( shell $ {PIP_CHECK_CMD }) , )
${ PIP_INSTALL_CMD }
$( eval IS_PIP_INSTALLED = 1)
e n d i f
i f e q ( $( shell $ {WHEEL_CHECK_CMD }) , )
${ WHEEL_INSTALL_CMD }
$( eval IS_WHEEL_INSTALLED = 1)
e n d i f
pip :
i f e q ( $( shell $ {PIP_CHECK_CMD }) , )
@if [ $( value IS_PIP_INSTALLED) -ne 1 ] ; \
then \
echo >& 2 " Install pip ${ ERROR_PERMISSIONS } " ; \
false; \
fi
e n d i f
i f e q ( $( shell $ {WHEEL_CHECK_CMD }) , )
@if [ $( value IS_WHEEL_INSTALLED) -ne 1 ] ; \
then \
echo >& 2 " Install wheel ${ ERROR_PERMISSIONS } " ; \
false; \
fi
e n d i f
2016-03-15 06:46:04 -05:00
rm -rf ${ PGADMIN_SRC_DIR }
2016-03-14 05:26:59 -05:00
cp -r web ${ PGADMIN_SRC_DIR }
$( call create_manifest)
$( call build)
install-pip :
${ PGADMIN_INSTALL_CMD }
clean-pip :
rm -rf ${ PGADMIN_SRC_DIR }
rm -rf ${ PGADMIN_EGG }
rm -rf ${ PGADMIN_BUILD }
rm -rf ${ PGADMIN_DIST }
rm -f ${ PGADMIN_MANIFEST }