public inbox for [email protected]
help / color / mirror / Atom feedFrom: Sandeep Thakkar <[email protected]>
To: pgadmin-hackers <[email protected]>
To: Dave Page <[email protected]>
Cc: Hamid Quddus <[email protected]>
Subject: Patch for pgAdmin4 RPM package
Date: Fri, 22 Apr 2016 16:27:48 +0530
Message-ID: <CANFyU96tOSdX00+ZjUZ++wF9qzLt9UE_YdKjDWVzHGik+5kB4w@mail.gmail.com> (raw)
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgadmin-hackers>
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.
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
*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.
Another change that I did in this file is that, I observed that canonicalPath()
was not giving the absolute path (by removing the sym link and the
redundant ".." as per doc). Hence, I used absolutePath() for the paths[i]
that are relative (../web, etc) and not for the already absolute path (ex.
ApplicationPath like /usr/lib/python2.7/site-packages/pgadmin4-web).
Well, I'm not a developer and the patch is just an attempt to resolve the
issue related to packaging. Please feel free to change it as required for
better.
Thanks.
--
Sandeep Thakkar
Lead Software Engineer
Phone: +91.20.30589505
Website: www.enterprisedb.com
EnterpriseDB Blog: http://blogs.enterprisedb.com/
Follow us on Twitter: http://www.twitter.com/enterprisedb
This e-mail message (and any attachment) is intended for the use of the
individual or entity to whom it is addressed. This message contains
information from EnterpriseDB Corporation that may be privileged,
confidential, or exempt from disclosure under applicable law. If you are
not the intended recipient or authorized to receive this for the intended
recipient, any use, dissemination, distribution, retention, archiving, or
copying of this communication is strictly prohibited. If you have received
this e-mail in error, please notify the sender immediately by reply e-mail
and delete this message.
--
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] pgadmin4-rpm.patch (30.7K, 3-pgadmin4-rpm.patch)
download | inline diff:
diff --git a/build-rpm.sh b/build-rpm.sh
new file mode 100755
index 0000000..8128507
--- /dev/null
+++ b/build-rpm.sh
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+#Script to create the pgAdmin4 RPMs.
+
+#Color schemes
+red=`tput setaf 1`
+green=`tput setaf 2`
+blue=`tput setaf 4`
+reset=`tput sgr0`
+
+# Check whether lsb_release exists or not:
+if [ ! -f /usr/bin/lsb_release ]
+then
+ echo
+ echo "${red}ERROR:${reset} lsb_release command does not exist. Please install it with"
+ echo
+ echo "${blue} yum -y install redhat-lsb-core"
+ echo
+ echo "${red}Exiting...${reset}"
+ 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
+
+# Find the pgAdmin4 version
+pgAdmin4_major=`awk '/APP_MAJOR =/ {print $3}' ./web/config.py`
+pgAdmin4_minor=`awk '/APP_MINOR =/ {print $3}' ./web/config.py`
+pgAdmin4_revision=`awk '/APP_REVISION =/ {print $3}' ./web/config.py`
+pgAdmin4_suffix=`awk '/APP_SUFFIX =/ {print $3}' ./web/config.py | sed "s/'//g"`
+
+# If suffix is defined
+if [ ! -z "$pgAdmin4_suffix" ]; then
+ pgAdmin4_suffix="${pgAdmin4_suffix}." #hyphen not allowed in SPEC for version
+fi
+
+# Is the OS version supported?
+if [ ! -d ./pkg/rpm/$pkg_dir ]; then
+ echo "./pkg/rpm/$pkg_dir does not exist"
+ exit 1
+fi
+
+cd ./pkg/rpm/$pkg_dir
+
+# Replace the placeholders in the spec
+sed -e "s/PGADMIN_MAJOR/$pgAdmin4_major/" \
+ -e "s/PGADMIN_MINOR/$pgAdmin4_minor/" \
+ -e "s/PGADMIN_REV/$pgAdmin4_revision/" \
+ -e "s/PGADMIN_SUFFIX/$pgAdmin4_suffix/" \
+ -e "s/DISTRO_ARCH/$distro_arch/" pgadmin4.spec.in > pgadmin4.spec
+
+make rpm
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..f41e373
--- /dev/null
+++ b/pkg/rpm/EL-6/pgadmin4.spec.in
@@ -0,0 +1,175 @@
+
+%define pgadmin4_major PGADMIN_MAJOR
+%define pgadmin4_minor PGADMIN_MINOR
+%define pgadmin4_revision PGADMIN_REV
+
+%define name pgadmin4
+%define pgadmin4instdir /usr/%{name}-%{pgadmin4_major}.%{pgadmin4_minor}
+
+Name: %{name}
+Version: %{pgadmin4_major}.%{pgadmin4_minor}.%{pgadmin4_revision}
+Release: PGADMIN_SUFFIX1%{?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: pgadmin4-%{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
+%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 -n pgadmin4-web
+Summary: pgAdmin4 web package
+BuildArch: noarch
+#%if 0%{?fedora} >= 23
+%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-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-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-argparse
+#Requires: python-importlib
+#Requires: python-wsgiref
+%endif
+
+%if 0%{?fedora}
+%define PYTHON_SITELIB %{python3_sitelib}
+%else
+%define PYTHON_SITELIB %{python2_sitelib}
+%endif
+
+%description -n pgadmin4-web
+This package contains the required files to run pgAdmin4 as a web application
+
+%prep
+%setup -n pgadmin4/runtime
+
+%build
+cd ../web
+sed -e 's/SERVER_MODE = True/SERVER_MODE = False/' config.py > config_local.py
+cd ../runtime
+%{QMAKE} -o Makefile pgAdmin4.pro
+make
+
+%install
+rm -rf %{buildroot}
+install -d -m 755 %{buildroot}%{pgadmin4instdir}/runtime
+cp pgAdmin4 %{buildroot}%{pgadmin4instdir}/runtime
+install -d -m 755 %{buildroot}%{PYTHON_SITELIB}/pgadmin4-web
+cp -pR ../web/* %{buildroot}%{PYTHON_SITELIB}/pgadmin4-web
+echo "
+[General]
+ApplicationPath=%{PYTHON_SITELIB}/pgadmin4-web
+PythonPath=
+" > %{buildroot}%{pgadmin4instdir}/runtime/pgadmin4.ini
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{pgadmin4instdir}/runtime/pgAdmin4
+%{pgadmin4instdir}/runtime/pgadmin4.ini
+
+%files -n pgadmin4-web
+%defattr(-,root,root,-)
+%{PYTHON_SITELIB}/pgadmin4-web
+%doc
+
+%changelog
+* Fri Apr 22 2016 Sandeep Thakkar <[email protected]> 1.0.0-1
+- Initial version
+
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..f41e373
--- /dev/null
+++ b/pkg/rpm/EL-7/pgadmin4.spec.in
@@ -0,0 +1,175 @@
+
+%define pgadmin4_major PGADMIN_MAJOR
+%define pgadmin4_minor PGADMIN_MINOR
+%define pgadmin4_revision PGADMIN_REV
+
+%define name pgadmin4
+%define pgadmin4instdir /usr/%{name}-%{pgadmin4_major}.%{pgadmin4_minor}
+
+Name: %{name}
+Version: %{pgadmin4_major}.%{pgadmin4_minor}.%{pgadmin4_revision}
+Release: PGADMIN_SUFFIX1%{?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: pgadmin4-%{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
+%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 -n pgadmin4-web
+Summary: pgAdmin4 web package
+BuildArch: noarch
+#%if 0%{?fedora} >= 23
+%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-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-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-argparse
+#Requires: python-importlib
+#Requires: python-wsgiref
+%endif
+
+%if 0%{?fedora}
+%define PYTHON_SITELIB %{python3_sitelib}
+%else
+%define PYTHON_SITELIB %{python2_sitelib}
+%endif
+
+%description -n pgadmin4-web
+This package contains the required files to run pgAdmin4 as a web application
+
+%prep
+%setup -n pgadmin4/runtime
+
+%build
+cd ../web
+sed -e 's/SERVER_MODE = True/SERVER_MODE = False/' config.py > config_local.py
+cd ../runtime
+%{QMAKE} -o Makefile pgAdmin4.pro
+make
+
+%install
+rm -rf %{buildroot}
+install -d -m 755 %{buildroot}%{pgadmin4instdir}/runtime
+cp pgAdmin4 %{buildroot}%{pgadmin4instdir}/runtime
+install -d -m 755 %{buildroot}%{PYTHON_SITELIB}/pgadmin4-web
+cp -pR ../web/* %{buildroot}%{PYTHON_SITELIB}/pgadmin4-web
+echo "
+[General]
+ApplicationPath=%{PYTHON_SITELIB}/pgadmin4-web
+PythonPath=
+" > %{buildroot}%{pgadmin4instdir}/runtime/pgadmin4.ini
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{pgadmin4instdir}/runtime/pgAdmin4
+%{pgadmin4instdir}/runtime/pgadmin4.ini
+
+%files -n pgadmin4-web
+%defattr(-,root,root,-)
+%{PYTHON_SITELIB}/pgadmin4-web
+%doc
+
+%changelog
+* Fri Apr 22 2016 Sandeep Thakkar <[email protected]> 1.0.0-1
+- Initial version
+
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..f41e373
--- /dev/null
+++ b/pkg/rpm/F-22/pgadmin4.spec.in
@@ -0,0 +1,175 @@
+
+%define pgadmin4_major PGADMIN_MAJOR
+%define pgadmin4_minor PGADMIN_MINOR
+%define pgadmin4_revision PGADMIN_REV
+
+%define name pgadmin4
+%define pgadmin4instdir /usr/%{name}-%{pgadmin4_major}.%{pgadmin4_minor}
+
+Name: %{name}
+Version: %{pgadmin4_major}.%{pgadmin4_minor}.%{pgadmin4_revision}
+Release: PGADMIN_SUFFIX1%{?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: pgadmin4-%{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
+%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 -n pgadmin4-web
+Summary: pgAdmin4 web package
+BuildArch: noarch
+#%if 0%{?fedora} >= 23
+%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-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-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-argparse
+#Requires: python-importlib
+#Requires: python-wsgiref
+%endif
+
+%if 0%{?fedora}
+%define PYTHON_SITELIB %{python3_sitelib}
+%else
+%define PYTHON_SITELIB %{python2_sitelib}
+%endif
+
+%description -n pgadmin4-web
+This package contains the required files to run pgAdmin4 as a web application
+
+%prep
+%setup -n pgadmin4/runtime
+
+%build
+cd ../web
+sed -e 's/SERVER_MODE = True/SERVER_MODE = False/' config.py > config_local.py
+cd ../runtime
+%{QMAKE} -o Makefile pgAdmin4.pro
+make
+
+%install
+rm -rf %{buildroot}
+install -d -m 755 %{buildroot}%{pgadmin4instdir}/runtime
+cp pgAdmin4 %{buildroot}%{pgadmin4instdir}/runtime
+install -d -m 755 %{buildroot}%{PYTHON_SITELIB}/pgadmin4-web
+cp -pR ../web/* %{buildroot}%{PYTHON_SITELIB}/pgadmin4-web
+echo "
+[General]
+ApplicationPath=%{PYTHON_SITELIB}/pgadmin4-web
+PythonPath=
+" > %{buildroot}%{pgadmin4instdir}/runtime/pgadmin4.ini
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{pgadmin4instdir}/runtime/pgAdmin4
+%{pgadmin4instdir}/runtime/pgadmin4.ini
+
+%files -n pgadmin4-web
+%defattr(-,root,root,-)
+%{PYTHON_SITELIB}/pgadmin4-web
+%doc
+
+%changelog
+* Fri Apr 22 2016 Sandeep Thakkar <[email protected]> 1.0.0-1
+- Initial version
+
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..f41e373
--- /dev/null
+++ b/pkg/rpm/F-23/pgadmin4.spec.in
@@ -0,0 +1,175 @@
+
+%define pgadmin4_major PGADMIN_MAJOR
+%define pgadmin4_minor PGADMIN_MINOR
+%define pgadmin4_revision PGADMIN_REV
+
+%define name pgadmin4
+%define pgadmin4instdir /usr/%{name}-%{pgadmin4_major}.%{pgadmin4_minor}
+
+Name: %{name}
+Version: %{pgadmin4_major}.%{pgadmin4_minor}.%{pgadmin4_revision}
+Release: PGADMIN_SUFFIX1%{?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: pgadmin4-%{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
+%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 -n pgadmin4-web
+Summary: pgAdmin4 web package
+BuildArch: noarch
+#%if 0%{?fedora} >= 23
+%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-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-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-argparse
+#Requires: python-importlib
+#Requires: python-wsgiref
+%endif
+
+%if 0%{?fedora}
+%define PYTHON_SITELIB %{python3_sitelib}
+%else
+%define PYTHON_SITELIB %{python2_sitelib}
+%endif
+
+%description -n pgadmin4-web
+This package contains the required files to run pgAdmin4 as a web application
+
+%prep
+%setup -n pgadmin4/runtime
+
+%build
+cd ../web
+sed -e 's/SERVER_MODE = True/SERVER_MODE = False/' config.py > config_local.py
+cd ../runtime
+%{QMAKE} -o Makefile pgAdmin4.pro
+make
+
+%install
+rm -rf %{buildroot}
+install -d -m 755 %{buildroot}%{pgadmin4instdir}/runtime
+cp pgAdmin4 %{buildroot}%{pgadmin4instdir}/runtime
+install -d -m 755 %{buildroot}%{PYTHON_SITELIB}/pgadmin4-web
+cp -pR ../web/* %{buildroot}%{PYTHON_SITELIB}/pgadmin4-web
+echo "
+[General]
+ApplicationPath=%{PYTHON_SITELIB}/pgadmin4-web
+PythonPath=
+" > %{buildroot}%{pgadmin4instdir}/runtime/pgadmin4.ini
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{pgadmin4instdir}/runtime/pgAdmin4
+%{pgadmin4instdir}/runtime/pgadmin4.ini
+
+%files -n pgadmin4-web
+%defattr(-,root,root,-)
+%{PYTHON_SITELIB}/pgadmin4-web
+%doc
+
+%changelog
+* Fri Apr 22 2016 Sandeep Thakkar <[email protected]> 1.0.0-1
+- Initial version
+
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..f41e373
--- /dev/null
+++ b/pkg/rpm/F-24/pgadmin4.spec.in
@@ -0,0 +1,175 @@
+
+%define pgadmin4_major PGADMIN_MAJOR
+%define pgadmin4_minor PGADMIN_MINOR
+%define pgadmin4_revision PGADMIN_REV
+
+%define name pgadmin4
+%define pgadmin4instdir /usr/%{name}-%{pgadmin4_major}.%{pgadmin4_minor}
+
+Name: %{name}
+Version: %{pgadmin4_major}.%{pgadmin4_minor}.%{pgadmin4_revision}
+Release: PGADMIN_SUFFIX1%{?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: pgadmin4-%{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
+%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 -n pgadmin4-web
+Summary: pgAdmin4 web package
+BuildArch: noarch
+#%if 0%{?fedora} >= 23
+%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-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-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-argparse
+#Requires: python-importlib
+#Requires: python-wsgiref
+%endif
+
+%if 0%{?fedora}
+%define PYTHON_SITELIB %{python3_sitelib}
+%else
+%define PYTHON_SITELIB %{python2_sitelib}
+%endif
+
+%description -n pgadmin4-web
+This package contains the required files to run pgAdmin4 as a web application
+
+%prep
+%setup -n pgadmin4/runtime
+
+%build
+cd ../web
+sed -e 's/SERVER_MODE = True/SERVER_MODE = False/' config.py > config_local.py
+cd ../runtime
+%{QMAKE} -o Makefile pgAdmin4.pro
+make
+
+%install
+rm -rf %{buildroot}
+install -d -m 755 %{buildroot}%{pgadmin4instdir}/runtime
+cp pgAdmin4 %{buildroot}%{pgadmin4instdir}/runtime
+install -d -m 755 %{buildroot}%{PYTHON_SITELIB}/pgadmin4-web
+cp -pR ../web/* %{buildroot}%{PYTHON_SITELIB}/pgadmin4-web
+echo "
+[General]
+ApplicationPath=%{PYTHON_SITELIB}/pgadmin4-web
+PythonPath=
+" > %{buildroot}%{pgadmin4instdir}/runtime/pgadmin4.ini
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{pgadmin4instdir}/runtime/pgAdmin4
+%{pgadmin4instdir}/runtime/pgadmin4.ini
+
+%files -n pgadmin4-web
+%defattr(-,root,root,-)
+%{PYTHON_SITELIB}/pgadmin4-web
+%doc
+
+%changelog
+* Fri Apr 22 2016 Sandeep Thakkar <[email protected]> 1.0.0-1
+- Initial version
+
diff --git a/pkg/rpm/README b/pkg/rpm/README
new file mode 100644
index 0000000..8f332b8
--- /dev/null
+++ b/pkg/rpm/README
@@ -0,0 +1,5 @@
+# Instructions on how to build RPMs for pgadmin4
+
+Go to pgAdmin4 root directory and run build-rpm.sh. This will compile
+the sources and create the RPMS for your OS in pkg/rpm/EL-6|EL-7|F-22|F-23
+for web and runtime.
diff --git a/pkg/rpm/common/Makefile.global b/pkg/rpm/common/Makefile.global
new file mode 100644
index 0000000..3f9e9b2
--- /dev/null
+++ b/pkg/rpm/common/Makefile.global
@@ -0,0 +1,21 @@
+
+prep:
+ # Update spec file, patches, etc, before running spectool:
+ git pull
+ # Use spectool to download source files, especially tarballs.
+ spectool -g -S $(SPECFILE)
+
+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 $(PWD)" \
+ --define "_specdir $(PWD)" \
+ --define "_builddir $(PWD)" \
+ --define "_rpmdir $(PWD)" \
+ --define "dist $(DIST)" -bb $(SPECFILE)
[application/octet-stream] pgadmin4-server-ini.patch (983B, 4-pgadmin4-server-ini.patch)
download | inline diff:
diff --git a/runtime/Server.cpp b/runtime/Server.cpp
index 7730184..e7964a7 100644
--- a/runtime/Server.cpp
+++ b/runtime/Server.cpp
@@ -79,7 +79,8 @@ Server::~Server()
bool Server::Init()
{
- QSettings settings;
+ //QSettings settings;
+ QSettings settings(QCoreApplication::applicationDirPath() + "/pgadmin4.ini", QSettings::IniFormat);
// Find the webapp
QStringList paths;
@@ -92,7 +93,15 @@ bool Server::Init()
for (int i = 0; i < paths.size(); ++i)
{
QDir dir(QCoreApplication::applicationDirPath() + "/" + paths[i]);
- m_appfile = dir.canonicalPath() + "/pgAdmin4.py";
+ QFileInfo info(paths[i]);
+ if (info.isRelative()) {
+ //m_appfile = dir.canonicalPath() + "/pgAdmin4.py";
+ m_appfile = dir.absolutePath() + "/pgAdmin4.py";
+ }
+ else {
+ m_appfile = paths[i] + "/pgAdmin4.py";
+ }
+ //qDebug() << "Webapp path: " << m_appfile;
if (QFile::exists(m_appfile))
{
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]
Subject: Re: Patch for pgAdmin4 RPM package
In-Reply-To: <CANFyU96tOSdX00+ZjUZ++wF9qzLt9UE_YdKjDWVzHGik+5kB4w@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