]> git.pld-linux.org Git - packages/phpPgAdmin.git/blobdiff - phpPgAdmin.spec
- upgraded to 5.0.2
[packages/phpPgAdmin.git] / phpPgAdmin.spec
index ca80a179849d66c1306d390892577ede99bca0f9..d60c368a22356be13d4ab22d360af32f702ee13c 100644 (file)
+# TODO
+# - separate internal files (classes, libraries) and public files (.js, .css,
+#   index.php) to htdocs and above and point docroot to htdocs dir
 Summary:       phpPgAdmin - web-based PostgreSQL administration
-Summary(pl):   phpPgAdmin - administracja bazami PostgreSQL przez WWW
+Summary(pl.UTF-8):     phpPgAdmin - administracja bazami PostgreSQL przez WWW
 Name:          phpPgAdmin
-Version:       2.3.1
+Version:       5.0.2
 Release:       1
-License:       GPL v2
+License:       GPL v2+
 Group:         Applications/Databases/Interfaces
-Group(de):     Applikationen/Dateibanken/Schnittstellen
-Group(pl):     Aplikacje/Bazy danych/Interfejsy
-Source:                http://prdownloads.sourceforge.net/phppgadmin/%{name}_2-3-1.tar.gz
-URL:           http://sourceforge.net/projects/phppgadmin/
-Requires:      postgresql
-Requires:      php >= 4
-Requires:      webserver
-Buildarch:     noarch
-BuildRoot:     /tmp/%{name}-%{version}-root
+Source0:       http://dl.sourceforge.net/phppgadmin/%{name}-%{version}.tar.bz2
+# Source0-md5: 4e4d462100ed602d4f6c9b47b1586aba
+Source1:       %{name}-apache.conf
+Source2:       %{name}-lighttpd.conf
+Source3:       http://www.quarto.pl/~gotar/%{name}-jscalendar.tar.bz2
+# Source3-md5: 84115f772a723cc742352c589df9af29
+Patch0:                %{name}-config.patch
+#Patch1:       %{name}-adodb.patch
+Patch2:                %{name}-calendar.patch
+URL:           http://phppgadmin.sourceforge.net/
+BuildRequires: rpmbuild(macros) >= 1.268
+Requires(triggerpostun):       sed >= 4.0
+#Requires:     adodb >= 4.67-1.17
+Requires:      php(pcre)
+Requires:      php(pgsql)
+Requires:      php(session)
+Requires:      webapps
+Requires:      webserver(php) >= 5.0
+BuildArch:     noarch
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-
-%define                _pgadmindir     /home/httpd/html/pgadmin
+%define                _appdir         %{_datadir}/%{name}
+%define                _webapps        /etc/webapps
+%define                _webapp         %{name}
+%define                _sysconfdir     %{_webapps}/%{_webapp}
 
 %description
-phpPgAdmin can administer a whole PostgreSQL-server (needs a
-super-user) but also a single database. To accomplish the latter
-you'll need a properly set up PostgreSQL-user who can read/write only
-the desired database. It's up to you to look up the appropiate part in
-the PostgreSQL manual. Currently phpPgAdmin can:
-  - create and drop databases
-  - create, copy, drop and alter tables
-  - delete, edit and add fields
-  - execute any SQL-statement, even batch-queries
-  - manage keys on fields
-  - load text files into tables
-  - create (*) and read dumps of tables
-  - export (*) and import data to CSV values
-  - administer multiple servers and single databases
-  - communicate in more than 20 different languages
-
-%description -l pl
-phpPgAdmin potrafi zarz±dzaæ ca³ymi bazami PostgreSQL (potrzebne
-uprawnienia super-user'a) jak i pojedynczymi bazami danych. Bêdziesz
-potrzebowa³ u¿ytkownika, który ma prawa zapisu/odczytu tylko tych baz,
-którymi chcesz administrowaæ (zajrzyj do odpowiedniej czê¶ci manual'a
-PostgreSQL). Aktualnie phpPgAdmin potrafi:
-  - tworzyæ i usuwaæ bazy
-  - create, copy, drop oraz alter na tabelach
-  - dodawaæ, usuwaæ i edytowaæ pola
-  - wykonywaæ dowolne zapytania SQL
-  - zarz±dzaæ kluczami na rekordach
-  - wczytywaæ tekst z plików do tabel
-  - obs³ugiwaæ ponad 20 jêzyków
-  - zarz±dzaæ wieloma serwerami i pojedyñczymi bazami danych
-  - eksportowaæ i importowaæ dane do warto¶ci CSV
-  - tworzyæ i czytaæ zrzuty tabel
+phpPgAdmin is a fully functional web-based administration utility for
+a PostgreSQL database server. It handles all the basic functionality
+as well as some advanced features such as triggers, views and
+functions (stored procedures).
+
+%description -l pl.UTF-8
+phpPgAdmin jest w pełni funkcjonalnym, bazowanym na WWW, narzędziem
+administracyjnym dla serwera baz danych PostgreSQL. Posiada wszystkie
+podstawowe możliwości, jak i część bardziej zaawansowanych jak
+przełączniki, widoki i funkcje (procedury składowane).
 
 %prep
-%setup -q -n phpPgAdmin
-%build
+%setup -q -a3
+%patch0 -p1
+#%patch1 -p1
+%patch2 -p1
+mv conf/config.inc.php{-dist,}
+find . -name \*.orig -exec rm -f \{\} \;
+
+# remove language source files (or one wants to make -devel subpackage?)
+mv -f lang/translations.php .
+rm -f lang/*.php
+rm -f lang/{Makefile,synch,php2po,po2php,langcheck,convert.awk}
+mv -f translations.php lang/translations.php
+rm -f lang/recoded/README
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_pgadmindir}/{lang,images,libraries}
+install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
+
+cp -a *.php *.txt *.js $RPM_BUILD_ROOT%{_appdir}
+cp -a classes help images js lang libraries themes xloadtree $RPM_BUILD_ROOT%{_appdir}
+cp -a conf/*.php $RPM_BUILD_ROOT%{_sysconfdir}
+
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
+install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
+
+%triggerin -- apache1 < 1.3.37-3, apache1-base
+%webapp_register apache %{_webapp}
+
+%triggerun -- apache1 < 1.3.37-3, apache1-base
+%webapp_unregister apache %{_webapp}
+
+%triggerin -- apache < 2.2.0, apache-base
+%webapp_register httpd %{_webapp}
+
+%triggerun -- apache < 2.2.0, apache-base
+%webapp_unregister httpd %{_webapp}
 
-cp *.php $RPM_BUILD_ROOT%{_pgadmindir}
-cp *.html $RPM_BUILD_ROOT%{_pgadmindir}
-cp images/*.gif $RPM_BUILD_ROOT%{_pgadmindir}/images
+%triggerin -- lighttpd
+%webapp_register lighttpd %{_webapp}
 
-gzip -9nf Documentation.html BUGS DEVELOPERS INSTALL README TODO ChangeLog
+%triggerun -- lighttpd
+%webapp_unregister lighttpd %{_webapp}
+
+%triggerpostun -- %{name} < 4.0.1-1.2
+# rescue app config
+if [ -f /etc/phpPgAdmin/config.inc.php.rpmsave ]; then
+       mv -f %{_sysconfdir}/config.inc.php{,.rpmnew}
+       mv -f /etc/phpPgAdmin/config.inc.php.rpmsave %{_sysconfdir}/config.inc.php
+fi
+
+# nuke very-old config location (this mostly for Ra)
+if [ -f /etc/httpd/httpd.conf ]; then
+       sed -i -e "/^Include.*phpPgAdmin.conf/d" /etc/httpd/httpd.conf
+       httpd_reload=1
+fi
+
+# change config version number for 4.1.2
+if [ -f /etc/webapps/phpPgAdmin/config.inc.php ]; then
+       echo "Adjusting configuration for phpPgAdmin 4.1.2"
+       sed -i -e '/conf.*version/s/[0-9][0-9][\t ]*;/17;/' /etc/webapps/phpPgAdmin/config.inc.php
+fi
+
+# migrate from httpd (apache2) config dir
+if [ -f /etc/httpd/phpPgAdmin.conf.rpmsave ]; then
+       cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
+       mv -f /etc/httpd/phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
+       httpd_reload=1
+fi
+
+# migrate from apache-config macros
+if [ -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave ]; then
+       if [ -d /etc/apache/webapps.d ]; then
+               cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
+               cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/apache.conf
+       fi
+
+       if [ -d /etc/httpd/webapps.d ]; then
+               cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
+               cp -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave %{_sysconfdir}/httpd.conf
+       fi
+       rm -f /etc/phpPgAdmin/apache-phpPgAdmin.conf.rpmsave
+fi
+
+# place new config location, as trigger puts config only on first install, do it here.
+# apache1
+if [ -L /etc/apache/conf.d/99_phpPgAdmin.conf ]; then
+       rm -f /etc/apache/conf.d/99_phpPgAdmin.conf
+       /usr/sbin/webapp register apache %{_webapp}
+       apache_reload=1
+fi
+# apache2
+if [ -L /etc/httpd/httpd.conf/99_phpPgAdmin.conf ]; then
+       rm -f /etc/httpd/httpd.conf/99_phpPgAdmin.conf
+       /usr/sbin/webapp register httpd %{_webapp}
+       httpd_reload=1
+fi
+
+if [ "$httpd_reload" ]; then
+       %service httpd reload
+fi
+if [ "$apache_reload" ]; then
+       %service apache reload
+fi
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc *.gz
-%dir %{_pgadmindir}
-%attr(640,root,http) %config(noreplace) %verify(not size mtime md5) %{_pgadmindir}/config.inc.php
-%{_pgadmindir}/all_db.php
-%{_pgadmindir}/db*.php
-%{_pgadmindir}/fil*.php
-%{_pgadmindir}/fun*.php
-%{_pgadmindir}/grp*.php
-%{_pgadmindir}/ldi*.php
-%{_pgadmindir}/left.php
-%{_pgadmindir}/main.php
-%{_pgadmindir}/oper*.php
-%{_pgadmindir}/rep*.php
-%{_pgadmindir}/seq*.php
-%{_pgadmindir}/sql.php
-%{_pgadmindir}/tbl*.php
-%{_pgadmindir}/trig*.php
-%{_pgadmindir}/user*.php
-%{_pgadmindir}/view*.php
-%{_pgadmindir}/footer.inc.php
-%{_pgadmindir}/header.inc.php
-%{_pgadmindir}/index.php
-%{_pgadmindir}/*.html
-%{_pgadmindir}/images
-%{_pgadmindir}/chinese*.php
-%{_pgadmindir}/danish*.php
-%{_pgadmindir}/catala*.php
-%{_pgadmindir}/english*.php
-%{_pgadmindir}/german*.php
-%{_pgadmindir}/italian*.php
-%{_pgadmindir}/lib.inc.php
-%{_pgadmindir}/login*.php
-%{_pgadmindir}/old.chinese*.php
-%{_pgadmindir}/portu*.php
-%{_pgadmindir}/russ*.php
-%{_pgadmindir}/spanish*.php
+%doc CREDITS DEVELOPERS FAQ HISTORY INSTALL TODO TRANSLATORS
+%doc sql
+%dir %attr(750,root,http) %{_sysconfdir}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
+
+%{_appdir}
This page took 0.032839 seconds and 4 git commands to generate.