Andreas Stieger 2015-07-02 11:59:32 +00:00 committed by Git OBS Bridge
parent cbf35392a6
commit 65d4285cb9

View File

@ -16,8 +16,6 @@
# #
Name: phpMyAdmin
%define apxs %{_sbindir}/apxs2 %define apxs %{_sbindir}/apxs2
%define ap_sysconfdir %(%{apxs} -q SYSCONFDIR) %define ap_sysconfdir %(%{apxs} -q SYSCONFDIR)
%define ap_serverroot %(%{apxs} -q PREFIX) %define ap_serverroot %(%{apxs} -q PREFIX)
@ -30,12 +28,12 @@ Name: phpMyAdmin
%define ap_usr nobody %define ap_usr nobody
%define ap_grp nogroup %define ap_grp nogroup
%endif %endif
Name: phpMyAdmin
Version: 4.4.10
Release: 0
Summary: Administration of MySQL over the web Summary: Administration of MySQL over the web
License: GPL-2.0+ License: GPL-2.0+
Group: Productivity/Networking/Web/Frontends Group: Productivity/Networking/Web/Frontends
Version: 4.4.10
Release: 0
Url: https://www.phpMyAdmin.net/ Url: https://www.phpMyAdmin.net/
Source0: https://files.phpmyadmin.net/phpMyAdmin/4.4.10/%{name}-%{version}-all-languages.tar.bz2 Source0: https://files.phpmyadmin.net/phpMyAdmin/4.4.10/%{name}-%{version}-all-languages.tar.bz2
Source1: https://files.phpmyadmin.net/phpMyAdmin/4.4.10/%{name}-%{version}-all-languages.tar.bz2.asc Source1: https://files.phpmyadmin.net/phpMyAdmin/4.4.10/%{name}-%{version}-all-languages.tar.bz2.asc
@ -46,14 +44,8 @@ Source100: %{name}-rpmlintrc
Patch0: %{name}-config.patch Patch0: %{name}-config.patch
# Fix-SUSE: auto config for pma storage # Fix-SUSE: auto config for pma storage
Patch1: %{name}-pma.patch Patch1: %{name}-pma.patch
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: pwgen coreutils sed grep
BuildRequires: apache2-devel BuildRequires: apache2-devel
BuildRequires: python-devel BuildRequires: python-devel
%if 0%{?suse_version} > 1020
BuildRequires: fdupes
%endif
# #
Requires: mod_php_any Requires: mod_php_any
Requires: php-bz2 Requires: php-bz2
@ -64,7 +56,17 @@ Requires: php-mcrypt
Requires: php-mysql Requires: php-mysql
Requires: php-session Requires: php-session
Requires: php-zlib Requires: php-zlib
# FIXME: use proper Requires(pre/post/preun/...)
PreReq: coreutils
PreReq: grep
PreReq: pwgen
PreReq: sed
Recommends: php5-zip Recommends: php5-zip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%if 0%{?suse_version} > 1020
BuildRequires: fdupes
%endif
%description %description
phpMyAdmin can manage a whole MySQL server (needs a super-user) as well as a phpMyAdmin can manage a whole MySQL server (needs a super-user) as well as a
@ -105,7 +107,7 @@ Currently phpMyAdmin can:
%setup -q -n %{name}-%{version}-all-languages %setup -q -n %{name}-%{version}-all-languages
## rpmlint: ## rpmlint:
# wrong-file-end-of-line-encoding # wrong-file-end-of-line-encoding
%{__perl} -p -i -e 's|\r\n|\n|' examples/config.manyhosts.inc.php perl -p -i -e 's|\r\n|\n|' examples/config.manyhosts.inc.php
%patch0 %patch0
%patch1 %patch1
@ -120,32 +122,32 @@ find . -type f -name '*.orig' -exec rm {} \;
%install %install
#%%{__install} -d -m0750 $RPM_BUILD_ROOT%%{_sysconfdir}/%%{name} #%%{__install} -d -m0750 $RPM_BUILD_ROOT%%{_sysconfdir}/%%{name}
%{__install} -d -m0755 $RPM_BUILD_ROOT%{ap_docroot}/%{name} install -d -m0755 %{buildroot}%{ap_docroot}/%{name}
%{__cp} -dR *.css *.php *.ico js libraries locale themes \ cp -dR *.css *.php *.ico js libraries locale themes \
$RPM_BUILD_ROOT%{ap_docroot}/%{name} %{buildroot}%{ap_docroot}/%{name}
# install config to config dir # install config to config dir
%{__install} -D -m0640 $RPM_BUILD_ROOT%{ap_docroot}/%{name}/config.sample.inc.php \ install -D -m0640 %{buildroot}%{ap_docroot}/%{name}/config.sample.inc.php \
$RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.inc.php %{buildroot}%{_sysconfdir}/%{name}/config.inc.php
# fix libraries/vendor_config.php # fix libraries/vendor_config.php
%{__sed} -i -e "s,@docdir@,%{_docdir}/%{name},g" -e "s,@sysconfdir@,%{_sysconfdir}/%{name},g" \ sed -i -e "s,@docdir@,%{_docdir}/%{name},g" -e "s,@sysconfdir@,%{_sysconfdir}/%{name},g" \
$RPM_BUILD_ROOT%{ap_docroot}/%{name}/libraries/vendor_config.php %{buildroot}%{ap_docroot}/%{name}/libraries/vendor_config.php
# fix libraries/common.inc.php # fix libraries/common.inc.php
#%%{__sed} -i -e "s,@PMA_Config@,%%{_sysconfdir}/%%{name}/config.inc.php,g" \ #%%{__sed} -i -e "s,@PMA_Config@,%%{_sysconfdir}/%%{name}/config.inc.php,g" \
# $RPM_BUILD_ROOT%%{ap_docroot}/%%{name}/libraries/common.inc.php # $RPM_BUILD_ROOT%%{ap_docroot}/%%{name}/libraries/common.inc.php
# generate file list # generate file list
find $RPM_BUILD_ROOT%{ap_docroot}/%{name} -mindepth 1 -maxdepth 1 -type d | sed -e "s@$RPM_BUILD_ROOT@@" > FILELIST find %{buildroot}%{ap_docroot}/%{name} -mindepth 1 -maxdepth 1 -type d | sed -e "s@$RPM_BUILD_ROOT@@" > FILELIST
find $RPM_BUILD_ROOT%{ap_docroot}/%{name} -maxdepth 1 -type f | grep -v 'config.inc.php' | 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 %{S:3} $RPM_BUILD_ROOT%{ap_sysconfdir}/conf.d/%{name}.conf install -D -m0644 %{SOURCE3} %{buildroot}%{ap_sysconfdir}/conf.d/%{name}.conf
# fix paths in http config # fix paths in http config
%{__sed} -i -e "s,@ap_docroot@,%{ap_docroot},g" -e "s,@name@,%{name},g" \ sed -i -e "s,@ap_docroot@,%{ap_docroot},g" -e "s,@name@,%{name},g" \
-e "s,@docdir@,%{_docdir},g" $RPM_BUILD_ROOT%{ap_sysconfdir}/conf.d/%{name}.conf -e "s,@docdir@,%{_docdir},g" %{buildroot}%{ap_sysconfdir}/conf.d/%{name}.conf
# rpmlint stuff # rpmlint stuff
%if 0%{?suse_version} > 1020 %if 0%{?suse_version} > 1020
%fdupes ${RPM_BUILD_ROOT}%{ap_docroot}/%{name}/libraries %fdupes %{buildroot}%{ap_docroot}/%{name}/libraries
%fdupes ${RPM_BUILD_ROOT}%{ap_docroot}/%{name}/themes %fdupes %{buildroot}%{ap_docroot}/%{name}/themes
%endif %endif
# Fix python-bytecode-inconsistent-mtime # Fix python-bytecode-inconsistent-mtime
@ -158,7 +160,7 @@ popd
# on `rpm -ivh` PARAM is 1 # on `rpm -ivh` PARAM is 1
# on `rpm -Uvh` PARAM is 2 # on `rpm -Uvh` PARAM is 2
# set PmaAbsoluteUri ### generate blowfish secret # set PmaAbsoluteUri ### generate blowfish secret
%{__sed} -i -e "s,@FQDN@,$(cat /etc/HOSTNAME)," \ sed -i -e "s,@FQDN@,$(cat %{_sysconfdir}/HOSTNAME)," \
-e "s/\\\$cfg\['blowfish_secret'\] = ''/\$cfg['blowfish_secret'] = '`pwgen -s -1 46`'/" %{pma_config} -e "s/\\\$cfg\['blowfish_secret'\] = ''/\$cfg['blowfish_secret'] = '`pwgen -s -1 46`'/" %{pma_config}
%if 0%{?suse_version} < 1310 %if 0%{?suse_version} < 1310
%restart_on_update apache2 %restart_on_update apache2
@ -173,9 +175,6 @@ popd
#systemctl try-restart apache2 &>/dev/null #systemctl try-restart apache2 &>/dev/null
%endif %endif
%clean
%{__rm} -rf $RPM_BUILD_ROOT
%files -f FILELIST %files -f FILELIST
%defattr(644,root,root,755) %defattr(644,root,root,755)
%doc ChangeLog %doc ChangeLog