public inbox for [email protected]
help / color / mirror / Atom feedFrom: Sandeep Thakkar <[email protected]>
To: Dave Page <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Cc: Hamid Quddus <[email protected]>
Cc: Devrim GÜNDÜZ <[email protected]>
Subject: Re: Patch for pgAdmin4 RPM package
Date: Thu, 2 Jun 2016 18:29:55 +0530
Message-ID: <CANFyU97jFmRRvF9y9JHOVQCJSd1pJiY1YEvKPpDfZbbwCJ-YmA@mail.gmail.com> (raw)
In-Reply-To: <CANFyU96uUAGHvTLOj_XcK3hC-DqzrpxrWxvPFfFC6J6WjKH29A@mail.gmail.com>
References: <CANFyU96tOSdX00+ZjUZ++wF9qzLt9UE_YdKjDWVzHGik+5kB4w@mail.gmail.com>
<CA+OCxoxBDt82P75Q4Cy4fBkznkPBW3YJwPz+wFARbBBSoi3fgg@mail.gmail.com>
<CANFyU97Ofo-fTF5HmNqrfX=i6a=6eJayksNq=W2Ay2yhT4ig5g@mail.gmail.com>
<CA+OCxoxgLB-mE=-_qHsQbBbziJ2D+h9qVRx9Am7hgrgpc52gkw@mail.gmail.com>
<CANFyU96uUAGHvTLOj_XcK3hC-DqzrpxrWxvPFfFC6J6WjKH29A@mail.gmail.com>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgadmin-hackers>
Hi
Few changes in the updated patch:
- added the missing modules in the specfile. The unavailable modules are
still commented.
- added changelog in specfile
- added dependency of pgadmin4-doc on pgadmin4-web
On Wed, Jun 1, 2016 at 2:57 PM, Sandeep Thakkar <
[email protected]> wrote:
> Hi Devrim,
>
> I have attached the patch for review. Please note that right now I have
> commented the python dependencies (in Requires) which you are building.
> Please review and let me know if specfile or anything else needs some
> changes. Once the rpms are built, please let me know how to install them so
> that I will enable those dependencies and do the testing.
>
> Hi Dave,
>
> The rpm will be built in $SRC/rpm-build. Inside this, we have the
> directories for sources (where tarball will be downloaded - for testing, I
> have mentioned the path of Bugatti :) ), build, etc.
>
> The html docs was not building and I had to make changes in docs/conf.py
> and install sphinx_rtd_theme. I have added this dependency and the Sphinx
> in the specfile. May be should add it in the requirements also? I tested
> this change on OS X and make docs is building fine.
>
> Since web package is installed in the default python site-packages as
> pgadmin4-web-v1 (for release "1"), with the help of Neel, I could made
> changes in Server.cpp to find that location. But, couldn't understand how
> to get the app release info, hence right now hard-coded the string as
> 'pgadmin4-web-v1".
>
> Note: In the patch, the Makefile and .gitignore also contains the mac
> related changes. This is just to see how they will look finally after mac
> and rpm changes are done. I will remove them from the rpm patch once the
> mac appbundle patch is committed.
>
> Questions:
> 1. Should we add 'docs' dependency target for 'rpm' like we did for
> appbundle?
> 2. Should web rpm require doc rpm? I guess so, otherwise online help won't
> work. Right?
>
> On Fri, May 27, 2016 at 6:35 PM, Dave Page <[email protected]> wrote:
>
>> [Adding Devrim]
>>
>> On Fri, May 27, 2016 at 1:55 PM, Sandeep Thakkar
>> <[email protected]> wrote:
>> >
>> >
>> > On Mon, May 9, 2016 at 6:35 PM, Dave Page <[email protected]> wrote:
>> >>
>> >> Hi
>> >>
>> >> Initial eyeball review comments below...
>> >>
>> >> On Fri, Apr 22, 2016 at 11:57 AM, Sandeep Thakkar
>> >> <[email protected]> wrote:
>> >>>
>> >>> Hi Team, Dave,
>> >>>
>> >>> Attached herewith are two patches.
>> >>>
>> >>> pgadmin4-rpm.patch - This is the main patch that includes scripts,
>> >>> makefiles and spec to create RPMs for RHEL6/RHEL7/F-22/F-23/F-24.
>> >>
>> >>
>> >> Can we keep the directory names in lower case?
>> >>
>> >
>> > Sure. Will do that.
>> >>>
>> >>> It will create two RPMs i.e pgadmin4 and pgadmin4-web. The pgadmin4
>> tpm
>> >>> depends on web and the web rpm depends on the python packages. I have
>> >>> commented the list of packages which are not available on some
>> systems so
>> >>> that Devrim can build them.
>> >>>
>> >>> The installation path for pgadmin4 is "/usr/pgadmin4-<major>.<minor>"
>> and
>> >>> pgadmin4-web is the site-packages/pgadmin4-web
>> >>
>> >> Shouldn't the -web package also have the major.minor version number in
>> the
>> >> path, to allow side-by-side installation?
>> >
>> > Right. Now that we don't have major/minor, so, will it be
>> /usr/pgadmin4-v1
>> > and pgadmin4-web-v1 ? Or?
>>
>> I think that's fine.
>>
>> >>
>> >>
>> >>>
>> >>> pgadmin4-server-ini.patch - This is the patch for runtime/Server.cpp.
>> As
>> >>> said pgadmin4-web and runtime installation directories are different
>> and
>> >>> that means web does not exists in parallel to runtime like in sources.
>> >>>
>> >>> I observed that the location of application settings was not defined
>> in
>> >>> Server.cpp. As per QSettings doc, the default location on Unix is the
>> >>> $HOME/.config/<companyname>/<appname>.conf. Here, $HOME depends on
>> the user
>> >>> that runs the application. So, I thought why not to define the
>> application
>> >>> settings in application directory itself. RPM then knows where to
>> define the
>> >>> ApplicationPath. I tested it and it worked fine with me. I haven't
>> done this
>> >>> change for platform dependent.
>> >>
>> >> Doesn't that prevent non-root users from changing the settings? Or (if
>> you
>> >> widen the permissions on the ini file), allow one user to
>> mis-configure the
>> >> app for others? I think what is needed here is a search path change,
>> much
>> >> like you added for the Mac app bundle.
>> >>
>> > Right. Will use python command to find the site-packages path and then
>> > concatenate pgadmin4-web directory name.
>>
>> OK.
>>
>> >> Other thoughts:
>> >>
>> >> - Please rename the README to README.txt
>> >>
>> >> - The code to build the RPMs should be entirely confined to pkg/rpm. A
>> >> Makefile target should be added to /Makefile to build/clean the targets
>> >> (this mistake was made with the Mac package too, but was one of the
>> original
>> >> requirements).
>> >>
>> >> Please resolve these issues and I'll take another look.
>> >>
>> > Sure. Will share it with you soon.
>>
>> -> Devrim please :-)
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>
>
> --
> Sandeep Thakkar
>
>
--
Sandeep Thakkar
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
Attachments:
[application/octet-stream] pgadmin-rpm-jun02.patch (45.5K, 3-pgadmin-rpm-jun02.patch)
download | inline diff:
diff --git a/.gitignore b/.gitignore
index 5d84dd2..c11f83d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,4 +24,6 @@ pgadmin4.log
/pgadmin4.egg-info
/MANIFEST.in
/build
+/mac-build
+/rpm-build
/dist
diff --git a/Makefile b/Makefile
index adae41c..5a10678 100644
--- a/Makefile
+++ b/Makefile
@@ -13,9 +13,9 @@ SHELL = /bin/sh
# High-level targets
#########################################################################
-all: install-pip-requirements pip
+all: docs install-pip-requirements pip appbundle rpm
-clean: clean-pip
+clean: clean-pip clean-docs clean-appbundle clean-rpm
#########################################################################
# Python PIP package
@@ -34,6 +34,8 @@ PIP_CHECK_CMD = which pip &> /dev/null && pip show pip | grep Metadata-Version 2
PGADMIN_SRC_DIR = pgadmin4
PGADMIN_EGG = ${PGADMIN_SRC_DIR}.egg-info
PGADMIN_BUILD = build
+PGADMIN_MACBUILD = mac-build
+PGADMIN_RPMBUILD = rpm-build
PGADMIN_DIST = dist
PGADMIN_MANIFEST = MANIFEST.in
PGADMIN_INSTALL_CMD = pip install --use-wheel --find-links=${PGADMIN_DIST} ${PGADMIN_SRC_DIR}
@@ -83,9 +85,32 @@ endif
install-pip:
${PGADMIN_INSTALL_CMD}
+appbundle: docs
+ ./pkg/mac/build.sh
+
+docs:
+ LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 $(MAKE) -C docs/en_US -f Makefile.sphinx html
+
+clean-docs:
+ LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 $(MAKE) -C docs/en_US -f Makefile.sphinx clean
+
clean-pip:
rm -rf ${PGADMIN_SRC_DIR}
rm -rf ${PGADMIN_EGG}
rm -rf ${PGADMIN_BUILD}
rm -rf ${PGADMIN_DIST}
rm -f ${PGADMIN_MANIFEST}
+
+clean-appbundle:
+ rm -rf ${PGADMIN_MACBUILD}
+ rm -rf ${PGADMIN_DIST}/pgadmin4*.dmg*
+
+rpm:
+ ./pkg/rpm/build.sh
+
+clean-rpm:
+ rm -rf ${PGADMIN_RPMBUILD}
+ rm -rf ${PGADMIN_DIST}/noarch
+ rm -rf ${PGADMIN_DIST}/x86_64
+
+.PHONY: docs
diff --git a/docs/en_US/conf.py b/docs/en_US/conf.py
index 93ad4e9..ac7c9fc 100644
--- a/docs/en_US/conf.py
+++ b/docs/en_US/conf.py
@@ -17,6 +17,7 @@ import sys, os
root = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, root + '/../../web/')
import config
+import sphinx_rtd_theme
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@@ -104,7 +105,7 @@ html_theme = 'sphinx_rtd_theme'
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
+html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
diff --git a/pkg/rpm/README.txt b/pkg/rpm/README.txt
new file mode 100644
index 0000000..9bbd25e
--- /dev/null
+++ b/pkg/rpm/README.txt
@@ -0,0 +1,30 @@
+Installing pgAdmin
+==================
+
+This document describes how to build pgAdmin on Linux and generate the RPMs.
+
+Supported Versions:
+
+ - RHEL6 or above, Fedora 22 or above
+
+Required Packages:
+
+ - All the required packages are mentioned in the requirements file. They should be
+installed with yum/dnf. On RHEL, some python modules are available only through EPEL.
+
+1. Python devel
+ - Python 2.6 or above
+
+2. Sphinx (to build docs)
+
+3. QT devel
+ - Qt 4.6 or above, QT 5
+
+4. PostgreSQL installation
+ - PostgreSQL 9.1 or above
+
+
+Building:
+
+To build, go to pgAdmin4 source root directory and execute "make rpm". This will
+create the RPMs for runtime, web and doc in $SRC/dist
diff --git a/pkg/rpm/build.sh b/pkg/rpm/build.sh
new file mode 100755
index 0000000..a6ebd81
--- /dev/null
+++ b/pkg/rpm/build.sh
@@ -0,0 +1,88 @@
+#!/bin/sh
+
+#Script to create the pgAdmin4 RPMs.
+
+# Check whether lsb_release exists to find the OS information
+if [ ! -f /usr/bin/lsb_release ]
+then
+ echo
+ echo "ERROR: lsb_release command does not exist. Please install it with"
+ echo
+ echo "yum -y install redhat-lsb-core"
+ echo
+ echo "Exiting..."
+ echo
+ exit 1
+fi
+
+# Check if spectool exists to download the sources
+if [ ! -f /usr/bin/spectool ]
+then
+ echo
+ echo "ERROR: spectool command does not exist. Please install it with"
+ echo
+ echo "yum -y install rpmdevtools"
+ echo
+ echo "Exiting..."
+ echo
+ exit 1
+fi
+
+# Gather some information from the OS: OS name, version and arch:
+LSB_DISTRO_NAME=`lsb_release -i -s`
+LSB_DISTRO_VERSION=`lsb_release -r -s`
+DISTRO_ARCH=`uname -m`
+
+# We need the lowercase version of the distro name:
+LSB_DISTRO_NAME=`echo $LSB_DISTRO_NAME | awk '{print tolower($0)}'`
+
+if [ "$LSB_DISTRO_NAME" = "centos" ]; then
+ LSB_DISTRO_VERSION=`echo $LSB_DISTRO_VERSION | cut -d"." -f1`
+ PKG_DIR="el-$LSB_DISTRO_VERSION"
+else
+ PKG_DIR="f-$LSB_DISTRO_VERSION"
+fi
+
+# Variables
+export TOPDIR=$(cd `dirname $0` && pwd)/../..
+export RPMBUILDROOT=$TOPDIR/rpm-build
+export SOURCEDIR=$RPMBUILDROOT/sources
+export BUILDDIR=$RPMBUILDROOT/build
+export BUILDROOT=$RPMBUILDROOT/buildroot
+export DISTROOT=$TOPDIR/dist
+
+# Create the directories if not exist
+mkdir -p $SOURCEDIR
+mkdir -p $BUILDDIR
+mkdir -p $BUILDROOT
+mkdir -p $DISTROOT
+
+# Find the pgAdmin4 app name and version from config.py
+export APP_RELEASE=`grep "^APP_RELEASE" web/config.py | cut -d"=" -f2 | sed 's/ //g'`
+export APP_REVISION=`grep "^APP_REVISION" web/config.py | cut -d"=" -f2 | sed 's/ //g'`
+export APP_NAME=`grep "^APP_NAME" web/config.py | cut -d"=" -f2 | sed "s/'//g"`
+# We want app name in lower case with no spaces
+export APP_NAME=`echo $APP_NAME | sed 's/ //g' | awk '{print tolower($0)}'`
+export APP_LONG_VERSION=$APP_RELEASE.$APP_REVISION
+export APP_SHORT_VERSION=`echo $APP_LONG_VERSION | cut -d . -f1,2`
+export APP_SUFFIX=`grep "^APP_SUFFIX" web/config.py | cut -d"=" -f2 | sed 's/ //g' | sed "s/'//g"`
+if [ ! -z $APP_SUFFIX ]; then
+ export APP_LONG_VERSION=$APP_LONG_VERSION-$APP_SUFFIX
+ export APP_REVISION="${APP_REVISION}_$APP_SUFFIX" #hyphen not allowed in SPEC for version
+fi
+
+# Generate SPEC
+cd ./pkg/rpm/$PKG_DIR
+
+sed -e "s/APP_REL/$APP_RELEASE/" \
+ -e "s/APP_REV/$APP_REVISION/" \
+ -e "s/APP_NAME/$APP_NAME/" \
+ -e "s/DISTRO_ARCH/$DISTRO_ARCH/" pgadmin4.spec.in > pgadmin4.spec
+
+# Build RPMs
+make rpm || exit 1
+
+# Clean up buildroot after successful build
+echo "Cleaning up..."
+rm -rf $RPMBUILDROOT
+
diff --git a/pkg/rpm/common/Makefile.global b/pkg/rpm/common/Makefile.global
new file mode 100644
index 0000000..31a6c4c
--- /dev/null
+++ b/pkg/rpm/common/Makefile.global
@@ -0,0 +1,22 @@
+
+prep:
+ # Update spec file, patches, etc, before running spectool:
+ git pull
+ # Use spectool to download source files, especially tarballs.
+ spectool -g -S $(SPECFILE) -C $(SOURCEDIR)
+
+allclean:
+ git clean -df
+
+clean:
+ rm -rf i386/ i586/ i686/ x86_64/ noarch/
+ rm -f *.src.rpm
+ rm -f *.tar *.tar.gz *.tar.bz2 *.tgz *.zip .xz
+
+rpm: prep
+ rpmbuild --define "_sourcedir $(SOURCEDIR)" \
+ --define "_specdir $(PWD)" \
+ --define "_builddir $(BUILDDIR)" \
+ --define "_rpmdir $(DISTROOT)" \
+ --define "_buildrootdir $(BUILDROOT)" \
+ --define "dist $(DIST)" -bb $(SPECFILE)
diff --git a/pkg/rpm/el-6/Makefile b/pkg/rpm/el-6/Makefile
new file mode 100644
index 0000000..8a31664
--- /dev/null
+++ b/pkg/rpm/el-6/Makefile
@@ -0,0 +1,8 @@
+
+ARCH=`rpm --eval "%{_arch}"`
+DIR=`pwd`
+DIST=.rhel6
+SPECFILE="pgadmin4.spec"
+
+# Now, include global Makefile
+include ../common/Makefile.global
diff --git a/pkg/rpm/el-6/pgadmin4.spec.in b/pkg/rpm/el-6/pgadmin4.spec.in
new file mode 100644
index 0000000..3e58b9d
--- /dev/null
+++ b/pkg/rpm/el-6/pgadmin4.spec.in
@@ -0,0 +1,231 @@
+
+%define pgAdmin4_release APP_REL
+%define pgAdmin4_revision APP_REV
+
+%define name APP_NAME
+%define pgadmin4instdir /usr/%{name}-v%{pgAdmin4_release}
+%define pgadmin4_webinstdir %{name}-web-v%{pgAdmin4_release}
+
+Name: %{name}
+Version: %{pgAdmin4_release}.%{pgAdmin4_revision}
+Release: 1%{?dist}
+Summary: pgAdmin 4 is a rewrite of the popular pgAdmin3 management tool for the PostgreSQL (http://www.postgresql.org) database.
+
+Group: Applications/Databases
+License: PostgreSQL License
+URL: http://www.pgadmin.org
+Source0: http://bugatti.pn.in.enterprisedb.com/temp/pgadmin4/pgadmin4-v%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildArch: DISTRO_ARCH
+
+BuildRequires: mesa-libGL-devel
+BuildRequires: gcc-c++
+Requires: pgadmin4-web-v%{pgAdmin4_release}
+%if 0%{?fedora}
+BuildRequires: qt5-qtbase-devel >= 5.1
+BuildRequires: qt5-qtwebkit-devel
+%define QMAKE /usr/bin/qmake-qt5
+%else
+BuildRequires: qt-devel >= 4.6
+BuildRequires: qtwebkit-devel
+%define QMAKE /usr/lib64/qt4/bin/qmake
+%endif
+
+%if 0%{?fedora}
+BuildRequires: python3-devel
+Requires: python >= 3.3
+%else
+BuildRequires: python-devel
+Requires: python >= 2.6
+%endif
+
+%if 0%{?fedora}
+Requires: qt >= 5.1
+%else
+Requires: qt >= 4.6
+%endif
+
+%description
+pgAdmin 4 is a rewrite of the popular pgAdmin3 management tool for the PostgreSQL (http://www.postgresql.org) database.
+pgAdmin 4 is being written as a web application in Python, using jQuery and
+Bootstrap for the client side processing and UI. On the server side, Flask is
+being utilised.
+
+Although developed using web technologies, we intend for pgAdmin 4 to be usable
+either on a web server using a browser, or standalone on a workstation. The
+runtime/ subdirectory contains a QT based runtime application intended to allow
+this - it is essentially a browser and Python interpretor in one package which
+will be capable of hosting the Python application and presenting it to the user
+as a desktop application.
+
+%package docs
+Summary: Documentation for pgAdmin4
+Group: Applications/Databases
+# These are required for -docs subpackage:
+%if 0%{?fedora}
+BuildRequires: python3-sphinx
+BuildRequires: python3-sphinx_rtd_theme
+%else
+BuildRequires: python-sphinx
+BuildRequires: python-sphinx_rtd_theme
+%endif
+
+%description docs
+This package contains documentation for various languages,
+which are in html format.
+
+%package web
+Summary: pgAdmin4 web package
+BuildArch: noarch
+Requires: pgadmin4-doc-v%{pgAdmin4_release}
+%if 0%{?fedora}
+Requires: python3-babel
+Requires: python3-flask
+Requires: python3-flask-sqlalchemy
+Requires: python3-flask-wtf
+Requires: python3-jinja2
+Requires: python3-markupsafe
+Requires: python3-sqlalchemy
+Requires: python3-wtforms
+Requires: python3-beautifulsoup4
+Requires: python3-blinker
+Requires: python3-html5lib
+Requires: python3-itsdangerous
+Requires: python3-psycopg2
+Requires: python3-six
+Requires: python3-crypto
+Requires: python3-simplejson
+Requires: python3-dateutil
+Requires: python3-werkzeug
+Requires: python3-sqlparse
+Requires: python3-sqlparse
+Requires: python3-docutils
+Requires: python3-extras
+Requires: python3-fixtures
+Requires: python3-linecache2
+Requires: python3-pbr
+Requires: python3-pygments
+Requires: python3-mimeparse
+Requires: python3-snowballstemmer
+Requires: python3-testscenarios
+Requires: python3-testtools
+Requires: python3-traceback2
+Requires: python3-unittest2
+Requires: python3-wheel
+Requires: python3-sphinx-theme-alabaster
+#Requires: python3-pyrsistent
+#Requires: python3-flask-babel
+#Requires: python3-speaklater
+#Requires: python3-passlib
+#Requires: python3-flask-gravatar
+#Requires: python3-flask-mail
+#Requires: python3-flask-security
+#Requires: python3-flask-login
+#Requires: python3-flask-principal
+#Requires: python3-django-htmlmin
+%else
+Requires: python-babel
+Requires: python-flask
+Requires: python-flask-sqlalchemy
+Requires: python-flask-wtf
+Requires: python-jinja2
+Requires: python-markupsafe
+Requires: python-sqlalchemy
+Requires: python-wtforms
+Requires: python-beautifulsoup4
+Requires: python-blinker
+Requires: python-html5lib
+Requires: python-itsdangerous
+Requires: python-psycopg2
+Requires: python-six
+Requires: python-crypto
+Requires: python-simplejson
+Requires: python-dateutil
+Requires: python-werkzeug
+Requires: pytz
+Requires: python-sqlparse
+Requires: python-sqlparse
+Requires: python-docutils
+Requires: python-extras
+Requires: python-fixtures
+Requires: python-linecache2
+Requires: python-pbr
+Requires: python-pygments
+Requires: python-mimeparse
+Requires: python-snowballstemmer
+Requires: python-testscenarios
+Requires: python-testtools
+Requires: python-traceback2
+Requires: python-unittest2
+#Requires: python-pyrsistent
+#Requires: python-flask-babel
+#Requires: python-speaklater
+#Requires: python-passlib
+#Requires: python-flask-gravatar
+#Requires: python-flask-mail
+#Requires: python-flask-security
+#Requires: python-flask-login
+#Requires: python-flask-principal
+#Requires: python-django-htmlmin
+#Requires: python-importlib
+%endif
+
+%if 0%{?fedora}
+%define PYTHON_SITELIB %{python3_sitelib}
+%else
+%define PYTHON_SITELIB %{python2_sitelib}
+%endif
+
+%description web
+This package contains the required files to run pgAdmin4 as a web application
+
+%prep
+%setup -n pgadmin4/runtime
+
+%build
+cd ../runtime
+%{QMAKE} -o Makefile pgAdmin4.pro
+make
+cd ..
+LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 make -C docs/en_US -f Makefile.sphinx html
+#chrpath -d pgAdmin4
+
+%install
+rm -rf %{buildroot}
+cd ..
+install -d -m 755 %{buildroot}/%{_docdir}/pgadmin4-docs-v%{pgAdmin4_release}
+cp -r docs/en_US/_build/html %{buildroot}/%{_docdir}/pgadmin4-docs-v%{pgAdmin4_release}
+
+cd runtime
+install -d -m 755 %{buildroot}%{pgadmin4instdir}/runtime
+cp pgAdmin4 %{buildroot}%{pgadmin4instdir}/runtime
+
+install -d -m 755 %{buildroot}%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+cp -pR ../web/* %{buildroot}%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+cd %{buildroot}%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+rm -f pgadmin4.db config_local.* config*.pyc
+echo "SERVER_MODE = False" > config_local.py
+echo "MINIFY_HTML = False" >> config_local.py
+echo "HTML_HELP = '%{_docdir}/pgadmin4-doc-v1/html/'" >> config_local.py
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{pgadmin4instdir}/runtime/pgAdmin4
+
+%files web
+%defattr(-,root,root,-)
+%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+%doc
+
+%files docs
+%defattr(-,root,root)
+%{_docdir}/pgadmin4-docs-v%{pgAdmin4_release}
+
+%changelog
+* Fri Jun 03 2016 Sandeep Thakkar <[email protected]>
+- Initial RPM for v1.0alpha1
+
diff --git a/pkg/rpm/el-7/Makefile b/pkg/rpm/el-7/Makefile
new file mode 100644
index 0000000..1eb0ea0
--- /dev/null
+++ b/pkg/rpm/el-7/Makefile
@@ -0,0 +1,8 @@
+
+ARCH=`rpm --eval "%{_arch}"`
+DIR=`pwd`
+DIST=.rhel7
+SPECFILE="pgadmin4.spec"
+
+# Now, include global Makefile
+include ../common/Makefile.global
diff --git a/pkg/rpm/el-7/pgadmin4.spec.in b/pkg/rpm/el-7/pgadmin4.spec.in
new file mode 100644
index 0000000..3e58b9d
--- /dev/null
+++ b/pkg/rpm/el-7/pgadmin4.spec.in
@@ -0,0 +1,231 @@
+
+%define pgAdmin4_release APP_REL
+%define pgAdmin4_revision APP_REV
+
+%define name APP_NAME
+%define pgadmin4instdir /usr/%{name}-v%{pgAdmin4_release}
+%define pgadmin4_webinstdir %{name}-web-v%{pgAdmin4_release}
+
+Name: %{name}
+Version: %{pgAdmin4_release}.%{pgAdmin4_revision}
+Release: 1%{?dist}
+Summary: pgAdmin 4 is a rewrite of the popular pgAdmin3 management tool for the PostgreSQL (http://www.postgresql.org) database.
+
+Group: Applications/Databases
+License: PostgreSQL License
+URL: http://www.pgadmin.org
+Source0: http://bugatti.pn.in.enterprisedb.com/temp/pgadmin4/pgadmin4-v%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildArch: DISTRO_ARCH
+
+BuildRequires: mesa-libGL-devel
+BuildRequires: gcc-c++
+Requires: pgadmin4-web-v%{pgAdmin4_release}
+%if 0%{?fedora}
+BuildRequires: qt5-qtbase-devel >= 5.1
+BuildRequires: qt5-qtwebkit-devel
+%define QMAKE /usr/bin/qmake-qt5
+%else
+BuildRequires: qt-devel >= 4.6
+BuildRequires: qtwebkit-devel
+%define QMAKE /usr/lib64/qt4/bin/qmake
+%endif
+
+%if 0%{?fedora}
+BuildRequires: python3-devel
+Requires: python >= 3.3
+%else
+BuildRequires: python-devel
+Requires: python >= 2.6
+%endif
+
+%if 0%{?fedora}
+Requires: qt >= 5.1
+%else
+Requires: qt >= 4.6
+%endif
+
+%description
+pgAdmin 4 is a rewrite of the popular pgAdmin3 management tool for the PostgreSQL (http://www.postgresql.org) database.
+pgAdmin 4 is being written as a web application in Python, using jQuery and
+Bootstrap for the client side processing and UI. On the server side, Flask is
+being utilised.
+
+Although developed using web technologies, we intend for pgAdmin 4 to be usable
+either on a web server using a browser, or standalone on a workstation. The
+runtime/ subdirectory contains a QT based runtime application intended to allow
+this - it is essentially a browser and Python interpretor in one package which
+will be capable of hosting the Python application and presenting it to the user
+as a desktop application.
+
+%package docs
+Summary: Documentation for pgAdmin4
+Group: Applications/Databases
+# These are required for -docs subpackage:
+%if 0%{?fedora}
+BuildRequires: python3-sphinx
+BuildRequires: python3-sphinx_rtd_theme
+%else
+BuildRequires: python-sphinx
+BuildRequires: python-sphinx_rtd_theme
+%endif
+
+%description docs
+This package contains documentation for various languages,
+which are in html format.
+
+%package web
+Summary: pgAdmin4 web package
+BuildArch: noarch
+Requires: pgadmin4-doc-v%{pgAdmin4_release}
+%if 0%{?fedora}
+Requires: python3-babel
+Requires: python3-flask
+Requires: python3-flask-sqlalchemy
+Requires: python3-flask-wtf
+Requires: python3-jinja2
+Requires: python3-markupsafe
+Requires: python3-sqlalchemy
+Requires: python3-wtforms
+Requires: python3-beautifulsoup4
+Requires: python3-blinker
+Requires: python3-html5lib
+Requires: python3-itsdangerous
+Requires: python3-psycopg2
+Requires: python3-six
+Requires: python3-crypto
+Requires: python3-simplejson
+Requires: python3-dateutil
+Requires: python3-werkzeug
+Requires: python3-sqlparse
+Requires: python3-sqlparse
+Requires: python3-docutils
+Requires: python3-extras
+Requires: python3-fixtures
+Requires: python3-linecache2
+Requires: python3-pbr
+Requires: python3-pygments
+Requires: python3-mimeparse
+Requires: python3-snowballstemmer
+Requires: python3-testscenarios
+Requires: python3-testtools
+Requires: python3-traceback2
+Requires: python3-unittest2
+Requires: python3-wheel
+Requires: python3-sphinx-theme-alabaster
+#Requires: python3-pyrsistent
+#Requires: python3-flask-babel
+#Requires: python3-speaklater
+#Requires: python3-passlib
+#Requires: python3-flask-gravatar
+#Requires: python3-flask-mail
+#Requires: python3-flask-security
+#Requires: python3-flask-login
+#Requires: python3-flask-principal
+#Requires: python3-django-htmlmin
+%else
+Requires: python-babel
+Requires: python-flask
+Requires: python-flask-sqlalchemy
+Requires: python-flask-wtf
+Requires: python-jinja2
+Requires: python-markupsafe
+Requires: python-sqlalchemy
+Requires: python-wtforms
+Requires: python-beautifulsoup4
+Requires: python-blinker
+Requires: python-html5lib
+Requires: python-itsdangerous
+Requires: python-psycopg2
+Requires: python-six
+Requires: python-crypto
+Requires: python-simplejson
+Requires: python-dateutil
+Requires: python-werkzeug
+Requires: pytz
+Requires: python-sqlparse
+Requires: python-sqlparse
+Requires: python-docutils
+Requires: python-extras
+Requires: python-fixtures
+Requires: python-linecache2
+Requires: python-pbr
+Requires: python-pygments
+Requires: python-mimeparse
+Requires: python-snowballstemmer
+Requires: python-testscenarios
+Requires: python-testtools
+Requires: python-traceback2
+Requires: python-unittest2
+#Requires: python-pyrsistent
+#Requires: python-flask-babel
+#Requires: python-speaklater
+#Requires: python-passlib
+#Requires: python-flask-gravatar
+#Requires: python-flask-mail
+#Requires: python-flask-security
+#Requires: python-flask-login
+#Requires: python-flask-principal
+#Requires: python-django-htmlmin
+#Requires: python-importlib
+%endif
+
+%if 0%{?fedora}
+%define PYTHON_SITELIB %{python3_sitelib}
+%else
+%define PYTHON_SITELIB %{python2_sitelib}
+%endif
+
+%description web
+This package contains the required files to run pgAdmin4 as a web application
+
+%prep
+%setup -n pgadmin4/runtime
+
+%build
+cd ../runtime
+%{QMAKE} -o Makefile pgAdmin4.pro
+make
+cd ..
+LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 make -C docs/en_US -f Makefile.sphinx html
+#chrpath -d pgAdmin4
+
+%install
+rm -rf %{buildroot}
+cd ..
+install -d -m 755 %{buildroot}/%{_docdir}/pgadmin4-docs-v%{pgAdmin4_release}
+cp -r docs/en_US/_build/html %{buildroot}/%{_docdir}/pgadmin4-docs-v%{pgAdmin4_release}
+
+cd runtime
+install -d -m 755 %{buildroot}%{pgadmin4instdir}/runtime
+cp pgAdmin4 %{buildroot}%{pgadmin4instdir}/runtime
+
+install -d -m 755 %{buildroot}%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+cp -pR ../web/* %{buildroot}%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+cd %{buildroot}%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+rm -f pgadmin4.db config_local.* config*.pyc
+echo "SERVER_MODE = False" > config_local.py
+echo "MINIFY_HTML = False" >> config_local.py
+echo "HTML_HELP = '%{_docdir}/pgadmin4-doc-v1/html/'" >> config_local.py
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{pgadmin4instdir}/runtime/pgAdmin4
+
+%files web
+%defattr(-,root,root,-)
+%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+%doc
+
+%files docs
+%defattr(-,root,root)
+%{_docdir}/pgadmin4-docs-v%{pgAdmin4_release}
+
+%changelog
+* Fri Jun 03 2016 Sandeep Thakkar <[email protected]>
+- Initial RPM for v1.0alpha1
+
diff --git a/pkg/rpm/f-22/Makefile b/pkg/rpm/f-22/Makefile
new file mode 100644
index 0000000..d6ed841
--- /dev/null
+++ b/pkg/rpm/f-22/Makefile
@@ -0,0 +1,8 @@
+
+ARCH=`rpm --eval "%{_arch}"`
+DIR=`pwd`
+DIST=.f22
+SPECFILE="pgadmin4.spec"
+
+# Now, include global Makefile
+include ../common/Makefile.global
diff --git a/pkg/rpm/f-22/pgadmin4.spec.in b/pkg/rpm/f-22/pgadmin4.spec.in
new file mode 100644
index 0000000..3e58b9d
--- /dev/null
+++ b/pkg/rpm/f-22/pgadmin4.spec.in
@@ -0,0 +1,231 @@
+
+%define pgAdmin4_release APP_REL
+%define pgAdmin4_revision APP_REV
+
+%define name APP_NAME
+%define pgadmin4instdir /usr/%{name}-v%{pgAdmin4_release}
+%define pgadmin4_webinstdir %{name}-web-v%{pgAdmin4_release}
+
+Name: %{name}
+Version: %{pgAdmin4_release}.%{pgAdmin4_revision}
+Release: 1%{?dist}
+Summary: pgAdmin 4 is a rewrite of the popular pgAdmin3 management tool for the PostgreSQL (http://www.postgresql.org) database.
+
+Group: Applications/Databases
+License: PostgreSQL License
+URL: http://www.pgadmin.org
+Source0: http://bugatti.pn.in.enterprisedb.com/temp/pgadmin4/pgadmin4-v%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildArch: DISTRO_ARCH
+
+BuildRequires: mesa-libGL-devel
+BuildRequires: gcc-c++
+Requires: pgadmin4-web-v%{pgAdmin4_release}
+%if 0%{?fedora}
+BuildRequires: qt5-qtbase-devel >= 5.1
+BuildRequires: qt5-qtwebkit-devel
+%define QMAKE /usr/bin/qmake-qt5
+%else
+BuildRequires: qt-devel >= 4.6
+BuildRequires: qtwebkit-devel
+%define QMAKE /usr/lib64/qt4/bin/qmake
+%endif
+
+%if 0%{?fedora}
+BuildRequires: python3-devel
+Requires: python >= 3.3
+%else
+BuildRequires: python-devel
+Requires: python >= 2.6
+%endif
+
+%if 0%{?fedora}
+Requires: qt >= 5.1
+%else
+Requires: qt >= 4.6
+%endif
+
+%description
+pgAdmin 4 is a rewrite of the popular pgAdmin3 management tool for the PostgreSQL (http://www.postgresql.org) database.
+pgAdmin 4 is being written as a web application in Python, using jQuery and
+Bootstrap for the client side processing and UI. On the server side, Flask is
+being utilised.
+
+Although developed using web technologies, we intend for pgAdmin 4 to be usable
+either on a web server using a browser, or standalone on a workstation. The
+runtime/ subdirectory contains a QT based runtime application intended to allow
+this - it is essentially a browser and Python interpretor in one package which
+will be capable of hosting the Python application and presenting it to the user
+as a desktop application.
+
+%package docs
+Summary: Documentation for pgAdmin4
+Group: Applications/Databases
+# These are required for -docs subpackage:
+%if 0%{?fedora}
+BuildRequires: python3-sphinx
+BuildRequires: python3-sphinx_rtd_theme
+%else
+BuildRequires: python-sphinx
+BuildRequires: python-sphinx_rtd_theme
+%endif
+
+%description docs
+This package contains documentation for various languages,
+which are in html format.
+
+%package web
+Summary: pgAdmin4 web package
+BuildArch: noarch
+Requires: pgadmin4-doc-v%{pgAdmin4_release}
+%if 0%{?fedora}
+Requires: python3-babel
+Requires: python3-flask
+Requires: python3-flask-sqlalchemy
+Requires: python3-flask-wtf
+Requires: python3-jinja2
+Requires: python3-markupsafe
+Requires: python3-sqlalchemy
+Requires: python3-wtforms
+Requires: python3-beautifulsoup4
+Requires: python3-blinker
+Requires: python3-html5lib
+Requires: python3-itsdangerous
+Requires: python3-psycopg2
+Requires: python3-six
+Requires: python3-crypto
+Requires: python3-simplejson
+Requires: python3-dateutil
+Requires: python3-werkzeug
+Requires: python3-sqlparse
+Requires: python3-sqlparse
+Requires: python3-docutils
+Requires: python3-extras
+Requires: python3-fixtures
+Requires: python3-linecache2
+Requires: python3-pbr
+Requires: python3-pygments
+Requires: python3-mimeparse
+Requires: python3-snowballstemmer
+Requires: python3-testscenarios
+Requires: python3-testtools
+Requires: python3-traceback2
+Requires: python3-unittest2
+Requires: python3-wheel
+Requires: python3-sphinx-theme-alabaster
+#Requires: python3-pyrsistent
+#Requires: python3-flask-babel
+#Requires: python3-speaklater
+#Requires: python3-passlib
+#Requires: python3-flask-gravatar
+#Requires: python3-flask-mail
+#Requires: python3-flask-security
+#Requires: python3-flask-login
+#Requires: python3-flask-principal
+#Requires: python3-django-htmlmin
+%else
+Requires: python-babel
+Requires: python-flask
+Requires: python-flask-sqlalchemy
+Requires: python-flask-wtf
+Requires: python-jinja2
+Requires: python-markupsafe
+Requires: python-sqlalchemy
+Requires: python-wtforms
+Requires: python-beautifulsoup4
+Requires: python-blinker
+Requires: python-html5lib
+Requires: python-itsdangerous
+Requires: python-psycopg2
+Requires: python-six
+Requires: python-crypto
+Requires: python-simplejson
+Requires: python-dateutil
+Requires: python-werkzeug
+Requires: pytz
+Requires: python-sqlparse
+Requires: python-sqlparse
+Requires: python-docutils
+Requires: python-extras
+Requires: python-fixtures
+Requires: python-linecache2
+Requires: python-pbr
+Requires: python-pygments
+Requires: python-mimeparse
+Requires: python-snowballstemmer
+Requires: python-testscenarios
+Requires: python-testtools
+Requires: python-traceback2
+Requires: python-unittest2
+#Requires: python-pyrsistent
+#Requires: python-flask-babel
+#Requires: python-speaklater
+#Requires: python-passlib
+#Requires: python-flask-gravatar
+#Requires: python-flask-mail
+#Requires: python-flask-security
+#Requires: python-flask-login
+#Requires: python-flask-principal
+#Requires: python-django-htmlmin
+#Requires: python-importlib
+%endif
+
+%if 0%{?fedora}
+%define PYTHON_SITELIB %{python3_sitelib}
+%else
+%define PYTHON_SITELIB %{python2_sitelib}
+%endif
+
+%description web
+This package contains the required files to run pgAdmin4 as a web application
+
+%prep
+%setup -n pgadmin4/runtime
+
+%build
+cd ../runtime
+%{QMAKE} -o Makefile pgAdmin4.pro
+make
+cd ..
+LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 make -C docs/en_US -f Makefile.sphinx html
+#chrpath -d pgAdmin4
+
+%install
+rm -rf %{buildroot}
+cd ..
+install -d -m 755 %{buildroot}/%{_docdir}/pgadmin4-docs-v%{pgAdmin4_release}
+cp -r docs/en_US/_build/html %{buildroot}/%{_docdir}/pgadmin4-docs-v%{pgAdmin4_release}
+
+cd runtime
+install -d -m 755 %{buildroot}%{pgadmin4instdir}/runtime
+cp pgAdmin4 %{buildroot}%{pgadmin4instdir}/runtime
+
+install -d -m 755 %{buildroot}%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+cp -pR ../web/* %{buildroot}%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+cd %{buildroot}%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+rm -f pgadmin4.db config_local.* config*.pyc
+echo "SERVER_MODE = False" > config_local.py
+echo "MINIFY_HTML = False" >> config_local.py
+echo "HTML_HELP = '%{_docdir}/pgadmin4-doc-v1/html/'" >> config_local.py
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{pgadmin4instdir}/runtime/pgAdmin4
+
+%files web
+%defattr(-,root,root,-)
+%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+%doc
+
+%files docs
+%defattr(-,root,root)
+%{_docdir}/pgadmin4-docs-v%{pgAdmin4_release}
+
+%changelog
+* Fri Jun 03 2016 Sandeep Thakkar <[email protected]>
+- Initial RPM for v1.0alpha1
+
diff --git a/pkg/rpm/f-23/Makefile b/pkg/rpm/f-23/Makefile
new file mode 100644
index 0000000..9316c99
--- /dev/null
+++ b/pkg/rpm/f-23/Makefile
@@ -0,0 +1,8 @@
+
+ARCH=`rpm --eval "%{_arch}"`
+DIR=`pwd`
+DIST=.f23
+SPECFILE="pgadmin4.spec"
+
+# Now, include global Makefile
+include ../common/Makefile.global
diff --git a/pkg/rpm/f-23/pgadmin4.spec.in b/pkg/rpm/f-23/pgadmin4.spec.in
new file mode 100644
index 0000000..3e58b9d
--- /dev/null
+++ b/pkg/rpm/f-23/pgadmin4.spec.in
@@ -0,0 +1,231 @@
+
+%define pgAdmin4_release APP_REL
+%define pgAdmin4_revision APP_REV
+
+%define name APP_NAME
+%define pgadmin4instdir /usr/%{name}-v%{pgAdmin4_release}
+%define pgadmin4_webinstdir %{name}-web-v%{pgAdmin4_release}
+
+Name: %{name}
+Version: %{pgAdmin4_release}.%{pgAdmin4_revision}
+Release: 1%{?dist}
+Summary: pgAdmin 4 is a rewrite of the popular pgAdmin3 management tool for the PostgreSQL (http://www.postgresql.org) database.
+
+Group: Applications/Databases
+License: PostgreSQL License
+URL: http://www.pgadmin.org
+Source0: http://bugatti.pn.in.enterprisedb.com/temp/pgadmin4/pgadmin4-v%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildArch: DISTRO_ARCH
+
+BuildRequires: mesa-libGL-devel
+BuildRequires: gcc-c++
+Requires: pgadmin4-web-v%{pgAdmin4_release}
+%if 0%{?fedora}
+BuildRequires: qt5-qtbase-devel >= 5.1
+BuildRequires: qt5-qtwebkit-devel
+%define QMAKE /usr/bin/qmake-qt5
+%else
+BuildRequires: qt-devel >= 4.6
+BuildRequires: qtwebkit-devel
+%define QMAKE /usr/lib64/qt4/bin/qmake
+%endif
+
+%if 0%{?fedora}
+BuildRequires: python3-devel
+Requires: python >= 3.3
+%else
+BuildRequires: python-devel
+Requires: python >= 2.6
+%endif
+
+%if 0%{?fedora}
+Requires: qt >= 5.1
+%else
+Requires: qt >= 4.6
+%endif
+
+%description
+pgAdmin 4 is a rewrite of the popular pgAdmin3 management tool for the PostgreSQL (http://www.postgresql.org) database.
+pgAdmin 4 is being written as a web application in Python, using jQuery and
+Bootstrap for the client side processing and UI. On the server side, Flask is
+being utilised.
+
+Although developed using web technologies, we intend for pgAdmin 4 to be usable
+either on a web server using a browser, or standalone on a workstation. The
+runtime/ subdirectory contains a QT based runtime application intended to allow
+this - it is essentially a browser and Python interpretor in one package which
+will be capable of hosting the Python application and presenting it to the user
+as a desktop application.
+
+%package docs
+Summary: Documentation for pgAdmin4
+Group: Applications/Databases
+# These are required for -docs subpackage:
+%if 0%{?fedora}
+BuildRequires: python3-sphinx
+BuildRequires: python3-sphinx_rtd_theme
+%else
+BuildRequires: python-sphinx
+BuildRequires: python-sphinx_rtd_theme
+%endif
+
+%description docs
+This package contains documentation for various languages,
+which are in html format.
+
+%package web
+Summary: pgAdmin4 web package
+BuildArch: noarch
+Requires: pgadmin4-doc-v%{pgAdmin4_release}
+%if 0%{?fedora}
+Requires: python3-babel
+Requires: python3-flask
+Requires: python3-flask-sqlalchemy
+Requires: python3-flask-wtf
+Requires: python3-jinja2
+Requires: python3-markupsafe
+Requires: python3-sqlalchemy
+Requires: python3-wtforms
+Requires: python3-beautifulsoup4
+Requires: python3-blinker
+Requires: python3-html5lib
+Requires: python3-itsdangerous
+Requires: python3-psycopg2
+Requires: python3-six
+Requires: python3-crypto
+Requires: python3-simplejson
+Requires: python3-dateutil
+Requires: python3-werkzeug
+Requires: python3-sqlparse
+Requires: python3-sqlparse
+Requires: python3-docutils
+Requires: python3-extras
+Requires: python3-fixtures
+Requires: python3-linecache2
+Requires: python3-pbr
+Requires: python3-pygments
+Requires: python3-mimeparse
+Requires: python3-snowballstemmer
+Requires: python3-testscenarios
+Requires: python3-testtools
+Requires: python3-traceback2
+Requires: python3-unittest2
+Requires: python3-wheel
+Requires: python3-sphinx-theme-alabaster
+#Requires: python3-pyrsistent
+#Requires: python3-flask-babel
+#Requires: python3-speaklater
+#Requires: python3-passlib
+#Requires: python3-flask-gravatar
+#Requires: python3-flask-mail
+#Requires: python3-flask-security
+#Requires: python3-flask-login
+#Requires: python3-flask-principal
+#Requires: python3-django-htmlmin
+%else
+Requires: python-babel
+Requires: python-flask
+Requires: python-flask-sqlalchemy
+Requires: python-flask-wtf
+Requires: python-jinja2
+Requires: python-markupsafe
+Requires: python-sqlalchemy
+Requires: python-wtforms
+Requires: python-beautifulsoup4
+Requires: python-blinker
+Requires: python-html5lib
+Requires: python-itsdangerous
+Requires: python-psycopg2
+Requires: python-six
+Requires: python-crypto
+Requires: python-simplejson
+Requires: python-dateutil
+Requires: python-werkzeug
+Requires: pytz
+Requires: python-sqlparse
+Requires: python-sqlparse
+Requires: python-docutils
+Requires: python-extras
+Requires: python-fixtures
+Requires: python-linecache2
+Requires: python-pbr
+Requires: python-pygments
+Requires: python-mimeparse
+Requires: python-snowballstemmer
+Requires: python-testscenarios
+Requires: python-testtools
+Requires: python-traceback2
+Requires: python-unittest2
+#Requires: python-pyrsistent
+#Requires: python-flask-babel
+#Requires: python-speaklater
+#Requires: python-passlib
+#Requires: python-flask-gravatar
+#Requires: python-flask-mail
+#Requires: python-flask-security
+#Requires: python-flask-login
+#Requires: python-flask-principal
+#Requires: python-django-htmlmin
+#Requires: python-importlib
+%endif
+
+%if 0%{?fedora}
+%define PYTHON_SITELIB %{python3_sitelib}
+%else
+%define PYTHON_SITELIB %{python2_sitelib}
+%endif
+
+%description web
+This package contains the required files to run pgAdmin4 as a web application
+
+%prep
+%setup -n pgadmin4/runtime
+
+%build
+cd ../runtime
+%{QMAKE} -o Makefile pgAdmin4.pro
+make
+cd ..
+LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 make -C docs/en_US -f Makefile.sphinx html
+#chrpath -d pgAdmin4
+
+%install
+rm -rf %{buildroot}
+cd ..
+install -d -m 755 %{buildroot}/%{_docdir}/pgadmin4-docs-v%{pgAdmin4_release}
+cp -r docs/en_US/_build/html %{buildroot}/%{_docdir}/pgadmin4-docs-v%{pgAdmin4_release}
+
+cd runtime
+install -d -m 755 %{buildroot}%{pgadmin4instdir}/runtime
+cp pgAdmin4 %{buildroot}%{pgadmin4instdir}/runtime
+
+install -d -m 755 %{buildroot}%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+cp -pR ../web/* %{buildroot}%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+cd %{buildroot}%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+rm -f pgadmin4.db config_local.* config*.pyc
+echo "SERVER_MODE = False" > config_local.py
+echo "MINIFY_HTML = False" >> config_local.py
+echo "HTML_HELP = '%{_docdir}/pgadmin4-doc-v1/html/'" >> config_local.py
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{pgadmin4instdir}/runtime/pgAdmin4
+
+%files web
+%defattr(-,root,root,-)
+%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+%doc
+
+%files docs
+%defattr(-,root,root)
+%{_docdir}/pgadmin4-docs-v%{pgAdmin4_release}
+
+%changelog
+* Fri Jun 03 2016 Sandeep Thakkar <[email protected]>
+- Initial RPM for v1.0alpha1
+
diff --git a/pkg/rpm/f-24/Makefile b/pkg/rpm/f-24/Makefile
new file mode 100644
index 0000000..f48f68d
--- /dev/null
+++ b/pkg/rpm/f-24/Makefile
@@ -0,0 +1,8 @@
+
+ARCH=`rpm --eval "%{_arch}"`
+DIR=`pwd`
+DIST=.f24
+SPECFILE="pgadmin4.spec"
+
+# Now, include global Makefile
+include ../common/Makefile.global
diff --git a/pkg/rpm/f-24/pgadmin4.spec.in b/pkg/rpm/f-24/pgadmin4.spec.in
new file mode 100644
index 0000000..3e58b9d
--- /dev/null
+++ b/pkg/rpm/f-24/pgadmin4.spec.in
@@ -0,0 +1,231 @@
+
+%define pgAdmin4_release APP_REL
+%define pgAdmin4_revision APP_REV
+
+%define name APP_NAME
+%define pgadmin4instdir /usr/%{name}-v%{pgAdmin4_release}
+%define pgadmin4_webinstdir %{name}-web-v%{pgAdmin4_release}
+
+Name: %{name}
+Version: %{pgAdmin4_release}.%{pgAdmin4_revision}
+Release: 1%{?dist}
+Summary: pgAdmin 4 is a rewrite of the popular pgAdmin3 management tool for the PostgreSQL (http://www.postgresql.org) database.
+
+Group: Applications/Databases
+License: PostgreSQL License
+URL: http://www.pgadmin.org
+Source0: http://bugatti.pn.in.enterprisedb.com/temp/pgadmin4/pgadmin4-v%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildArch: DISTRO_ARCH
+
+BuildRequires: mesa-libGL-devel
+BuildRequires: gcc-c++
+Requires: pgadmin4-web-v%{pgAdmin4_release}
+%if 0%{?fedora}
+BuildRequires: qt5-qtbase-devel >= 5.1
+BuildRequires: qt5-qtwebkit-devel
+%define QMAKE /usr/bin/qmake-qt5
+%else
+BuildRequires: qt-devel >= 4.6
+BuildRequires: qtwebkit-devel
+%define QMAKE /usr/lib64/qt4/bin/qmake
+%endif
+
+%if 0%{?fedora}
+BuildRequires: python3-devel
+Requires: python >= 3.3
+%else
+BuildRequires: python-devel
+Requires: python >= 2.6
+%endif
+
+%if 0%{?fedora}
+Requires: qt >= 5.1
+%else
+Requires: qt >= 4.6
+%endif
+
+%description
+pgAdmin 4 is a rewrite of the popular pgAdmin3 management tool for the PostgreSQL (http://www.postgresql.org) database.
+pgAdmin 4 is being written as a web application in Python, using jQuery and
+Bootstrap for the client side processing and UI. On the server side, Flask is
+being utilised.
+
+Although developed using web technologies, we intend for pgAdmin 4 to be usable
+either on a web server using a browser, or standalone on a workstation. The
+runtime/ subdirectory contains a QT based runtime application intended to allow
+this - it is essentially a browser and Python interpretor in one package which
+will be capable of hosting the Python application and presenting it to the user
+as a desktop application.
+
+%package docs
+Summary: Documentation for pgAdmin4
+Group: Applications/Databases
+# These are required for -docs subpackage:
+%if 0%{?fedora}
+BuildRequires: python3-sphinx
+BuildRequires: python3-sphinx_rtd_theme
+%else
+BuildRequires: python-sphinx
+BuildRequires: python-sphinx_rtd_theme
+%endif
+
+%description docs
+This package contains documentation for various languages,
+which are in html format.
+
+%package web
+Summary: pgAdmin4 web package
+BuildArch: noarch
+Requires: pgadmin4-doc-v%{pgAdmin4_release}
+%if 0%{?fedora}
+Requires: python3-babel
+Requires: python3-flask
+Requires: python3-flask-sqlalchemy
+Requires: python3-flask-wtf
+Requires: python3-jinja2
+Requires: python3-markupsafe
+Requires: python3-sqlalchemy
+Requires: python3-wtforms
+Requires: python3-beautifulsoup4
+Requires: python3-blinker
+Requires: python3-html5lib
+Requires: python3-itsdangerous
+Requires: python3-psycopg2
+Requires: python3-six
+Requires: python3-crypto
+Requires: python3-simplejson
+Requires: python3-dateutil
+Requires: python3-werkzeug
+Requires: python3-sqlparse
+Requires: python3-sqlparse
+Requires: python3-docutils
+Requires: python3-extras
+Requires: python3-fixtures
+Requires: python3-linecache2
+Requires: python3-pbr
+Requires: python3-pygments
+Requires: python3-mimeparse
+Requires: python3-snowballstemmer
+Requires: python3-testscenarios
+Requires: python3-testtools
+Requires: python3-traceback2
+Requires: python3-unittest2
+Requires: python3-wheel
+Requires: python3-sphinx-theme-alabaster
+#Requires: python3-pyrsistent
+#Requires: python3-flask-babel
+#Requires: python3-speaklater
+#Requires: python3-passlib
+#Requires: python3-flask-gravatar
+#Requires: python3-flask-mail
+#Requires: python3-flask-security
+#Requires: python3-flask-login
+#Requires: python3-flask-principal
+#Requires: python3-django-htmlmin
+%else
+Requires: python-babel
+Requires: python-flask
+Requires: python-flask-sqlalchemy
+Requires: python-flask-wtf
+Requires: python-jinja2
+Requires: python-markupsafe
+Requires: python-sqlalchemy
+Requires: python-wtforms
+Requires: python-beautifulsoup4
+Requires: python-blinker
+Requires: python-html5lib
+Requires: python-itsdangerous
+Requires: python-psycopg2
+Requires: python-six
+Requires: python-crypto
+Requires: python-simplejson
+Requires: python-dateutil
+Requires: python-werkzeug
+Requires: pytz
+Requires: python-sqlparse
+Requires: python-sqlparse
+Requires: python-docutils
+Requires: python-extras
+Requires: python-fixtures
+Requires: python-linecache2
+Requires: python-pbr
+Requires: python-pygments
+Requires: python-mimeparse
+Requires: python-snowballstemmer
+Requires: python-testscenarios
+Requires: python-testtools
+Requires: python-traceback2
+Requires: python-unittest2
+#Requires: python-pyrsistent
+#Requires: python-flask-babel
+#Requires: python-speaklater
+#Requires: python-passlib
+#Requires: python-flask-gravatar
+#Requires: python-flask-mail
+#Requires: python-flask-security
+#Requires: python-flask-login
+#Requires: python-flask-principal
+#Requires: python-django-htmlmin
+#Requires: python-importlib
+%endif
+
+%if 0%{?fedora}
+%define PYTHON_SITELIB %{python3_sitelib}
+%else
+%define PYTHON_SITELIB %{python2_sitelib}
+%endif
+
+%description web
+This package contains the required files to run pgAdmin4 as a web application
+
+%prep
+%setup -n pgadmin4/runtime
+
+%build
+cd ../runtime
+%{QMAKE} -o Makefile pgAdmin4.pro
+make
+cd ..
+LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 make -C docs/en_US -f Makefile.sphinx html
+#chrpath -d pgAdmin4
+
+%install
+rm -rf %{buildroot}
+cd ..
+install -d -m 755 %{buildroot}/%{_docdir}/pgadmin4-docs-v%{pgAdmin4_release}
+cp -r docs/en_US/_build/html %{buildroot}/%{_docdir}/pgadmin4-docs-v%{pgAdmin4_release}
+
+cd runtime
+install -d -m 755 %{buildroot}%{pgadmin4instdir}/runtime
+cp pgAdmin4 %{buildroot}%{pgadmin4instdir}/runtime
+
+install -d -m 755 %{buildroot}%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+cp -pR ../web/* %{buildroot}%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+cd %{buildroot}%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+rm -f pgadmin4.db config_local.* config*.pyc
+echo "SERVER_MODE = False" > config_local.py
+echo "MINIFY_HTML = False" >> config_local.py
+echo "HTML_HELP = '%{_docdir}/pgadmin4-doc-v1/html/'" >> config_local.py
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{pgadmin4instdir}/runtime/pgAdmin4
+
+%files web
+%defattr(-,root,root,-)
+%{PYTHON_SITELIB}/%{pgadmin4_webinstdir}
+%doc
+
+%files docs
+%defattr(-,root,root)
+%{_docdir}/pgadmin4-docs-v%{pgAdmin4_release}
+
+%changelog
+* Fri Jun 03 2016 Sandeep Thakkar <[email protected]>
+- Initial RPM for v1.0alpha1
+
diff --git a/runtime/Server.cpp b/runtime/Server.cpp
index 8691224..d095d93 100644
--- a/runtime/Server.cpp
+++ b/runtime/Server.cpp
@@ -23,7 +23,7 @@
#include "Server.h"
Server::Server(quint16 port)
-{
+{
// Appserver port
m_port = port;
m_wcAppName = NULL;
@@ -47,6 +47,18 @@ Server::Server(quint16 port)
// Setup the search path
QSettings settings;
QString python_path = settings.value("PythonPath").toString();
+#ifdef Q_OS_MAC
+ QString app_dir = qApp->applicationDirPath();
+ QString get_pymodules_path = (app_dir + "/../Resources/venv/lib/python/site-packages");
+ QFileInfo fi(get_pymodules_path);
+ QString pymodules_path = fi.canonicalFilePath();
+ if (!python_path.contains(pymodules_path))
+ {
+ python_path.prepend(pymodules_path); // Mac source tree (in a release app bundle)
+ settings.setValue("PythonPath", pymodules_path);
+ settings.sync();
+ }
+#endif
if (python_path.length() > 0)
{
@@ -66,6 +78,8 @@ Server::Server(quint16 port)
#endif
}
}
+ python_path = settings.value("PythonPath").toString();
+ qDebug() << "Python path: " << python_path;
}
Server::~Server()
@@ -80,13 +94,26 @@ Server::~Server()
bool Server::Init()
{
QSettings settings;
+#ifdef Q_OS_LINUX
+ QProcess process;
+ process.start("python -c \"from distutils.sysconfig import get_python_lib; print(get_python_lib())\"");
+ process.waitForFinished(-1);
+ QString pymodules_path = process.readAllStandardOutput();
+ pymodules_path = pymodules_path.trimmed();
+ webapp_path = pymodules_path + "/pgadmin4-web-v1";
+#endif
// Find the webapp
QStringList paths;
paths.append("../web/"); // Linux source tree
paths.append("../../web/"); // Windows source tree
paths.append("../../../../web/"); // Mac source tree (in a dev env)
+#ifdef Q_OS_MAC
paths.append("../Resources/web/"); // Mac source tree (in a release app bundle)
+#endif
+#ifdef Q_OS_LINUX
+ paths.append(webapp_path); // Linux (in a release rpm)
+#endif
paths.append(settings.value("ApplicationPath").toString()); // System configured value
paths.append(""); // Should be last!
view thread (21+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Patch for pgAdmin4 RPM package
In-Reply-To: <CANFyU97jFmRRvF9y9JHOVQCJSd1pJiY1YEvKPpDfZbbwCJ-YmA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox