From 29c036b17490b30cac453262b9a9fb928ecb464b Mon Sep 17 00:00:00 2001 From: idriskalp Date: Wed, 25 Mar 2020 18:28:42 +0300 Subject: [PATCH] pgadmin4 add to repo --- util/admin/pgadmin3/actions.py | 32 ---- ...laced-unlock-of-s_currentObjectMutex.patch | 31 ---- util/admin/pgadmin3/files/pgadmin3.desktop | 11 -- util/admin/pgadmin3/pspec.xml | 81 ---------- util/admin/pgadmin3/translations.xml | 8 - util/admin/pgadmin4/actions.py | 85 +++++++++++ util/admin/pgadmin4/files/config_distro.py | 2 + util/admin/pgadmin4/files/pgAdmin4.desktop | 11 ++ util/admin/pgadmin4/files/pgadmin4 | 3 + ...pgadmin4-python-de-vendor-venv-paths.patch | 33 +++++ util/admin/pgadmin4/files/pgadmin4-server | 3 + util/admin/pgadmin4/files/python-3.8.patch | 12 ++ util/admin/pgadmin4/pspec.xml | 138 ++++++++++++++++++ 13 files changed, 287 insertions(+), 163 deletions(-) delete mode 100644 util/admin/pgadmin3/actions.py delete mode 100644 util/admin/pgadmin3/files/0001-Move-misplaced-unlock-of-s_currentObjectMutex.patch delete mode 100644 util/admin/pgadmin3/files/pgadmin3.desktop delete mode 100644 util/admin/pgadmin3/pspec.xml delete mode 100644 util/admin/pgadmin3/translations.xml create mode 100644 util/admin/pgadmin4/actions.py create mode 100644 util/admin/pgadmin4/files/config_distro.py create mode 100644 util/admin/pgadmin4/files/pgAdmin4.desktop create mode 100644 util/admin/pgadmin4/files/pgadmin4 create mode 100644 util/admin/pgadmin4/files/pgadmin4-python-de-vendor-venv-paths.patch create mode 100644 util/admin/pgadmin4/files/pgadmin4-server create mode 100644 util/admin/pgadmin4/files/python-3.8.patch create mode 100644 util/admin/pgadmin4/pspec.xml diff --git a/util/admin/pgadmin3/actions.py b/util/admin/pgadmin3/actions.py deleted file mode 100644 index 5370b774f9..0000000000 --- a/util/admin/pgadmin3/actions.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Licensed under the GNU General Public License, version 3. -# See the file http://www.gnu.org/copyleft/gpl.txt. - -from pisi.actionsapi import autotools -from pisi.actionsapi import shelltools -from pisi.actionsapi import pisitools -from pisi.actionsapi import get - -def setup(): - shelltools.system("sed -i -e 's/wx-config/wx-config-2.8/' configure") - shelltools.system("sed -i 's/wxrc/wxrc-2.8/g' stringextract pgadmin/ui/embed-xrc") - - shelltools.export("WX_CONFIG", "/usr/bin/wx-config-2.8 ") - shelltools.export("WXDIR", "/usr ") - - autotools.configure("--disable-static \ - --disable-debug \ - --with-wx=/usr \ - --disable-dependency-tracking \ - --with-wx-config=/usr/bin/wx-config-2.8 \ - --with-wx-version=2.8") - -def build(): - autotools.make() - -def install(): - autotools.rawInstall("DESTDIR=%s" % get.installDIR()) - - pisitools.insinto("/usr/share/pixmaps", "pkg/debian/pgadmin3.xpm") diff --git a/util/admin/pgadmin3/files/0001-Move-misplaced-unlock-of-s_currentObjectMutex.patch b/util/admin/pgadmin3/files/0001-Move-misplaced-unlock-of-s_currentObjectMutex.patch deleted file mode 100644 index 87445adf4e..0000000000 --- a/util/admin/pgadmin3/files/0001-Move-misplaced-unlock-of-s_currentObjectMutex.patch +++ /dev/null @@ -1,31 +0,0 @@ -From d17a268572648b8e45ba6dc5854549a1dbf81c0a Mon Sep 17 00:00:00 2001 -From: Wander Nauta -Date: Sun, 19 Apr 2015 16:37:41 +0200 -Subject: [PATCH] Move misplaced unlock of s_currentObjectMutex - -The current implementation would unlock the mutex, even if it didn't own -it. ---- - pgadmin/frm/events.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pgadmin/frm/events.cpp b/pgadmin/frm/events.cpp -index 4baaf42..f2ad570 100644 ---- a/pgadmin/frm/events.cpp -+++ b/pgadmin/frm/events.cpp -@@ -750,11 +750,11 @@ void frmMain::OnSelRightClick(wxTreeEvent &event) - // - s_currentObjectMutex.Lock(); - currentObject = browser->GetObject(item); -+ s_currentObjectMutex.Unlock(); - } - - if (currentObject) - doPopup(browser, event.GetPoint(), currentObject); -- s_currentObjectMutex.Unlock(); - } - - --- -2.3.5 - diff --git a/util/admin/pgadmin3/files/pgadmin3.desktop b/util/admin/pgadmin3/files/pgadmin3.desktop deleted file mode 100644 index 92b54602fe..0000000000 --- a/util/admin/pgadmin3/files/pgadmin3.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=pgadmin3 -Comment=Graphical client for PostgreSQL -Comment[tr]=PostgreSQL için grafiksel istemci -GenericName=PostgreSQL Tools -GenericName[tr]=PostgreSQL Yönetim Aracı -Exec=pgadmin3 -Icon=pgadmin3 -Type=Application -Categories=Application;Development; diff --git a/util/admin/pgadmin3/pspec.xml b/util/admin/pgadmin3/pspec.xml deleted file mode 100644 index 21aaabb04e..0000000000 --- a/util/admin/pgadmin3/pspec.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - pgadmin3 - http://www.pgadmin.org - - PisiLinux Community - admins@pisilinux.org - - BSD - app:gui - Graphical client for PostgreSQL - pgadmin3 is a powerful administration and development platform for the PostgreSQL database, free for any use. - https://ftp.postgresql.org/pub/pgadmin/pgadmin3/v1.22.2/src/pgadmin3-1.22.2.tar.gz - - postgresql-lib - libxslt-devel - openssl-devel - wxGTK2.8-devel - - - - - - - pgadmin3 - - postgresql-lib - libxslt - libgcc - zlib - libxml2 - openssl - wxGTK2.8 - wxBase - - - /usr/bin - /usr/share/pgadmin3 - /usr/share/applications - /usr/share/pixmaps - - - pgadmin3.desktop - - - - - - 2018-09-09 - 1.22.2 - Rebuild New T. - Mustafa Cinasal - muscnsl@gmail.com - - - 2017-01-25 - 1.22.2 - Version bump. - Stefan Gronewold - groni@pisilinux.org - - - 2016-06-08 - 1.22 - Release Bump - Pisi Linux Community - admin@pisilinux.org - - - 2016-02-26 - 1.22 - First release - Ertuğrul Erata - ertugrulerata@gmail.com - - - diff --git a/util/admin/pgadmin3/translations.xml b/util/admin/pgadmin3/translations.xml deleted file mode 100644 index 3a736b9516..0000000000 --- a/util/admin/pgadmin3/translations.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - pgadmin3 - PostgreSQL grafik arabirimi - wxGTK temelli PostgreSQL grafik arabirimi - - diff --git a/util/admin/pgadmin4/actions.py b/util/admin/pgadmin4/actions.py new file mode 100644 index 0000000000..5d6e91e72e --- /dev/null +++ b/util/admin/pgadmin4/actions.py @@ -0,0 +1,85 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 2 +# See the file http://www.gnu.org/copyleft/gpl.txt + +from pisi.actionsapi import get +from pisi.actionsapi import autotools +from pisi.actionsapi import pisitools +from pisi.actionsapi import shelltools + +def setup(): + # fixes build. so build uses python3 instead of python2 + pisitools.dosed("runtime/pgAdmin4.pro", "python-config", "python3-config") + # fixes import error while sphinx builds documentation + pisitools.dosed("web/pgadmin/browser/__init__.py", "_commit, default_render_json", "_commit, _render_json") + + shelltools.system(""" export PYTHONVERSION="$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')" """) + + shelltools.system(""" sed -E "s|/usr/pgadmin4/web|/usr/lib/pgadmin4/web|g; \ + s|/usr/pgadmin4/lib/python[0-9\\.]+|/usr/lib/python${PYTHONVERSION}|g" \ + -i runtime/ConfigWindow.ui """) + shelltools.system(""" sed "s|##PYTHONVERSION##|${PYTHONVERSION}|g" -i runtime/Server.cpp """) + + shelltools.system(" sed -E -i requirements.txt \ + -e '/blinker>?=/d' \ + -e '/extras>?=/d' \ + -e '/Flask>?=/d' \ + -e '/Flask-Login>?=/d' \ + -e '/Flask-Migrate>?=/d' \ + -e '/Flask-SQLAlchemy>?=/d' \ + -e '/Flask-WTF>?=/d' \ + -e '/pycrypto>?=/d' \ + -e '/passlib>?=/d' \ + -e '/pytz>?=/d' \ + -e '/simplejson>?=/d' \ + -e '/six>?=/d' \ + -e '/speaklater>?=/d' \ + -e '/sqlparse>?=/d' \ + -e '/WTForms>?=/d' \ + -e '/psutil>?=/d' \ + -e '/psycopg2>?=/d' \ + -e '/python-dateutil>?=/d' \ + -e '/SQLAlchemy>?=/d' \ + -e '/Flask-Gravatar>?=/d' \ + -e '/Flask-Mail>?=/d' \ + -e '/Flask-Principal>?=/d' \ + -e '/Flask-Paranoid>?=/d' \ + -e '/htmlmin>?=/d' \ + -e '/Flask-Security>?=/d' \ + -e '/Flask-HTMLmin>?=/d' \ + -e '/Flask-Compress>?=/d' \ + -e '/sshtunnel>?=/d' \ + -e '/Werkzeug>?=/d' ") + shelltools.system("cat requirements.txt") + + shelltools.export("LANG", "en_US.UTF-8") + shelltools.export(" LC_ALL", "en_US.UTF-8") + + pisitools.dosed("docs/en_US/Makefile.sphinx", "PYTHON = python", "PYTHON = python3") + + shelltools.cd("runtime") + shelltools.system("convert +set date:create +set date:modify pgAdmin4.ico pgAdmin4.png") + + shelltools.system("qmake CONFIG+=release") + +def build(): + autotools.make("docs") + shelltools.cd("runtime") + autotools.make() + +def install(): + pisitools.insinto("/usr/lib/pgadmin4/runtime", "runtime/pgAdmin4") + pisitools.insinto("/usr/lib/pgadmin4/web", "web/*") + pisitools.insinto("/usr/lib/pgadmin4/docs", "docs*") + pisitools.insinto("/usr/share/icons/hicolor/256x256/apps", "runtime/pgAdmin4-0.png", "pgAdmin4.png") + pisitools.insinto("/usr/share/icons/hicolor/48x48/apps", "runtime/pgAdmin4-1.png", "pgAdmin4.png") + pisitools.insinto("/usr/share/icons/hicolor/32x32/apps", "runtime/pgAdmin4-2.png", "pgAdmin4.png") + pisitools.insinto("/usr/share/icons/hicolor/16x16/apps", "runtime/pgAdmin4-3.png", "pgAdmin4.png") + + # add documentation + pisitools.dohtml("docs/en_US/_build/*") + + if get.buildTYPE() != "_emul32": + pisitools.dodoc("LICENSE", "README") diff --git a/util/admin/pgadmin4/files/config_distro.py b/util/admin/pgadmin4/files/config_distro.py new file mode 100644 index 0000000000..f5e13619c7 --- /dev/null +++ b/util/admin/pgadmin4/files/config_distro.py @@ -0,0 +1,2 @@ +SERVER_MODE = False +HELP_PATH = "/usr/lib/pgadmin4/docs/en_US/_build/html/" diff --git a/util/admin/pgadmin4/files/pgAdmin4.desktop b/util/admin/pgadmin4/files/pgAdmin4.desktop new file mode 100644 index 0000000000..2d3d45c0c1 --- /dev/null +++ b/util/admin/pgadmin4/files/pgAdmin4.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=pgAdmin 4 +Exec=/usr/lib/pgadmin4/runtime/pgAdmin4 +Icon=pgAdmin4 +Type=Application +Categories=Application;Development;Database; +MimeType=text/html +DocPath=/usr/lib/pgadmin4/docs/en_US/_build/html/index.html +Comment=PostgreSQL Tools +Keywords=database;db;sql;query;administration;development; diff --git a/util/admin/pgadmin4/files/pgadmin4 b/util/admin/pgadmin4/files/pgadmin4 new file mode 100644 index 0000000000..d83367fd9f --- /dev/null +++ b/util/admin/pgadmin4/files/pgadmin4 @@ -0,0 +1,3 @@ +#!/bin/sh +cd /usr/lib/pgadmin4 +exec runtime/pgAdmin4 "\$@"" diff --git a/util/admin/pgadmin4/files/pgadmin4-python-de-vendor-venv-paths.patch b/util/admin/pgadmin4/files/pgadmin4-python-de-vendor-venv-paths.patch new file mode 100644 index 0000000000..b81a52cceb --- /dev/null +++ b/util/admin/pgadmin4/files/pgadmin4-python-de-vendor-venv-paths.patch @@ -0,0 +1,33 @@ +From 8d3c335b578e7c33942a92194f01ad95c227809f Mon Sep 17 00:00:00 2001 +From: anthraxx +Date: Wed, 19 Dec 2018 01:10:25 +0100 +Subject: [PATCH] python: de-vendor venv paths + +--- + runtime/Server.cpp | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/runtime/Server.cpp b/runtime/Server.cpp +index 15344c11..203fe1a9 100644 +--- a/runtime/Server.cpp ++++ b/runtime/Server.cpp +@@ -135,11 +135,11 @@ Server::Server(quint16 port, QString key, QString logFileName) + add_to_path(pythonHome, venvPath.canonicalFilePath()); + #else + // Build (and canonicalise) the virtual environment path +- QFileInfo venvBinPath(app_dir + "/../venv/bin"); +- QFileInfo venvLibPath(app_dir + "/../venv/lib/python"); +- QFileInfo venvDynLibPath(app_dir + "/../venv/lib/python/lib-dynload"); +- QFileInfo venvSitePackagesPath(app_dir + "/../venv/lib/python/site-packages"); +- QFileInfo venvPath(app_dir + "/../venv"); ++ QFileInfo venvBinPath("/usr/bin"); ++ QFileInfo venvLibPath("/usr/lib/python##PYTHONVERSION##"); ++ QFileInfo venvDynLibPath("/usr/lib/python##PYTHONVERSION##/lib-dynload"); ++ QFileInfo venvSitePackagesPath("/usr/lib/python##PYTHONVERSION##/site-packages"); ++ QFileInfo venvPath("/usr/lib/python##PYTHONVERSION##"); + + // Prepend the bin directory to the path + add_to_path(path_env, venvBinPath.canonicalFilePath(), true); +-- +2.20.1 + diff --git a/util/admin/pgadmin4/files/pgadmin4-server b/util/admin/pgadmin4/files/pgadmin4-server new file mode 100644 index 0000000000..e61680052c --- /dev/null +++ b/util/admin/pgadmin4/files/pgadmin4-server @@ -0,0 +1,3 @@ +#!/bin/sh +cd /usr/lib/pgadmin4 +python web/pgAdmin4.py "\$@" diff --git a/util/admin/pgadmin4/files/python-3.8.patch b/util/admin/pgadmin4/files/python-3.8.patch new file mode 100644 index 0000000000..a7cd288b5c --- /dev/null +++ b/util/admin/pgadmin4/files/python-3.8.patch @@ -0,0 +1,12 @@ +diff -uprb pgadmin4-4.13.orig/runtime/pgAdmin4.pro pgadmin4-4.13/runtime/pgAdmin4.pro +--- pgadmin4-4.13.orig/runtime/pgAdmin4.pro 2019-10-16 10:07:59.000000000 +0300 ++++ pgadmin4-4.13/runtime/pgAdmin4.pro 2019-11-05 18:33:18.524516120 +0200 +@@ -75,7 +75,7 @@ else { + + QMAKE_CXXFLAGS += $$system($$PYTHON_CONFIG --includes) + QMAKE_LFLAGS += $$system($$PYTHON_CONFIG --ldflags) +- LIBS += $$system($$PYTHON_CONFIG --libs) ++ LIBS += $$system(PYTHON_LIBS=`$$PYTHON_CONFIG --libs --embed` || PYTHON_LIBS=`$$PYTHON_CONFIG --libs`; echo $PYTHON_LIBS) + + contains( LIBS, -lpython2.* ) { + DEFINES += PYTHON2 diff --git a/util/admin/pgadmin4/pspec.xml b/util/admin/pgadmin4/pspec.xml new file mode 100644 index 0000000000..6182844af3 --- /dev/null +++ b/util/admin/pgadmin4/pspec.xml @@ -0,0 +1,138 @@ + + + + + pgadmin4 + https://www.pgadmin.org/ + + İdris Kalp + idriskalp@gmail.com + + custom + app:gui + Comprehensive design and management interface for PostgreSQL + pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world. + https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v4.19/source/pgadmin4-4.19.tar.gz + + python3-devel + qt5-base-devel + postgresql-lib + imagemagick-devel + python3-setuptools + python3-sphinx + python3-extras + python3-fixtures + python3-html5lib + python3-pbr + python3-mimeparse + python3-pyrsistent + python3-blinker + python3-flask + python3-flask-login + python3-flask-migrate + python3-flask-sqlalchemy + python3-flask-wtf + python3-passlib + python3-pytz + python3-simplejson + python3-six + python3-speaklater + python3-sqlparse + python3-wtforms + python3-psutil + python3-Jinja2 + python3-paramiko + python3-psycopg2 + python3-cryptography + python3-sqlalchemy + python3-testtools + python3-webencodings + python3-werkzeug + python3-dateutil + python3-flask-gravatar + python3-flask-mail + python3-flask-principal + python3-flask-paranoid + python3-sshtunnel + python3-flask-security + python3-flask-compress + + + pgadmin4-python-de-vendor-venv-paths.patch + python-3.8.patch + + + + + pgadmin4 + Comprehensive design and management interface for PostgreSQL + + python3 + qt5-base + postgresql-lib + imagemagick + python3-blinker + python3-flask + python3-flask-login + python3-flask-migrate + python3-flask-sqlalchemy + python3-flask-wtf + python3-passlib + python3-pytz + python3-simplejson + python3-six + python3-speaklater + python3-sqlparse + python3-wtforms + python3-psutil + python3-Jinja2 + python3-paramiko + python3-psycopg2 + python3-cryptography + python3-sqlalchemy + python3-testtools + python3-webencodings + python3-werkzeug + python3-dateutil + python3-flask-gravatar + python3-flask-mail + python3-flask-principal + python3-flask-paranoid + python3-sshtunnel + python3-flask-security + python3-flask-compress + + + /usr/bin + /usr/lib + /usr/share + + + pgadmin4 + pgadmin4-server + pgAdmin4.desktop + config_distro.py + + + + + pgadmin4-docs + Documentation files for pgadmin4 + + pgadmin4 + + + /usr/share/doc/pgadmin4 + + + + + + 2020-03-24 + 4.19 + First release + Idris Kalp + idriskalp@gmail.com + + + \ No newline at end of file