Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37663148
en ru br
ALT Linux repos
S:5.2.1-alt1
5.0: 3.1.1-alt1
4.1: 2.11.8.1-alt0.M41.1
4.0: 2.11.8.1-alt0.M40.1
3.0: 2.5.7-alt2pl1

Group :: Networking/WWW
RPM: phpMyAdmin

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Name: phpMyAdmin
Version: 3.1.1
Release: alt1
Summary: phpMyAdmin - web-based MySQL administration
License: GPL
Group: Networking/WWW

Url: http://www.phpmyadmin.net
Source0: http://prdownloads.sourceforge.net/phpmyadmin/%name-%version-all-languages.tar.bz2
Source1: config.inc.php
Source2: %name-README.ALT
Source3: %name.htaccess

Provides: phpmyadmin

BuildArch: noarch

Packager: Dmitriy Kulik <lnkvisitor at altlinux.org>

#TODO: try again to let non-root webmaster edit the config file

#      (read: need web policy)

#define webmaster webmaster


%define pma_home %webserver_datadir/%name
%define pma_doc %_docdir/%name-%version

# Automatically added by buildreq on Fri Dec 12 2008 (-bi)

BuildRequires: MySQL-client apache-base apache2-base iproute2 rpm-macros-fillup rpm-macros-apache rpm-macros-apache2

%description
phpMyAdmin can administer a whole MySQL-server (needs a super-user)
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

%package -n %name-common
Summary: phpMyAdmin - web-based MySQL administration (common package)
Group: Networking/WWW
Requires: pwgen

%description -n %name-common
phpMyAdmin can administer a whole MySQL-server (needs a super-user)
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

This is package contains common part of phpMyAdmin.

%package -n %name-apache
Summary: phpMyAdmin - web-based MySQL administration (for apache 1.3 and php5)
Group: Networking/WWW
Requires: %name-common = %version-%release
Requires: apache-mod_php5
Requires: php5-mysql
Requires: php5-mcrypt
Requires: php5-mbstring
Requires: php5-gd2
Obsoletes: %name-apache-php5

%description -n %name-apache
phpMyAdmin can administer a whole MySQL-server (needs a super-user)
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

Install this package if you need phpMyAdmin for apache 1.3 and php5.

%package -n %name-apache2
Summary: phpMyAdmin - web-based MySQL administration (for apache 2.0 and php5)
Group: Networking/WWW
Requires: %name-common = %version-%release
Requires: apache2-mod_php5
Requires: php5-mysql
Requires: php5-mcrypt
Requires: php5-mbstring
Requires: php5-gd2
Obsoletes: %name-apache2-php5

%description -n %name-apache2
phpMyAdmin can administer a whole MySQL-server (needs a super-user)
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

Install this package if you need phpMyAdmin for apache 2.0 and php5.

%prep
%setup -q -n %name-%version-all-languages

%install
install -m755 -d %buildroot%webserver_datadir/%name/{lang,js,test,themes,libraries{/auth,},css}
install -m644 *.php *.html *.css favicon.ico %buildroot%webserver_datadir/%name/
install -m644 js/*.js %buildroot%webserver_datadir/%name/js/
install -m644 lang/*.php %buildroot%webserver_datadir/%name/lang/
cp -a %SOURCE3 %buildroot%webserver_datadir/%name/.htaccess
cp -a libraries/ %buildroot%webserver_datadir/%name/
cp -a test/ %buildroot%webserver_datadir/%name/
cp -a themes %buildroot%webserver_datadir/%name/

cp %SOURCE2 .

cp %SOURCE1 %buildroot%webserver_datadir/%name/

##make httpd config

%__mkdir -p %buildroot%apache_addonconfdir
%__mkdir -p %buildroot%apache_modconfdir

echo Alias /%name "%webserver_datadir/%name/">%buildroot%apache_addonconfdir/%name.conf

echo -e \<Directory "%webserver_datadir/%name/"\>>>%buildroot%apache_addonconfdir/%name.conf
echo -e \\tOptions Indexes MultiViews>>%buildroot%apache_addonconfdir/%name.conf
echo -e \\tAllowOverride None>>%buildroot%apache_addonconfdir/%name.conf
echo -e \\tOrder Deny,Allow>>%buildroot%apache_addonconfdir/%name.conf
echo -e \\tDeny from all>>%buildroot%apache_addonconfdir/%name.conf

/sbin/ip a | grep inet | tr --squeeze-repeats ' ' | cut -d ' ' -f3| grep / | cut -d '/' -f1 | while read ip; do echo -e \\tAllow from  $ip; done>>%buildroot%apache_addonconfdir/%name.conf
echo -e \</Directory\>>>%buildroot%apache_addonconfdir/%name.conf

%__mkdir -p %buildroot%apache2_extra_available
%__mkdir -p %buildroot%apache2_extra_enabled

echo \<IfModule alias_module\>>%buildroot%apache2_extra_available/%name.conf
echo -e \\t Alias /%name "%webserver_datadir/%name//">>%buildroot%apache2_extra_available/%name.conf
echo -e \\t\<Directory "%webserver_datadir/%name//"\>>>%buildroot%apache2_extra_available/%name.conf
echo -e \\t\\tOptions Indexes MultiViews>>%buildroot%apache2_extra_available/%name.conf
echo -e \\t\\tAllowOverride All>>%buildroot%apache2_extra_available/%name.conf
echo -e \\t\\tOrder Deny,Allow>>%buildroot%apache2_extra_available/%name.conf
echo -e \\t\\tDeny from all>>%buildroot%apache2_extra_available/%name.conf
/sbin/ip a | grep inet | tr --squeeze-repeats ' ' | cut -d ' ' -f3| grep / | cut -d '/' -f1 | while read ip; do echo -e \\t\\tAllow from  $ip; done>>%buildroot%apache2_extra_available/%name.conf

echo -e \\t\</Directory\>>>%buildroot%apache2_extra_available/%name.conf
echo \</IfModule\>>>%buildroot%apache2_extra_available/%name.conf

cd %buildroot%apache_modconfdir
ln -s ../addon-modules/%name.conf %name.conf
cd %buildroot%apache2_extra_enabled
ln -s ../extra-available/%name.conf %name.conf

%post -n %name-common
replace *SECRET* `pwgen -0s1` -- %webserver_datadir/%name/config.inc.php

%post -n %name-apache
%_initdir/httpd reload

%post -n %name-apache2
%_initdir/httpd2 reload

%postun -n %name-apache
%_initdir/httpd reload

%postun -n %name-apache2
%_initdir/httpd2 reload

%files
%doc scripts contrib phpMyAdmin-README.ALT
%doc Documentation.html docs.css README TODO ChangeLog translators.html Documentation.txt

%files -n %name-common
%dir %webserver_datadir/%name//
%webserver_datadir/%name//lang/
%webserver_datadir/%name/libraries/
%webserver_datadir/%name//test/
%webserver_datadir/%name//themes/
%webserver_datadir/%name//js/
%webserver_datadir/%name//favicon.ico
%webserver_datadir/%name//*.html
%webserver_datadir/%name//*.css
%webserver_datadir/%name//[^c]*.php
%webserver_datadir/%name//c[^o]*.php
%webserver_datadir/%name//config.sample.inc.php
%config(noreplace) %webserver_datadir/%name//config.inc.php
%exclude %webserver_datadir/%name//phpinfo.php

%files -n %name-apache
%apache_addonconfdir/%name.conf
%apache_modconfdir/%name.conf

%files -n %name-apache2
%apache2_extra_available/%name.conf
%apache2_extra_enabled/%name.conf

# TODO:

# - translators.html goes in twice

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin