util/admin/pgadmin4: Version bump to 9.14
This commit is contained in:
@@ -1,85 +1,46 @@
|
||||
#!/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
|
||||
import os
|
||||
from pisi.actionsapi import pisitools
|
||||
from pisi.actionsapi import shelltools
|
||||
from pisi.actionsapi import get
|
||||
|
||||
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")
|
||||
installdir = get.installDIR()
|
||||
shelltools.system("pip3 install --no-build-isolation --ignore-installed "
|
||||
"--prefix=/usr --root='%s' "
|
||||
"-r requirements.txt" % installdir)
|
||||
os.environ["COREPACK_ENABLE_STRICT"] = "0"
|
||||
os.environ["COREPACK_ENABLE_AUTO_PIN"] = "0"
|
||||
os.environ["COREPACK_HOME"] = "/root/.cache/node/corepack"
|
||||
os.environ["YARN_IGNORE_NODE"] = "1"
|
||||
shelltools.system("corepack enable")
|
||||
shelltools.system("corepack prepare yarn@4.9.2 --activate")
|
||||
shelltools.system("cd web && yarn install && yarn run bundle")
|
||||
|
||||
def build():
|
||||
autotools.make("docs")
|
||||
shelltools.cd("runtime")
|
||||
autotools.make()
|
||||
pass
|
||||
|
||||
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")
|
||||
installdir = get.installDIR()
|
||||
|
||||
# add documentation
|
||||
pisitools.dohtml("docs/en_US/_build/*")
|
||||
# Ana dizinleri oluştur
|
||||
pisitools.dodir("/usr/lib/pgadmin4")
|
||||
pisitools.dodir("/usr/bin")
|
||||
pisitools.dodir("/var/lib/pgadmin")
|
||||
pisitools.dodir("/var/log/pgadmin")
|
||||
pisitools.dodir("/usr/share/applications")
|
||||
|
||||
if get.buildTYPE() != "_emul32":
|
||||
pisitools.dodoc("LICENSE", "README")
|
||||
# Dosyaları kopyala
|
||||
shelltools.copytree("web", "%s/usr/lib/pgadmin4/web" % installdir)
|
||||
shelltools.copytree("docs", "%s/usr/lib/pgadmin4/docs" % installdir)
|
||||
|
||||
# Launcher script
|
||||
launcher = "#!/bin/sh\nexec python3 /usr/lib/pgadmin4/web/pgAdmin4.py \"$@\"\n"
|
||||
open("%s/usr/bin/pgadmin4" % installdir, "w").write(launcher)
|
||||
shelltools.chmod("%s/usr/bin/pgadmin4" % installdir, 0o755)
|
||||
|
||||
# Desktop entry
|
||||
desktop = "[Desktop Entry]\nName=pgAdmin 4\nComment=PostgreSQL management tool\nExec=pgadmin4\nIcon=pgadmin4\nTerminal=false\nType=Application\nCategories=Development;Database;\n"
|
||||
open("%s/usr/share/applications/pgadmin4.desktop" % installdir, "w").write(desktop)
|
||||
|
||||
Reference in New Issue
Block a user