%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} %global pkgname phpMyAdmin %global pkgnameV phpMyAdmin47 # If php-mcrypt is available, it should be preferred. Otherwise the pure # phpseclib alternative alternative can be used externally or internally. %global mcrypt 1 %global seclib 0 # Having below mentioned separate projects externally or only internally? %global gettext 0 # getext included in php common since php55 %global tcpdf 0 %global optdatadir /opt Summary: Handle the administration of MySQL over the World Wide Web Name: phpMyAdmin47 Version: 4.7.6 Release: 1%{?dist} License: GPLv2+ Group: Applications/Internet URL: https://www.phpmyadmin.net/ Source0: https://files.phpmyadmin.net/%{pkgname}/%{version}/%{pkgname}-%{version}-all-languages.tar.xz Source1: https://files.phpmyadmin.net/%{pkgname}/%{version}/%{pkgname}-%{version}-all-languages.tar.xz.asc Source2: phpMyAdmin-config.inc.php Source3: phpMyAdmin.htaccess #Patch0: phpMyAdmin-4.0.10-remove-flash.patch #Patch1: phpMyAdmin-4.0.10.17-system-phpseclib.patch # Optional (and partially redundant) runtime requirements: php-bcmath, php-gmp, php-recode, php-soap Requires: php55-php >= 5.5, php55-php-filter, php55-php-xmlwriter Requires: webserver, php55-php-bz2, php55-php-ctype, php55-php-curl, php55-php-date, php55-php-gd, php55-php-hash, php55-php-iconv Requires: php55-php-json, php55-php-libxml, php55-php-mbstring, php55-php-mysqli, php55-php-pcre, php55-php-session, php55-php-simplexml Requires: php55-php-spl, php55-php-zip, php55-php-zlib Requires: php56-php >= 5.5, php56-php-filter, php56-php-xmlwriter Requires: webserver, php56-php-bz2, php56-php-ctype, php56-php-curl, php56-php-date, php56-php-gd, php56-php-hash, php56-php-iconv Requires: php56-php-json, php56-php-libxml, php56-php-mbstring, php56-php-mysqli, php56-php-pcre, php56-php-session, php56-php-simplexml Requires: php56-php-spl, php56-php-zip, php56-php-zlib Requires: php70-php >= 5.5, php70-php-filter, php70-php-xmlwriter Requires: webserver, php70-php-bz2, php70-php-ctype, php70-php-curl, php70-php-date, php70-php-gd, php70-php-hash, php70-php-iconv Requires: php70-php-json, php70-php-libxml, php70-php-mbstring, php70-php-mysqli, php70-php-pcre, php70-php-session, php70-php-simplexml Requires: php70-php-spl, php70-php-zip, php70-php-zlib Requires: php71-php >= 5.5, php71-php-filter, php71-php-xmlwriter Requires: webserver, php71-php-bz2, php71-php-ctype, php71-php-curl, php71-php-date, php71-php-gd, php71-php-hash, php71-php-iconv Requires: php71-php-json, php71-php-libxml, php71-php-mbstring, php71-php-mysqli, php71-php-pcre, php71-php-session, php71-php-simplexml Requires: php71-php-spl, php71-php-zip, php71-php-zlib %if 0%{?mcrypt} Requires: php55-php-mcrypt Requires: php56-php-mcrypt Requires: php70-php-mcrypt Requires: php71-php-mcrypt %else %if 0%{?seclib} Requires: php55-php-phpseclib-crypt-aes %endif %endif %if 0%{?gettext} Requires: php55-php-gettext %endif # Optional runtime requirements for tcpdf: php-openssl, php-tidy (usually not required in phpMyAdmin) %if 0%{?tcpdf} Requires: php55-php-tcpdf, php55-php-tcpdf-dejavu-sans-fonts %endif Provides: phpMyAdmin47 = %{version}-%{release} BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description phpMyAdmin is a tool written in PHP intended to handle the administration of MySQL over the World Wide Web. Most frequently used operations are supported by the user interface (managing databases, tables, fields, relations, indexes, users, permissions), while you still have the ability to directly execute any SQL statement. Features include an intuitive web interface, support for most MySQL features (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, manage MySQL users and privileges, manage stored procedures and triggers), import data from CSV and SQL, export data to various formats: CSV, SQL, XML, PDF, OpenDocument Text and Spreadsheet, Word, Excel, LATEX and others, administering multiple servers, creating PDF graphics of your database layout, creating complex queries using Query-by-example (QBE), searching globally in a database or a subset of it, transforming stored data into any format using a set of predefined functions, like displaying BLOB-data as image or download-link and much more... %prep %setup -q -n %{pkgname}-%{version}-all-languages #%patch0 -p1 #%patch1 -p1 # Setup vendor config file sed -e "/'CHANGELOG_FILE'/s@./ChangeLog@%{_pkgdocdir}/ChangeLog@" \ -e "/'LICENSE_FILE'/s@./LICENSE@%{_pkgdocdir}/LICENSE@" \ -e "/'CONFIG_DIR'/s@''@'%{_sysconfdir}/%{pkgnameV}/'@" \ -e "/'SETUP_CONFIG_FILE'/s@./config/config.inc.php@%{_localstatedir}/lib/%{pkgnameV}/config/config.inc.php@" \ %if 0%{?gettext} -e "/'GETTEXT_INC'/s@./libraries/php-gettext/gettext.inc@%{_datadir}/php/gettext/gettext.inc@" \ %endif %if 0%{?tcpdf} -e "/'TCPDF_INC'/s@./libraries/tcpdf/tcpdf.php@%{_datadir}/php/tcpdf/tcpdf.php@" \ %endif %if 0%{?mcrypt}%{?seclib} -e "/'PHPSECLIB_INC_DIR'/s@./libraries/phpseclib@%{_datadir}/pear@" \ %endif -i libraries/vendor_config.php # Remove bundled libraries %if 0%{?gettext} rm -rf libraries/php-gettext/ %endif %if 0%{?tcpdf} rm -rf libraries/tcpdf/ %endif %if 0%{?mcrypt}%{?seclib} rm -rf libraries/phpseclib/ %endif # Remove sources of JavaScript library rm -rf js/jquery/src/ # Remove files related to Flash file (*.swf) rm -f js/canvg/flashcanvas.{js,swf} %build %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT{%{optdatadir}/%{pkgnameV},%{_sysconfdir}/{httpd/conf.d,%{pkgnameV}}}/ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{pkgnameV}/{upload,save,config}/ cp -ad * $RPM_BUILD_ROOT%{optdatadir}/%{pkgnameV}/ install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{pkgnameV}.conf install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/%{pkgnameV}/config.inc.php rm -f $RPM_BUILD_ROOT%{optdatadir}/%{pkgnameV}/{[CDLR]*,*.txt,config.sample.inc.php} rm -rf $RPM_BUILD_ROOT%{optdatadir}/%{pkgnameV}/{doc,examples}/ rm -f doc/html/.buildinfo mkdir -p $RPM_BUILD_ROOT%{optdatadir}/%{pkgnameV}/doc/ ln -s ../../..%{_pkgdocdir}/html/ $RPM_BUILD_ROOT%{optdatadir}/%{pkgnameV}/doc/html mv -f config.sample.inc.php examples/ %clean rm -rf $RPM_BUILD_ROOT %post # Generate a secret key for this installation sed -e "/'blowfish_secret'/s/MUSTBECHANGEDONINSTALL/$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)/" \ -i %{_sysconfdir}/%{pkgnameV}/config.inc.php %files %defattr(-,root,root,-) %doc ChangeLog README LICENSE doc/html/ examples/ %{optdatadir}/%{pkgnameV}/ %dir %attr(0750,root,apache) %{_sysconfdir}/%{pkgnameV}/ %config(noreplace) %attr(0640,root,apache) %{_sysconfdir}/%{pkgnameV}/config.inc.php %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{pkgnameV}.conf %dir %{_localstatedir}/lib/%{pkgnameV}/ %dir %attr(0750,apache,apache) %{_localstatedir}/lib/%{pkgnameV}/upload/ %dir %attr(0750,apache,apache) %{_localstatedir}/lib/%{pkgnameV}/save/ %dir %attr(0750,apache,apache) %{_localstatedir}/lib/%{pkgnameV}/config/ %changelog * Wed Dec 06 2017 Jean-Philipe Pialasse 4.7.6-1.sme - import newer version of phpmyadmin [SME: 10474] - using upstream epel spec file for this fork