]> git.pld-linux.org Git - packages/phpMyAdmin.git/blobdiff - phpMyAdmin.spec
- rel 2 for the blind
[packages/phpMyAdmin.git] / phpMyAdmin.spec
index 228630386da546fbaadea0409877a5a525c29a86..483787badea1d4a7df9145ba261d6d1afee08e91 100644 (file)
@@ -1,27 +1,30 @@
 Summary:       phpMyAdmin - web-based MySQL administration
 Summary(pl):   phpMyAdmin - administracja bazami MySQL przez WWW
 Name:          phpMyAdmin
-%define                _ver    pl1
-Version:       2.5.7
-Release:       1.pl1
+Version:       2.8.0.3
+# release 1 is for Ra
+Release:       2
 License:       GPL v2
 Group:         Applications/Databases/Interfaces
-Source0:       http://dl.sourceforge.net/phpmyadmin/%{name}-%{version}-%{_ver}.tar.bz2
-# Source0-md5: 93b7c7f3dfcfd6df9c2ea26f31a51772
+Source0:       http://dl.sourceforge.net/phpmyadmin/%{name}-%{version}.tar.bz2
+# Source0-md5: 87ee2e17c9381e969c8f740242220e29
 Source1:       %{name}.conf
 Patch0:                %{name}-config.patch
 URL:           http://www.phpmyadmin.net/
-#Requires:     mysql
-Requires(postun):      perl-base
+BuildRequires: rpmbuild(macros) >= 1.268
+Requires(triggerpostun):       sed >= 4.0
+Requires:      php
 Requires:      php-mysql
 Requires:      php-pcre
-Requires:      php
-Requires:      webserver
+Requires:      webapps
+#Suggests:     php-mbstring
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _myadmindir     %{_datadir}/%{name}
-%define                _sysconfdir     /etc/%{name}
+%define                _appdir %{_datadir}/%{name}
+%define                _webapps        /etc/webapps
+%define                _webapp         %{name}
+%define                _sysconfdir     %{_webapps}/%{_webapp}
 
 %description
 phpMyAdmin can administer a whole MySQL-server (needs a super-user)
@@ -29,113 +32,130 @@ but also a single database. To accomplish the latter you'll need a
 properly set up MySQL-user who can read/write only the desired
 database. It's up to you to look up the appropiate part in the MySQL
 manual. Currently phpMyAdmin 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
+- 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
 phpMyAdmin potrafi zarz±dzaæ ca³ymi bazami MySQL (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
-MySQL). Aktualnie phpMyAdmin 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
+uprawnienia superu¿ytkownika) jak i pojedynczymi bazami danych.
+Potrzebny jest u¿ytkownik, który ma prawa zapisu/odczytu tylko tych
+baz, którymi chcemy administrowaæ (wiêcej informacji w odpowiedniej
+podrêcznika MySQL). Aktualnie phpMyAdmin potrafi:
+- tworzyæ i usuwaæ bazy
+- wykonywaæ create, copy, drop oraz alter na tabelach
+- dodawaæ, usuwaæ i modyfikowaæ 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 pojedynczymi bazami danych
+- eksportowaæ i importowaæ dane do warto¶ci CSV
+- tworzyæ i czytaæ zrzuty tabel
 
 %prep
-%setup -q -n %{name}-%{version}-%{_ver}
+%setup -q
 %patch -p1
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_myadmindir}/{css,lang,images,libraries/{auth,export}} \
-       $RPM_BUILD_ROOT{%{_sysconfdir},/etc/httpd}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}/{css,js,lang,libraries/{auth,dbg,dbi,engines,export,fpdf/font,import,transformations}}}
 
-install *.php *.html *.css $RPM_BUILD_ROOT%{_myadmindir}
-install images/*.{gif,png} $RPM_BUILD_ROOT%{_myadmindir}/images
-install lang/*.php $RPM_BUILD_ROOT%{_myadmindir}/lang
-install css/* $RPM_BUILD_ROOT%{_myadmindir}/css
-install libraries/*.{js,php} $RPM_BUILD_ROOT%{_myadmindir}/libraries
-install libraries/auth/*.php $RPM_BUILD_ROOT%{_myadmindir}/libraries/auth
-install libraries/export/*.php $RPM_BUILD_ROOT%{_myadmindir}/libraries/export
+install *.php *.html *.css $RPM_BUILD_ROOT%{_appdir}
+install lang/*.php $RPM_BUILD_ROOT%{_appdir}/lang
+cp -rf themes $RPM_BUILD_ROOT%{_appdir}
+install css/* $RPM_BUILD_ROOT%{_appdir}/css
+install js/* $RPM_BUILD_ROOT%{_appdir}/js
+install libraries/*.php $RPM_BUILD_ROOT%{_appdir}/libraries
+install libraries/auth/*.php $RPM_BUILD_ROOT%{_appdir}/libraries/auth
+install libraries/dbg/*.php $RPM_BUILD_ROOT%{_appdir}/libraries/dbg
+install libraries/dbi/*.php $RPM_BUILD_ROOT%{_appdir}/libraries/dbi
+install libraries/engines/*.php $RPM_BUILD_ROOT%{_appdir}/libraries/engines
+install libraries/export/*.php $RPM_BUILD_ROOT%{_appdir}/libraries/export
+install libraries/fpdf/*.php $RPM_BUILD_ROOT%{_appdir}/libraries/fpdf
+install libraries/fpdf/font/*.{php,z} $RPM_BUILD_ROOT%{_appdir}/libraries/fpdf/font
+install libraries/import/*.php $RPM_BUILD_ROOT%{_appdir}/libraries/import
+install libraries/transformations/*.php $RPM_BUILD_ROOT%{_appdir}/libraries/transformations
 
-install config.inc.php $RPM_BUILD_ROOT%{_sysconfdir}
-ln -sf %{_sysconfdir}/config.inc.php $RPM_BUILD_ROOT%{_myadmindir}/config.inc.php
+install libraries/config.default.php $RPM_BUILD_ROOT%{_sysconfdir}/config.inc.php
+ln -sf %{_sysconfdir}/config.inc.php $RPM_BUILD_ROOT%{_appdir}/config.inc.php
 
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post
-if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*phpMyAdmin.conf" /etc/httpd/httpd.conf; then
-       echo "Include /etc/httpd/phpMyAdmin.conf" >> /etc/httpd/httpd.conf
-elif [ -d /etc/httpd/httpd.conf ]; then
-       mv -f /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
-fi
-if [ -f /var/lock/subsys/httpd ]; then
-       /usr/sbin/apachectl restart 1>&2
-fi
+%triggerin -- apache1
+%webapp_register apache %{_webapp}
 
-%preun
-if [ "$1" = "0" ]; then
-       umask 027
-       if [ -d /etc/httpd/httpd.conf ]; then
-           rm -f /etc/httpd/httpd.conf/99_%{name}.conf
-       else
-               grep -v "^Include.*phpMyAdmin.conf" /etc/httpd/httpd.conf > \
-                       etc/httpd/httpd.conf.tmp
-               mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
-               if [ -f /var/lock/subsys/httpd ]; then
-                   /usr/sbin/apachectl restart 1>&2
-               fi
-       fi
-fi
+%triggerun -- apache1
+%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}
 
 %triggerpostun -- phpMyAdmin <= 2.5.3-2
-if [ -f /home/services/httpd/html/myadmin/config.inc.php.rpmsave ]; then
-       mv -f /home/services/httpd/html/myadmin/config.inc.php.rpmsave /etc/phpMyAdmin/config.inc.php
-else
-       if [ -f /home/httpd/html/myadmin/config.inc.php.rpmsave ]; then
-               mv -f /home/httpd/html/myadmin/config.inc.php.rpmsave /etc/phpMyAdmin/config.inc.php
-       fi
-fi
 for i in `grep -lr "/home/\(services/\)*httpd/html/myadmin" /etc/httpd/*`; do
        cp $i $i.backup
-       %{__perl} -pi -e "s#/home/httpd/html/myadmin#%{_myadmindir}#g" $i
-       %{__perl} -pi -e "s#/home/services/httpd/html/myadmin#%{_myadmindir}#g" $i
+       sed -i -e "s#/home/httpd/html/myadmin#%{_appdir}#g" $i
+       sed -i -e "s#/home/services/httpd/html/myadmin#%{_appdir}#g" $i
        echo "File changed by trigger: $i (backup: $i.backup)"
 done
-if [ -f /var/lock/subsys/httpd ]; then
-       /usr/sbin/apachectl restart 1>&2
+
+%triggerpostun -- %{name} < 2.7.0-pl1.2.5
+# rescue app config from various old locations
+if [ -f /home/services/httpd/html/myadmin/config.inc.php.rpmsave ]; then
+       mv -f %{_sysconfdir}/config.inc.php{,.rpmnew}
+       mv -f /home/services/httpd/html/myadmin/config.inc.php.rpmsav %{_sysconfdir}/config.inc.php
+fi
+if [ -f /home/httpd/html/myadmin/config.inc.php.rpmsave ]; then
+       mv -f %{_sysconfdir}/config.inc.php{,.rpmnew}
+       mv -f /home/httpd/html/myadmin/config.inc.php.rpmsave %{_sysconfdir}/config.inc.php
 fi
+if [ -f /etc/%{name}/config.inc.php.rpmsave ]; then
+       mv -f %{_sysconfdir}/config.inc.php{,.rpmnew}
+       mv -f /etc/%{name}/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.*%{name}.conf/d" /etc/httpd/httpd.conf
+fi
+
+# migrate from httpd (apache2) config dir
+if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
+       cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
+       mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
+fi
+
+rm -f /etc/httpd/httpd.conf/99_%{name}.conf
+/usr/sbin/webapp register httpd %{_webapp}
+%service httpd reload
 
 %files
 %defattr(644,root,root,755)
 %doc Documentation.* CREDITS ChangeLog INSTALL README TODO translators.html scripts
-%dir %{_sysconfdir}
-%attr(640,root,http) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*
-%config(noreplace) %verify(not size mtime md5) /etc/httpd/%{name}.conf
-%dir %{_myadmindir}
-%{_myadmindir}/css
-%{_myadmindir}/images
-%{_myadmindir}/lang
-%{_myadmindir}/libraries
-%{_myadmindir}/*.css
-%{_myadmindir}/*.html
-%{_myadmindir}/*.php
+%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,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
+%dir %{_appdir}
+%{_appdir}/css
+%{_appdir}/js
+%{_appdir}/lang
+%{_appdir}/libraries
+%{_appdir}/themes
+%{_appdir}/*.css
+%{_appdir}/*.html
+%{_appdir}/*.php
This page took 0.066366 seconds and 4 git commands to generate.