2b9a3a726493d66c526e3d8256178ff3e12c7e3c max Fri Apr 28 16:48:03 2017 -0700 renaming pylib to pyLib after Angie's suggestion (thanks) and adding a better error message when graphviz was not found. refs #13634 diff --git src/hg/pyLib/makefile src/hg/pyLib/makefile new file mode 100644 index 0000000..0e18c99 --- /dev/null +++ src/hg/pyLib/makefile @@ -0,0 +1,62 @@ +kentSrc = ../.. +include ../../inc/common.mk + +#cannot use common include rules, don't know how to overwrite :: targets +#include ../../inc/cgi_build_rules.mk + +ifeq (${CGI_BIN_USER},) + CGI_BIN_USER=${CGI_BIN}-${USER} +endif + +ifeq (${CGI_BIN_BETA},) + CGI_BIN_ALPHA=${CGI_BIN}-beta +endif + +# Take the MySQLdb implementation of the current machine and copy it into the +# CGI-BIN/pyLib/MySQLdb/ directory. This saves mirrors and our admins having to +# install this library. Hopefully the binary libraries work on Ubuntu and other +# distros as they work on our RedHat-based distro + +my:: compile + mkdir -p ${CGI_BIN_USER}/pyLib/ + rm -f ${CGI_BIN_USER}/pyLib/hgLib.{py,pyc,pyo} + cp -p hgLib.py ${CGI_BIN_USER}/pyLib/hgLib.py + cp -p hgLib.pyo ${CGI_BIN_USER}/pyLib/hgLib.pyo + + mkdir -p ${CGI_BIN_USER}/pyLib/MySQLdb + cp -R `python2.7 -c 'import MySQLdb, os.path; print os.path.dirname(MySQLdb.__file__)'`/* ${CGI_BIN_USER}/pyLib/MySQLdb/ + +beta:: compile + mkdir -p ${CGI_BIN_BETA}/pyLib/ + rm -f ${CGI_BIN_BETA}/pyLib/hgLib.{py,pyc,pyo} + cp -p hgLib.py ${CGI_BIN_BETA}/pyLib/hgLib.py + cp -p hgLib.pyo ${CGI_BIN_BETA}/pyLib/hgLib.pyo + + mkdir -p ${CGI_BIN_BETA}/pyLib/MySQLdb + cp -R `python2.7 -c 'import MySQLdb, os.path; print os.path.dirname(MySQLdb.__file__)'`/* ${CGI_BIN_BETA}/pyLib/MySQLdb/ + +alpha:: compile + mkdir -p ${CGI_BIN}/pyLib/ + rm -f ${CGI_BIN}/pyLib/hgLib.{py,pyc,pyo} + cp -p hgLib.py ${CGI_BIN}/pyLib/hgLib.py + cp -p hgLib.pyo ${CGI_BIN}/pyLib/hgLib.pyo + + mkdir -p ${CGI_BIN}/pyLib/MySQLdb + cp -R `python2.7 -c 'import MySQLdb, os.path; print os.path.dirname(MySQLdb.__file__)'`/* ${CGI_BIN}/pyLib/MySQLdb/ + +compile: + # byte-compile and strip all python source code to .pyo files + python2.7 -OO -m compileall ./ + +clean:: + rm -f *.pyc *.pyo + + # ? clean up the CGI-BIN directory, remove the MysqlDb library ? + #rm -f ${CGI_BIN}/pyLib/MySQLdb/* + #rm -f ${CGI_BIN}/pyLib/MySQLdb/constants/* + #rmdir ${CGI_BIN}/pyLib/MySQLdb/constants ${CGI_BIN}/pyLib/MySQLdb/ + +lint:: + pylint -E hgLib.py + +install::