pgadmin4 add to repo

This commit is contained in:
idriskalp
2020-03-25 18:28:42 +03:00
parent d5488a6aac
commit 29c036b174
13 changed files with 287 additions and 163 deletions
+85
View File
@@ -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")
@@ -0,0 +1,2 @@
SERVER_MODE = False
HELP_PATH = "/usr/lib/pgadmin4/docs/en_US/_build/html/"
@@ -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;
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
cd /usr/lib/pgadmin4
exec runtime/pgAdmin4 "\$@""
@@ -0,0 +1,33 @@
From 8d3c335b578e7c33942a92194f01ad95c227809f Mon Sep 17 00:00:00 2001
From: anthraxx <levente@leventepolyak.net>
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
@@ -0,0 +1,3 @@
#!/bin/sh
cd /usr/lib/pgadmin4
python web/pgAdmin4.py "\$@"
@@ -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
+138
View File
@@ -0,0 +1,138 @@
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
<Source>
<Name>pgadmin4</Name>
<Homepage>https://www.pgadmin.org/</Homepage>
<Packager>
<Name>İdris Kalp</Name>
<Email>idriskalp@gmail.com</Email>
</Packager>
<License>custom</License>
<IsA>app:gui</IsA>
<Summary>Comprehensive design and management interface for PostgreSQL</Summary>
<Description>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.</Description>
<Archive sha1sum="53e44e5707ab04fd8b499d840a71ad8637cde3c0" type="targz">https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v4.19/source/pgadmin4-4.19.tar.gz</Archive>
<BuildDependencies>
<Dependency>python3-devel</Dependency>
<Dependency>qt5-base-devel</Dependency>
<Dependency>postgresql-lib</Dependency>
<Dependency>imagemagick-devel</Dependency>
<Dependency>python3-setuptools</Dependency>
<Dependency>python3-sphinx</Dependency>
<Dependency>python3-extras</Dependency>
<Dependency>python3-fixtures</Dependency>
<Dependency>python3-html5lib</Dependency>
<Dependency>python3-pbr</Dependency>
<Dependency>python3-mimeparse</Dependency>
<Dependency>python3-pyrsistent</Dependency>
<Dependency>python3-blinker</Dependency>
<Dependency>python3-flask</Dependency>
<Dependency>python3-flask-login</Dependency>
<Dependency>python3-flask-migrate</Dependency>
<Dependency>python3-flask-sqlalchemy</Dependency>
<Dependency>python3-flask-wtf</Dependency>
<Dependency>python3-passlib</Dependency>
<Dependency>python3-pytz</Dependency>
<Dependency>python3-simplejson</Dependency>
<Dependency>python3-six</Dependency>
<Dependency>python3-speaklater</Dependency>
<Dependency>python3-sqlparse</Dependency>
<Dependency>python3-wtforms</Dependency>
<Dependency>python3-psutil</Dependency>
<Dependency>python3-Jinja2</Dependency>
<Dependency>python3-paramiko</Dependency>
<Dependency>python3-psycopg2</Dependency>
<Dependency>python3-cryptography</Dependency>
<Dependency>python3-sqlalchemy</Dependency>
<Dependency>python3-testtools</Dependency>
<Dependency>python3-webencodings</Dependency>
<Dependency>python3-werkzeug</Dependency>
<Dependency>python3-dateutil</Dependency>
<Dependency>python3-flask-gravatar</Dependency>
<Dependency>python3-flask-mail</Dependency>
<Dependency>python3-flask-principal</Dependency>
<Dependency>python3-flask-paranoid</Dependency>
<Dependency>python3-sshtunnel</Dependency>
<Dependency>python3-flask-security</Dependency>
<Dependency>python3-flask-compress</Dependency>
</BuildDependencies>
<Patches>
<Patch level="1">pgadmin4-python-de-vendor-venv-paths.patch</Patch>
<Patch level="1">python-3.8.patch</Patch>
</Patches>
</Source>
<Package>
<Name>pgadmin4</Name>
<Summary>Comprehensive design and management interface for PostgreSQL</Summary>
<RuntimeDependencies>
<Dependency>python3</Dependency>
<Dependency>qt5-base</Dependency>
<Dependency>postgresql-lib</Dependency>
<Dependency>imagemagick</Dependency>
<Dependency>python3-blinker</Dependency>
<Dependency>python3-flask</Dependency>
<Dependency>python3-flask-login</Dependency>
<Dependency>python3-flask-migrate</Dependency>
<Dependency>python3-flask-sqlalchemy</Dependency>
<Dependency>python3-flask-wtf</Dependency>
<Dependency>python3-passlib</Dependency>
<Dependency>python3-pytz</Dependency>
<Dependency>python3-simplejson</Dependency>
<Dependency>python3-six</Dependency>
<Dependency>python3-speaklater</Dependency>
<Dependency>python3-sqlparse</Dependency>
<Dependency>python3-wtforms</Dependency>
<Dependency>python3-psutil</Dependency>
<Dependency>python3-Jinja2</Dependency>
<Dependency>python3-paramiko</Dependency>
<Dependency>python3-psycopg2</Dependency>
<Dependency>python3-cryptography</Dependency>
<Dependency>python3-sqlalchemy</Dependency>
<Dependency>python3-testtools</Dependency>
<Dependency>python3-webencodings</Dependency>
<Dependency>python3-werkzeug</Dependency>
<Dependency>python3-dateutil</Dependency>
<Dependency>python3-flask-gravatar</Dependency>
<Dependency>python3-flask-mail</Dependency>
<Dependency>python3-flask-principal</Dependency>
<Dependency>python3-flask-paranoid</Dependency>
<Dependency>python3-sshtunnel</Dependency>
<Dependency>python3-flask-security</Dependency>
<Dependency>python3-flask-compress</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="executable">/usr/bin</Path>
<Path fileType="library">/usr/lib</Path>
<Path fileType="data">/usr/share</Path>
</Files>
<AdditionalFiles>
<AdditionalFile owner="root" permission="0755" target="/usr/bin/pgadmin4">pgadmin4</AdditionalFile>
<AdditionalFile owner="root" permission="0755" target="/usr/bin/pgadmin4-server">pgadmin4-server</AdditionalFile>
<AdditionalFile owner="root" permission="0755" target="/usr/share/applications/pgAdmin4.desktop">pgAdmin4.desktop</AdditionalFile>
<AdditionalFile owner="root" permission="0755" target="/usr/lib/pgadmin4/web/config_distro.py">config_distro.py</AdditionalFile>
</AdditionalFiles>
</Package>
<Package>
<Name>pgadmin4-docs</Name>
<Summary>Documentation files for pgadmin4</Summary>
<RuntimeDependencies>
<Dependency release="current">pgadmin4</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="doc">/usr/share/doc/pgadmin4</Path>
</Files>
</Package>
<History>
<Update release="1">
<Date>2020-03-24</Date>
<Version>4.19</Version>
<Comment>First release</Comment>
<Name>Idris Kalp</Name>
<Email>idriskalp@gmail.com</Email>
</Update>
</History>
</PISI>