2011-02-25 15:41:08 +01:00
|
|
|
#
|
2011-02-25 15:41:19 +01:00
|
|
|
# spec file for package phpMyAdmin
|
2011-02-25 15:41:08 +01:00
|
|
|
#
|
2019-02-04 11:50:07 +01:00
|
|
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
2011-02-25 15:41:08 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2019-02-04 11:50:07 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2011-02-25 15:41:08 +01:00
|
|
|
#
|
|
|
|
|
2012-02-23 13:47:47 +01:00
|
|
|
|
2011-02-25 15:41:08 +01:00
|
|
|
%define apxs %{_sbindir}/apxs2
|
|
|
|
%define ap_sysconfdir %(%{apxs} -q SYSCONFDIR)
|
|
|
|
%define ap_serverroot %(%{apxs} -q PREFIX)
|
|
|
|
%define ap_docroot %(%{apxs} -q PREFIX)/htdocs
|
|
|
|
%define pma_config %{_sysconfdir}/%{name}/config.inc.php
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
%define ap_usr wwwrun
|
|
|
|
%define ap_grp www
|
|
|
|
%else
|
|
|
|
%define ap_usr nobody
|
|
|
|
%define ap_grp nogroup
|
|
|
|
%endif
|
2015-07-02 13:59:32 +02:00
|
|
|
Name: phpMyAdmin
|
2019-06-05 17:15:28 +02:00
|
|
|
Version: 4.9.0.1
|
2015-07-02 13:59:32 +02:00
|
|
|
Release: 0
|
2011-02-25 15:41:08 +01:00
|
|
|
Summary: Administration of MySQL over the web
|
2018-05-26 11:06:15 +02:00
|
|
|
License: GPL-2.0-or-later
|
2011-02-25 15:41:08 +01:00
|
|
|
Group: Productivity/Networking/Web/Frontends
|
2019-02-04 11:50:07 +01:00
|
|
|
URL: https://www.phpMyAdmin.net/
|
2015-07-22 08:10:50 +02:00
|
|
|
Source0: https://files.phpmyadmin.net/phpMyAdmin/%{version}/%{name}-%{version}-all-languages.tar.xz
|
|
|
|
Source1: https://files.phpmyadmin.net/phpMyAdmin/%{version}/%{name}-%{version}-all-languages.tar.xz.asc
|
2016-01-28 19:21:31 +01:00
|
|
|
# http://docs.phpmyadmin.net/en/latest/setup.html#verifying-phpmyadmin-releases
|
|
|
|
Source2: https://files.phpmyadmin.net/phpmyadmin.keyring#/%{name}.keyring
|
2015-07-02 13:56:35 +02:00
|
|
|
Source3: %{name}.http
|
2017-03-20 23:22:05 +01:00
|
|
|
Source4: %{name}.http.inc
|
2014-07-18 19:43:37 +02:00
|
|
|
Source100: %{name}-rpmlintrc
|
2015-01-06 00:47:56 +01:00
|
|
|
# Fix-SuSE: provide useful default config
|
2012-06-04 00:09:36 +02:00
|
|
|
Patch0: %{name}-config.patch
|
2017-04-22 19:12:08 +02:00
|
|
|
# Fix-SUSE: auto config for pma storage
|
|
|
|
Patch1: %{name}-pma.patch
|
2011-02-25 15:41:08 +01:00
|
|
|
BuildRequires: apache2-devel
|
2019-02-04 11:50:07 +01:00
|
|
|
BuildRequires: fdupes
|
2014-01-01 16:38:50 +01:00
|
|
|
BuildRequires: python-devel
|
2015-07-22 08:10:50 +02:00
|
|
|
BuildRequires: xz
|
2011-02-25 15:41:08 +01:00
|
|
|
#
|
2011-07-04 16:05:23 +02:00
|
|
|
Requires: php-bz2
|
2018-07-31 23:19:32 +02:00
|
|
|
Requires: php-ctype
|
2011-07-04 16:05:23 +02:00
|
|
|
Requires: php-gd
|
2016-08-18 16:48:55 +02:00
|
|
|
Requires: php-gettext
|
2011-07-04 16:05:23 +02:00
|
|
|
Requires: php-iconv
|
2016-01-06 18:52:11 +01:00
|
|
|
Requires: php-json
|
2011-07-04 16:05:23 +02:00
|
|
|
Requires: php-mbstring
|
|
|
|
Requires: php-mysql
|
2017-07-28 11:29:50 +02:00
|
|
|
Requires: php-openssl
|
2011-07-04 16:05:23 +02:00
|
|
|
Requires: php-session
|
2015-07-02 13:59:32 +02:00
|
|
|
# FIXME: use proper Requires(pre/post/preun/...)
|
|
|
|
PreReq: coreutils
|
|
|
|
PreReq: grep
|
|
|
|
PreReq: pwgen
|
|
|
|
PreReq: sed
|
2017-11-26 20:13:36 +01:00
|
|
|
Recommends: mod_php_any >= 5.5
|
2017-09-08 15:03:16 +02:00
|
|
|
Recommends: php-curl
|
|
|
|
Recommends: php-zip
|
2017-07-28 11:29:50 +02:00
|
|
|
### will be removed with php >= 7.2
|
|
|
|
## boo#1050980
|
|
|
|
Suggests: php-mcrypt
|
2015-07-02 13:59:32 +02:00
|
|
|
BuildArch: noarch
|
2011-02-25 15:41:08 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
phpMyAdmin can manage a whole MySQL server (needs a super-user) as well as 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 appropriate part in the MySQL manual.
|
|
|
|
|
|
|
|
Currently phpMyAdmin can:
|
|
|
|
|
|
|
|
* browse and drop databases, tables, views, fields and indexes
|
|
|
|
* create, copy, drop, rename and alter databases, tables, fields and indexes
|
|
|
|
* maintenance server, databases and tables, with proposals on server
|
|
|
|
configuration
|
|
|
|
* execute, edit and bookmark any SQL-statement, even batch-queries
|
|
|
|
* load text files into tables
|
|
|
|
* create^1 and read dumps of tables
|
|
|
|
* export^1 data to various formats: CSV, XML, PDF, ISO/IEC 26300 -
|
|
|
|
OpenDocument Text and Spreadsheet, Word, Excel and L^AT[E]X formats
|
|
|
|
* import data and MySQL structures from Microsoft Excel and OpenDocument
|
|
|
|
spreadsheets, as well as XML, CSV, and SQL files
|
|
|
|
* administer multiple servers
|
|
|
|
* manage MySQL users and privileges
|
|
|
|
* check referential integrity in MyISAM tables
|
|
|
|
* using Query-by-example (QBE), create complex queries automatically
|
|
|
|
connecting required tables
|
|
|
|
* create PDF graphics of your Database layout
|
|
|
|
* search globally in a database or a subset of it
|
|
|
|
* transform stored data into any format using a set of predefined functions,
|
|
|
|
like displaying BLOB-data as image or download-link
|
|
|
|
* track changes on databases, tables and views
|
|
|
|
* support InnoDB tables and foreign keys (see FAQ 3.6)
|
|
|
|
* support mysqli, the improved MySQL extension (see FAQ 1.17)
|
2015-07-02 13:59:32 +02:00
|
|
|
* communicate in 57 different languages
|
2011-02-25 15:41:08 +01:00
|
|
|
* synchronize two databases residing on the same as well as remote servers
|
|
|
|
(see FAQ 9.1)
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n %{name}-%{version}-all-languages
|
2012-11-05 13:36:01 +01:00
|
|
|
## rpmlint:
|
|
|
|
# wrong-file-end-of-line-encoding
|
2015-07-02 13:59:32 +02:00
|
|
|
perl -p -i -e 's|\r\n|\n|' examples/config.manyhosts.inc.php
|
2016-05-29 17:13:39 +02:00
|
|
|
%patch0
|
2017-04-22 19:12:08 +02:00
|
|
|
%patch1
|
2011-02-25 15:41:08 +01:00
|
|
|
|
2018-04-11 20:01:52 +02:00
|
|
|
# clean up
|
|
|
|
find . -name .github -type d -prune -exec rm -r {} \;
|
|
|
|
for file in *.orig .buildinfo .gitkeep .travis.yml .weblate .jshintrc .eslintrc.json \
|
|
|
|
.php_cs.dist .scrutinizer.yml .editorconfig php_twig.h twig.c; do
|
2017-12-02 11:49:43 +01:00
|
|
|
find . -type f -name $file -delete
|
|
|
|
done
|
2011-02-25 15:41:08 +01:00
|
|
|
|
2018-04-11 20:01:52 +02:00
|
|
|
# set proper shebang
|
|
|
|
sed -i 's/env php/php/' vendor/phpmyadmin/sql-parser/bin/*-query
|
|
|
|
|
|
|
|
# permissions
|
|
|
|
find . -type d -exec chmod 755 {} \;
|
|
|
|
find . ! -name '*.sh' ! -name '*-query' -type f -exec chmod 644 {} \;
|
|
|
|
|
2011-02-25 15:41:08 +01:00
|
|
|
%build
|
|
|
|
|
|
|
|
%install
|
2013-04-09 12:04:03 +02:00
|
|
|
#%%{__install} -d -m0750 $RPM_BUILD_ROOT%%{_sysconfdir}/%%{name}
|
2015-07-02 13:59:32 +02:00
|
|
|
install -d -m0755 %{buildroot}%{ap_docroot}/%{name}
|
2017-04-01 23:31:29 +02:00
|
|
|
cp -dR *.css *.php *.ico js libraries locale themes templates vendor \
|
2015-07-02 13:59:32 +02:00
|
|
|
%{buildroot}%{ap_docroot}/%{name}
|
2011-02-25 15:41:08 +01:00
|
|
|
# install config to config dir
|
2015-07-02 13:59:32 +02:00
|
|
|
install -D -m0640 %{buildroot}%{ap_docroot}/%{name}/config.sample.inc.php \
|
|
|
|
%{buildroot}%{_sysconfdir}/%{name}/config.inc.php
|
2018-04-12 00:40:21 +02:00
|
|
|
# install TempDir
|
|
|
|
install -d -m0770 %{buildroot}%{ap_docroot}/%{name}/tmp
|
2011-02-25 15:41:08 +01:00
|
|
|
|
|
|
|
# fix libraries/vendor_config.php
|
2015-07-02 13:59:32 +02:00
|
|
|
sed -i -e "s,@docdir@,%{_docdir}/%{name},g" -e "s,@sysconfdir@,%{_sysconfdir}/%{name},g" \
|
|
|
|
%{buildroot}%{ap_docroot}/%{name}/libraries/vendor_config.php
|
2011-02-25 15:41:08 +01:00
|
|
|
# fix libraries/common.inc.php
|
2013-04-09 12:04:03 +02:00
|
|
|
#%%{__sed} -i -e "s,@PMA_Config@,%%{_sysconfdir}/%%{name}/config.inc.php,g" \
|
|
|
|
# $RPM_BUILD_ROOT%%{ap_docroot}/%%{name}/libraries/common.inc.php
|
2011-02-25 15:41:08 +01:00
|
|
|
|
|
|
|
# generate file list
|
2015-07-02 13:59:32 +02:00
|
|
|
find %{buildroot}%{ap_docroot}/%{name} -mindepth 1 -maxdepth 1 -type d | sed -e "s@$RPM_BUILD_ROOT@@" > FILELIST
|
|
|
|
find %{buildroot}%{ap_docroot}/%{name} -maxdepth 1 -type f | grep -v 'config.inc.php' | sed -e "s@$RPM_BUILD_ROOT@@" >> FILELIST
|
|
|
|
install -D -m0644 %{SOURCE3} %{buildroot}%{ap_sysconfdir}/conf.d/%{name}.conf
|
2017-03-20 23:22:05 +01:00
|
|
|
install -D -m0644 %{SOURCE4} %{buildroot}%{ap_sysconfdir}/conf.d/%{name}.inc
|
2011-02-25 15:41:08 +01:00
|
|
|
# fix paths in http config
|
2015-07-02 13:59:32 +02:00
|
|
|
sed -i -e "s,@ap_docroot@,%{ap_docroot},g" -e "s,@name@,%{name},g" \
|
2017-03-20 23:22:05 +01:00
|
|
|
-e "s,@docdir@,%{_docdir},g" -e "s,@ap_sysconfdir@,%{ap_sysconfdir},g" %{buildroot}%{ap_sysconfdir}/conf.d/%{name}.conf
|
2011-02-25 15:41:08 +01:00
|
|
|
|
|
|
|
# rpmlint stuff
|
2015-07-02 13:59:32 +02:00
|
|
|
%fdupes %{buildroot}%{ap_docroot}/%{name}/libraries
|
|
|
|
%fdupes %{buildroot}%{ap_docroot}/%{name}/themes
|
2011-02-25 15:41:08 +01:00
|
|
|
|
|
|
|
%post
|
|
|
|
# on `rpm -ivh` PARAM is 1
|
|
|
|
# on `rpm -Uvh` PARAM is 2
|
|
|
|
# set PmaAbsoluteUri ### generate blowfish secret
|
2015-07-02 13:59:32 +02:00
|
|
|
sed -i -e "s,@FQDN@,$(cat %{_sysconfdir}/HOSTNAME)," \
|
2011-02-25 15:41:08 +01:00
|
|
|
-e "s/\\\$cfg\['blowfish_secret'\] = ''/\$cfg['blowfish_secret'] = '`pwgen -s -1 46`'/" %{pma_config}
|
2015-09-17 11:49:14 +02:00
|
|
|
# enable required apache modules
|
2019-02-04 11:50:07 +01:00
|
|
|
if [ -x %{_sbindir}/a2enmod ]; then
|
2017-11-26 20:13:36 +01:00
|
|
|
a2enmod -q version || a2enmod version
|
2017-09-08 15:03:16 +02:00
|
|
|
# get installed php_version (5 or 7)
|
2017-11-26 20:13:36 +01:00
|
|
|
php_version=$(php -v | sed -n 's/^PHP\ \([[:digit:]]\+\)\..*$/\1/p')
|
|
|
|
if [[ -n ${php_version} ]] && start_apache2 -V | grep -q prefork; then
|
|
|
|
a2enmod -q "php${php_version}" || a2enmod "php${php_version}"
|
2017-09-08 15:03:16 +02:00
|
|
|
fi
|
2015-09-17 11:49:14 +02:00
|
|
|
fi
|
2015-01-06 01:36:11 +01:00
|
|
|
#systemctl try-restart apache2 &>/dev/null
|
2011-02-25 15:41:08 +01:00
|
|
|
|
2018-04-11 20:01:52 +02:00
|
|
|
#%%postun
|
2015-01-06 01:36:11 +01:00
|
|
|
#systemctl try-restart apache2 &>/dev/null
|
2011-02-25 15:41:08 +01:00
|
|
|
|
|
|
|
%files -f FILELIST
|
|
|
|
%defattr(644,root,root,755)
|
2013-05-17 10:03:09 +02:00
|
|
|
%doc ChangeLog
|
2019-02-04 11:50:07 +01:00
|
|
|
%license LICENSE
|
|
|
|
%doc README RELEASE-DATE*
|
2015-06-17 19:34:23 +02:00
|
|
|
%doc examples doc sql
|
2011-02-25 15:41:08 +01:00
|
|
|
%dir %attr(0750,root,%{ap_grp}) %{_sysconfdir}/%{name}
|
2018-04-12 00:40:21 +02:00
|
|
|
%dir %attr(0770,root,%{ap_grp}) %{ap_docroot}/%{name}/tmp
|
2011-02-25 15:41:08 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/%{name}/config.inc.php
|
|
|
|
%dir %{ap_docroot}/%{name}
|
|
|
|
%config(noreplace) %{ap_sysconfdir}/conf.d/%{name}.conf
|
2017-03-20 23:22:05 +01:00
|
|
|
%config(noreplace) %{ap_sysconfdir}/conf.d/%{name}.inc
|
2018-04-11 20:01:52 +02:00
|
|
|
%attr (755,root,root) %{ap_docroot}/%{name}/vendor/phpmyadmin/sql-parser/bin/*-query
|
2011-02-25 15:41:08 +01:00
|
|
|
|
|
|
|
%changelog
|