# Suppress find Perl libraries supplied by filter/algebra/*.p? %global __requires_exclude perl\\(AlgParser\\) %global __provides_exclude_from .php %global __requires_exclude_from .php %undefine __find_provides Summary: A course management system Name: moodle Version: 2.8.6 Release: %mkrel 1 License: GPLv2+ Group: System/Servers URL: http://moodle.org/ Source0: http://download.moodle.org/stable28/%{name}-%{version}.tgz Source1: http://download.moodle.org/langpack/2.8/en_us.zip Source2: moodle-config.php Source3: http://oasychev-moodle-plugins.googlecode.com/files/preg_27.zip Patch0: extra-user-search-fields.patch Patch1: moodle-2.8.5-mathjax25.patch Patch2: moodle-2.8.6-pathmimetex.patch BuildRequires: unzip Requires: php-cli Requires: php-curl Requires: php-gd Requires: php-iconv Requires: php-intl Requires: php-ldap Requires: php-mbstring Requires: php-mysql Requires: php-mysqli Requires: php-openssl Requires: php-pgsql Requires: php-soap Requires: php-sockets Requires: php-tidy Requires: php-tokenizer Requires: php-xml Requires: php-xmlrpc Requires: php-zip Requires: php-zlib # local copies of the following removed from moodle's lib directory Requires: php-adodb # we don't have php-markdown packaged #Requires: php-markdown Requires: php-pear Requires: php-pear-Auth_RADIUS Requires: php-pear-CAS Requires: php-pear-Crypt_CHAP Requires: php-pear-HTML_Common Requires: php-pear-HTML_QuickForm Requires: php-pear-HTML_QuickForm_DHTMLRulesTableless Requires: php-pear-Net_GeoIP Requires: php-pear-OLE Requires: php-pear-HTTP_WebDAV_Server Requires: php-pear-Spreadsheet_Excel_Writer Requires: imagemagick Requires: gnu-free-sans-fonts Recommends: graphviz Recommends: ghostscript Recommends: mimetex Recommends: tetex-dvips Recommends: tetex-latex BuildArch: noarch %description Moodle is a learning management system for producing Internet-based course Web sites. It is written in PHP and is easy to install and use on Linux, Windows, Mac OS X, SunOS, BSD, and Netware 6. It has been designed to support modern pedagogies based on social constructionist theory, and includes activity modules such as forums, chats, resources, journals, quizzes, surveys, choices, workshops, glossaries, lessons, and assignments. It has been translated into over 70 languages, with more on the way, and supports the popular SCORM standard for content packaging. Moodle offers a free alternative to commercial software such as WebCT or Blackboard, and is being used by a growing number of universities, schools, and independent teachers for distance education or to supplement face-to-face teaching. %prep %setup -q -n %{name} %patch0 -p1 %patch1 -p1 %patch2 -p1 unzip -q %{SOURCE3} pushd lang unzip -q %{SOURCE1} popd # clean up CVS stuff for i in `find . -type d -name CVS` `find . -type f -name .cvs\*` `find . -type f -name .#\*`; do if [ -e "$i" ]; then rm -r $i; fi >&/dev/null done # fix dir perms find . -type d -print0 | xargs --null chmod 755 # fix file perms find . -type f -print0 | xargs --null chmod 644 # nuke bundled stuff rm -rf lib/pear rm -f filter/tex/mimetex.* filter/tex/README.mimetex # nuke more stuff (from fedora) rm -f config-dist.php install.php # also from fedora: # Get rid of lang files in subpackages for langs not supported by moodle rm -f lib/phpmailer/language/phpmailer.lang-[bcdfhijnprst]* rm -f lib/phpmailer/language/phpmailer.lang-es.php # Drop precompiled flash find . -type f -name '*.swf' -delete # remove some carriage returns sed -i 's/\r//g' lib/*/*.txt # set some exec bits chmod 755 filter/algebra/algebra2tex.pl # more exec bits (from fedora) #find . -name \*.cgi -exec chmod 755 {} + chmod 755 admin/process_email.php chmod 755 mod/chat/chatd.php %build %install install -d %{buildroot}%{_webappconfdir} install -d %{buildroot}%{_sysconfdir}/cron.d install -d %{buildroot}%{_sysconfdir}/%{name} install -d %{buildroot}%{_var}/www/%{name} install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_var}/www/%{name}/config.php install -d %{buildroot}%{_var}/moodledata cp -aRf * %{buildroot}%{_var}/www/%{name}/ ln -s ../www/%{name}/lang %{buildroot}%{_var}/moodledata/lang rm -f %{buildroot}%{_var}/www/%{name}/COPYING.txt rm -f %{buildroot}%{_var}/www/%{name}/README* # apache config, based on moodle/lib/htaccess in upstream tarball cat > %{buildroot}%{_webappconfdir}/%{name}.conf << EOF Alias /%{name} %{_var}/www/%{name} <Directory %{_var}/www/%{name}> Allow from All # On some PHP servers it may help if this file is copied # to the main moodle directory and renamed .htaccess # # As soon as you do this, check your web site. Is it # still working OK? If you are getting a "configuration # error" then you may need to enable overrides by editing # the main httpd.conf for Apache and in the main server # or virtual server area, adding something like: # # <Directory /web/moodle> # AllowOverride All # </Directory> # ### Firstly, if you are using Apache 2, you need the following ### line to allow Apache to pass a PATH_INFO variable ### correctly for URLs like http://server/file.php/arg1/arg2 AcceptPathInfo on ### Secondly, you can define the default files in the Moodle ### directories as follows: DirectoryIndex index.php index.html index.htm ### Thirdly, set up some PHP variables that Moodle needs php_flag magic_quotes_gpc off php_flag magic_quotes_runtime off php_flag register_globals off php_flag file_uploads on php_flag short_open_tag on php_flag session.auto_start off php_flag session.bug_compat_warn off php_flag safe_mode off php_value memory_limit 512M php_value session.save_handler files php_value suhosin.request.max_varname_length 128 php_value suhosin.get.max_name_length 128 ### Fourthly, sometimes Apache limits the size of uploaded files ### (this is a separate limit to the one in PHP, see below). ### The setting here turns off this limitation LimitRequestBody 0 ### These are optional - you may not want to override php.ini ### To enable them, remove the leading hash (#) #php_value upload_max_filesize 2M #php_value post_max_size 2M #php_value session.gc_maxlifetime 14400 ### You can change the following line to point to the ### error/index.php file in your Moodle distribution. ### It provides a form which emails you (the admin) ### about 404 errors (URL not found). #ErrorDocument 404 http://example.org/moodle/error/index.php ### People have reported that these can help in some cases ### (unusual) when you see errors about undefined functions #php_value auto_prepend_file none #php_value include_path . </Directory> <Directory %{_var}/www/%{name}/install> Require local ErrorDocument 403 "Access denied per %{_webappconfdir}/%{name}.conf" </Directory> <FilesMatch install.php> Require local ErrorDocument 403 "Access denied per %{_webappconfdir}/%{name}.conf" </FilesMatch> EOF cat > %{buildroot}%{_sysconfdir}/cron.d/%{name} << EOF * * * * * apache /usr/bin/php -d memory_limit=512M %{_var}/www/%{name}/admin/cli/cron.php > /dev/null EOF # from fedora, use some system php libs # also markdown, which we don't have packaged # also smarty, which does not appear to be shipped by moodle anymore for phplib in adodb; do rm -rf %{buildroot}%{_var}/www/%{name}/lib/$phplib ln -s %{_datadir}/php/$phplib %{buildroot}%{_var}/www/moodle/lib/$phplib done rm -f %{buildroot}%{_var}/www/moodle/lib/default.ttf ln -s %{_datadir}/fonts/gnu-free/FreeSans.ttf %{buildroot}%{_var}/www/moodle/lib/default.ttf # also php-pear-CAS rm -rf %{buildroot}%{_var}/www/moodle/auth/cas/CAS ln -s %{_datadir}/pear %{buildroot}%{_var}/www/moodle/auth/cas/CAS %files %defattr(-,apache,apache,-) %dir %{_var}/www/%{name} %config(noreplace) %{_webappconfdir}/%{name}.conf %attr(644,root,root) %config(noreplace) %{_sysconfdir}/cron.d/%{name} %config(noreplace) %{_var}/www/%{name}/config.php %config(noreplace) %{_var}/www/%{name}/cache/classes/config.php %{_var}/www/%{name} %attr(2770,apache,apache) %dir %{_var}/moodledata %{_var}/moodledata/lang %changelog * Mon May 11 2015 luigiwalser <luigiwalser> 2.8.6-1.mga5 + Revision: 821873 - 2.8.6 - update en_us.zip - add patches to fix mathjax and mimetex support (Giuseppe Ghibo) * Mon Mar 16 2015 luigiwalser <luigiwalser> 2.8.5-1.mga5 + Revision: 818651 - 2.8.5 * Mon Feb 09 2015 luigiwalser <luigiwalser> 2.8.3-1.mga5 + Revision: 814426 - 2.8.3 * Mon Jan 19 2015 luigiwalser <luigiwalser> 2.8.2-1.mga5 + Revision: 811507 - 2.8.2 * Wed Jan 07 2015 luigiwalser <luigiwalser> 2.8.1-2.mga5 + Revision: 808899 - change database driver in default config to mariadb to work with mariadb * Thu Nov 20 2014 luigiwalser <luigiwalser> 2.8.1-1.mga5 + Revision: 797953 - 2.8.1 - remove upstreamed patch 1 - update en_us.zip - update preg and associated plugins from http://moodle.org/plugins/ - php-pear-XML_Parser is no longer used - suggests graphviz and ghostscript for new functionality in 2.7/2.8 - remove pre-compiled Flash files (as was done in fedora) - use cron.d file to run cron every minute as recommended upstream * Thu Nov 13 2014 luigiwalser <luigiwalser> 2.6.6-1.mga5 + Revision: 796871 - 2.6.6 * Wed Oct 15 2014 umeabot <umeabot> 2.6.5-3.mga5 + Revision: 743595 - Second Mageia 5 Mass Rebuild * Tue Sep 16 2014 umeabot <umeabot> 2.6.5-2.mga5 + Revision: 682596 - Mageia 5 Mass Rebuild + tv <tv> - auto convert _exclude_files_from_autoreq - use %%global for req/prov exclude - autoconvert to new prov/req excludes - s/uggests:/Recommends:/ * Tue Sep 09 2014 luigiwalser <luigiwalser> 2.6.5-1.mga5 + Revision: 674256 - 2.6.5 - remove aspell requirement * Fri Jul 18 2014 luigiwalser <luigiwalser> 2.6.4-1.mga5 + Revision: 653563 - 2.6.4 * Mon May 12 2014 luigiwalser <luigiwalser> 2.6.3-1.mga5 + Revision: 622248 - 2.6.3 - 2.6.2 - updated to newest version of preg plugin - remove upstreamed portion of poasquestion-null-string patch - remove upstreamed block-formal-langs-install patch - increase php memory_limit to 512M * Wed Mar 12 2014 luigiwalser <luigiwalser> 2.4.9-1.mga5 + Revision: 602706 - 2.4.9 * Wed Feb 05 2014 luigiwalser <luigiwalser> 2.4.8-1.mga5 + Revision: 583565 - 2.4.8 - fix review preg quiz question attempt with null response (from Oleg Sychev) * Wed Nov 13 2013 luigiwalser <luigiwalser> 2.4.7-1.mga4 + Revision: 551057 - 2.4.7 * Sat Oct 19 2013 umeabot <umeabot> 2.4.6-2.mga4 + Revision: 534369 - Mageia 4 Mass Rebuild * Tue Sep 10 2013 luigiwalser <luigiwalser> 2.4.6-1.mga4 + Revision: 477366 - 2.4.6 - remove CVE-2012-6087 patch (fixed upstream) * Wed Jul 10 2013 luigiwalser <luigiwalser> 2.4.5-1.mga4 + Revision: 452574 - 2.4.5 * Fri May 31 2013 luigiwalser <luigiwalser> 2.4.4-2.mga4 + Revision: 433880 - fix new moodle installations with preg plugin (from Oleg Sychev) * Tue May 21 2013 luigiwalser <luigiwalser> 2.4.4-1.mga4 + Revision: 413594 - 2.4.4 * Fri Apr 05 2013 luigiwalser <luigiwalser> 2.4.3-1.mga3 + Revision: 408318 - imported package moodle