diff --git a/Makefile b/Makefile index e69de29..b422955 100644 --- a/Makefile +++ b/Makefile @@ -0,0 +1,51 @@ +######################################################################### +# +# pgAdmin 4 - PostgreSQL Tools +# +# Copyright (C) 2013 - 2016, The pgAdmin Development Team +# This software is released under the PostgreSQL Licence +# +######################################################################### + +define create_manifest + +@echo 'recursive-include pgAdmin4 *' > MANIFEST.in + +endef + +define build + python pip_setup/setup_pgadmin4.py bdist_wheel +endef + +ERROR_PERMISSIONS = by 'make install-required'. The user must have required permissions to add files to site-packages for python installation/virtual environment + +PIP_EXISTS := $(shell pip --version 2> /dev/null) +WHEEL_EXISTS := $(shell wheel -h 2> /dev/null) + +all: notify + cp -r web pgAdmin4 + $(call create_manifest) + $(call build) + +notify: +ifndef PIP_EXISTS + $(error Install pip ${ERROR_PERMISSIONS}) +endif + +ifndef WHEEL_EXISTS + $(error Install wheel ${ERROR_PERMISSIONS}) +endif + +install-required: + easy_install pip + pip install wheel + +install-pip: + pip install --use-wheel --find-links=dist pgAdmin4 + +clean: + rm -rf pgAdmin4 + rm -rf pgAdmin4.egg-info + rm -rf build + rm -rf dist + rm -f MANIFEST.in diff --git a/pip_setup/setup_pgadmin4.py b/pip_setup/setup_pgadmin4.py index e69de29..dd57eac 100644 --- a/pip_setup/setup_pgadmin4.py +++ b/pip_setup/setup_pgadmin4.py @@ -0,0 +1,101 @@ +######################################################################### +# +# pgAdmin 4 - PostgreSQL Tools +# +# Copyright (C) 2013 - 2016, The pgAdmin Development Team +# This software is released under the PostgreSQL Licence +# +########################################################################## + +import sys +import os +import re + +from setuptools import setup +from codecs import open +from os import path + +req_file='requirements_py' + str(sys.version_info[0]) + '.txt' + +with open(req_file) as reqf: + required = reqf.read().decode("utf-8").splitlines() + +here = path.abspath(path.dirname(__file__)) + +majorVersion = 0 +minorVersion = 0 +revisionVersion = 0 + +with open("pgAdmin4/config.py") as myfile: + for line in myfile: + if sys.version_info[0] == 3: + line = str(line, encoding='utf-8') + if re.match("APP_MAJOR =", line): + var = line.split("=") + for val in var: + majorVersion=val[1] + if re.match("APP_MINOR =", line): + var = line.split("=") + for val in var: + minorVersion=val[1] + if re.match("APP_REVISION =", line): + var = line.split("=") + for val in var: + revisionVersion=val[1] + +setup( + name='pgAdmin4', + + version=majorVersion + '.' + minorVersion + '.' + revisionVersion, + + description='PostgreSQL Tools', + long_description='Administration and management tools for the PostgreSQL database.', + + url='http://www.pgadmin.org/', + + # Author details + author='The pgAdmin Development Team', + author_email='pgadmin-hackers@postgresql.org', + + # Choose your license + license='PostgreSQL Licence', + + # See https://pypi.python.org/pypi?%3Aaction=list_classifiers + classifiers=[ + # 3 - Alpha + # 4 - Beta + # 5 - Production/Stable + 'Development Status :: 3 - Alpha', + + # Suppported Programming Languages + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.2', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', +], + + keywords='pgAdmin4', + + # Specify package names here. + packages=["pgAdmin4",], + + # To inclue dditional files into the package + include_package_data=True, + + install_requires=required, + + ##extras_require=, + + # Specify date files to be included. For Python 2.6 need to include them in MANIFEST.in + ##package_data="", + + # To package data files outside package directory. + ##data_files=, + + # 'scripts' keyword is used to provide executable scripts. It provides cross-platform support. + ##entry_points=, + +) +