%global __ospython %{_bindir}/python3 %global pgadmin4instdir /usr/%{name} Name: pgadmin4 Version: 4.22 Release: 1%{?dist} Summary: Management tool for PostgreSQL License: PostgreSQL URL: https://www.pgadmin.org Source0: https://download.postgresql.org/pub/pgadmin/%{name}/v%{version}/source/%{name}-%{version}.tar.gz Source2: %{name}.conf Source3: %{name}.tmpfiles.d Source4: %{name}.desktop.in Source6: %{name}.qt.conf.in Source7: %{name}-web-setup.sh Source8: %{name}.service.in BuildArch: noarch Requires: %{name}-web BuildRequires: python3-flask-migrate >= 2.4.0 python3-passlib >= 1.7.2 #BuildRequires: python3-flask-security-too >= 3.3.3 BuildRequires: python3-flask-principal >= 0.4.0 BuildRequires: python3-dateutil >= 2.8.0 python3-simplejson >= 3.16.0 BuildRequires: python3-flask-mail >= 0.9.1 python3-flask-gravatar >= 0.5.0 BuildRequires: python3-flask-wtf >= 0.14.2 python3-flask >= 1.0.2 BuildRequires: python3-flask-paranoid >= 0.2.0 python3-flask-login >= 0.4.1 BuildRequires: python3-sqlalchemy >= 1.2.18 python3-devel BuildRequires: python3-blinker >= 1.4 python3-flask-sqlalchemy >= 2.3.2 python3-ldap3 >= 2.5.1 Requires: python3-flask-compress >= 1.4.0 Requires: python3-babel python3-flask-babelex python3 Requires: python3-alembic python3-mako python3-ldap3 >= 2.5.1 # For the _tmpfilesdir macro. BuildRequires: systemd %description pgAdmin 4 is a rewrite of the popular pgAdmin3 management tool for the PostgreSQL (http://www.postgresql.org) database. pgAdmin 4 is 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 %{name}-web Summary: pgAdmin4 web package Requires: httpd BuildArch: noarch Requires: python3-pytz >= 2018.9 python3-psutil >= 5.7.0 Requires: python3-flask-migrate >= 2.4.0 python3-passlib >= 1.7.2 Requires: python3-sshtunnel >= 0.1.4 python3-flask-compress >= 1.4.0 Requires: python3-six >= 1.12.0 python3-werkzeug >= 0.15.4 Requires: python3-flask >= 1.0.2 python3-flask-principal >= 0.4.0 Requires: python3-flask-wtf >= 0.14.2 python3-sqlalchemy >= 1.2.18 Requires: python3-wtforms >= 2.2.1 python3-speaklater >= 1.3 Requires: python3-simplejson >= 3.16.0 python3-dateutil >= 2.8.0 Requires: python3-sqlparse >= 0.2.4 python3-flask-gravatar >= 0.5.0 Requires: python3-flask-mail >= 0.9.1 python3-flask-security-too >= 3.3.3 Requires: python3-flask-login >= 0.4.1 python3-flask-paranoid >= 0.2 Requires: python3-flask-sqlalchemy >= 2.3.2 python3-blinker >= 1.4 Requires: python3-psycopg2 >= 2.8 python3-mod_wsgi Requires: policycoreutils-python-utils policycoreutils %description -n %{name}-web This package contains the required files to run pgAdmin4 as a web application %prep %setup -q -n %{name}-%{version} %build # Remove tests and regression directories, per Dave: find . -name tests -type d -print0|xargs -0 rm -r -- %{__rm} -rf web/regression %install %{__install} -d -m 755 %{buildroot}%{python3_sitelib}/%{name}-web %{__cp} -pR web/* %{buildroot}%{python3_sitelib}/%{name}-web # Install Apache sample config file ## %{__install} -d %{buildroot}%{_sysconfdir}/httpd/conf.d/ ##% {__sed} -e 's@PYTHONSITELIB@%{PYTHON_SITELIB}@g' < %{SOURCE2} > %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf.sample # Install Apache config script %{__install} -d %{buildroot}%{pgadmin4instdir}/bin %{__sed} -e 's@PYTHONDIR@%{__ospython}@g' -e 's@PYTHONSITELIB@%{python3_sitelib}@g'<%{SOURCE7} > "%{buildroot}%{pgadmin4instdir}/bin/%{name}-web-setup.sh" # Install unit file %{__install} -d %{buildroot}%{_unitdir} ##% {__sed} -e 's@PYTHONSITELIB@%{python3_sitelib}@g' -e 's@OSPYTHON@%{__ospython}@g'<%{SOURCE8} > "%{buildroot}%{_unitdir}/%{name}.service" # ... and make a tmpfiles script to recreate it at reboot. %{__mkdir} -p %{buildroot}/%{_tmpfilesdir} %{__install} -m 0644 %{SOURCE3} %{buildroot}/%{_tmpfilesdir}/%{name}.conf ##cd %{buildroot}%{PYTHON_SITELIB}/%{name}-web ## % {__rm} -f %{name}.db ##echo "HELP_PATH = '/usr/share/doc/%{name}-docs/en_US/html'" > config_distro.py # Disable upgrade check in the packages: ##echo "UPGRADE_CHECK_ENABLED = False" >> config_distro.py %files %files -n %{name}-web %dir %{python3_sitelib}/%{name}-web/ %{python3_sitelib}/%{name}-web/* %attr(700,root,root) %{pgadmin4instdir}/bin/%{name}-web-setup.sh ## % config(noreplace) % {_sysconfdir}/httpd/conf.d/% { name}.conf.sample %{_tmpfilesdir}/%{name}.conf ##% {_unitdir}/% { name}.service %changelog