1 |
# Suppress find Perl libraries supplied by filter/algebra/*.p? |
2 |
%global __requires_exclude perl\\(AlgParser\\) |
3 |
%global __provides_exclude_from .php |
4 |
%global __requires_exclude_from .php |
5 |
%undefine __find_provides |
6 |
|
7 |
Summary: A course management system |
8 |
Name: moodle |
9 |
Version: 2.8.9 |
10 |
Release: %mkrel 1 |
11 |
License: GPLv2+ |
12 |
Group: System/Servers |
13 |
URL: http://moodle.org/ |
14 |
Source0: http://download.moodle.org/stable28/%{name}-%{version}.tgz |
15 |
Source1: http://download.moodle.org/langpack/2.8/en_us.zip |
16 |
Source2: moodle-config.php |
17 |
Source3: https://bitbucket.org/oasychev/moodle-plugins/downloads/preg_28.zip |
18 |
# https://moodle.org/plugins/view/qtype_oumultiresponse |
19 |
Source4: qtype_oumultiresponse_moodle29_2014111200.zip |
20 |
# https://moodle.org/plugins/view/theme_uikit |
21 |
Source5: theme_uikit_moodle28_2015031200.zip |
22 |
|
23 |
Patch0: extra-user-search-fields.patch |
24 |
Patch1: moodle-2.8.5-mathjax25.patch |
25 |
Patch2: moodle-2.8.6-pathmimetex.patch |
26 |
|
27 |
BuildRequires: unzip |
28 |
|
29 |
Requires: php-cli |
30 |
Requires: php-curl |
31 |
Requires: php-gd |
32 |
Requires: php-iconv |
33 |
Requires: php-intl |
34 |
Requires: php-ldap |
35 |
Requires: php-mbstring |
36 |
Requires: php-mysql |
37 |
Requires: php-mysqli |
38 |
Requires: php-openssl |
39 |
Requires: php-pgsql |
40 |
Requires: php-soap |
41 |
Requires: php-sockets |
42 |
Requires: php-tidy |
43 |
Requires: php-tokenizer |
44 |
Requires: php-xml |
45 |
Requires: php-xmlrpc |
46 |
Requires: php-zip |
47 |
Requires: php-zlib |
48 |
|
49 |
# local copies of the following removed from moodle's lib directory |
50 |
|
51 |
Requires: php-adodb |
52 |
# we don't have php-markdown packaged |
53 |
#Requires: php-markdown |
54 |
Requires: php-pear |
55 |
Requires: php-pear-Auth_RADIUS |
56 |
Requires: php-pear-CAS |
57 |
Requires: php-pear-Crypt_CHAP |
58 |
Requires: php-pear-HTML_Common |
59 |
Requires: php-pear-HTML_QuickForm |
60 |
Requires: php-pear-HTML_QuickForm_DHTMLRulesTableless |
61 |
Requires: php-pear-Net_GeoIP |
62 |
Requires: php-pear-OLE |
63 |
Requires: php-pear-HTTP_WebDAV_Server |
64 |
Requires: php-pear-Spreadsheet_Excel_Writer |
65 |
|
66 |
Requires: imagemagick |
67 |
Requires: gnu-free-sans-fonts |
68 |
|
69 |
Recommends: graphviz |
70 |
Recommends: ghostscript |
71 |
|
72 |
Recommends: mimetex |
73 |
Recommends: tetex-dvips |
74 |
Recommends: tetex-latex |
75 |
|
76 |
BuildArch: noarch |
77 |
|
78 |
%description |
79 |
Moodle is a learning management system for producing Internet-based course Web |
80 |
sites. It is written in PHP and is easy to install and use on Linux, Windows, |
81 |
Mac OS X, SunOS, BSD, and Netware 6. It has been designed to support modern |
82 |
pedagogies based on social constructionist theory, and includes activity |
83 |
modules such as forums, chats, resources, journals, quizzes, surveys, choices, |
84 |
workshops, glossaries, lessons, and assignments. It has been translated into |
85 |
over 70 languages, with more on the way, and supports the popular SCORM |
86 |
standard for content packaging. Moodle offers a free alternative to commercial |
87 |
software such as WebCT or Blackboard, and is being used by a growing number of |
88 |
universities, schools, and independent teachers for distance education or to |
89 |
supplement face-to-face teaching. |
90 |
|
91 |
%prep |
92 |
|
93 |
%setup -q -n %{name} |
94 |
%patch0 -p1 |
95 |
%patch1 -p1 |
96 |
%patch2 -p1 |
97 |
|
98 |
unzip -q %{SOURCE3} |
99 |
|
100 |
pushd question/type |
101 |
unzip -q %{SOURCE4} |
102 |
popd |
103 |
|
104 |
pushd lang |
105 |
unzip -q %{SOURCE1} |
106 |
popd |
107 |
|
108 |
pushd theme |
109 |
unzip -q %{SOURCE5} |
110 |
popd |
111 |
|
112 |
# clean up CVS stuff |
113 |
for i in `find . -type d -name CVS` `find . -type f -name .cvs\*` `find . -type f -name .#\*`; do |
114 |
if [ -e "$i" ]; then rm -r $i; fi >&/dev/null |
115 |
done |
116 |
|
117 |
# fix dir perms |
118 |
find . -type d -print0 | xargs --null chmod 755 |
119 |
|
120 |
# fix file perms |
121 |
find . -type f -print0 | xargs --null chmod 644 |
122 |
|
123 |
# nuke bundled stuff |
124 |
rm -rf lib/pear |
125 |
rm -f filter/tex/mimetex.* filter/tex/README.mimetex |
126 |
|
127 |
# nuke more stuff (from fedora) |
128 |
rm -f config-dist.php install.php |
129 |
|
130 |
# also from fedora: |
131 |
# Get rid of lang files in subpackages for langs not supported by moodle |
132 |
rm -f lib/phpmailer/language/phpmailer.lang-[bcdfhijnprst]* |
133 |
rm -f lib/phpmailer/language/phpmailer.lang-es.php |
134 |
|
135 |
# Drop precompiled flash |
136 |
find . -type f -name '*.swf' -delete |
137 |
|
138 |
# remove some carriage returns |
139 |
sed -i 's/\r//g' lib/*/*.txt |
140 |
|
141 |
# set some exec bits |
142 |
chmod 755 filter/algebra/algebra2tex.pl |
143 |
|
144 |
# more exec bits (from fedora) |
145 |
#find . -name \*.cgi -exec chmod 755 {} + |
146 |
chmod 755 admin/process_email.php |
147 |
chmod 755 mod/chat/chatd.php |
148 |
|
149 |
%build |
150 |
|
151 |
%install |
152 |
install -d %{buildroot}%{_webappconfdir} |
153 |
install -d %{buildroot}%{_sysconfdir}/cron.d |
154 |
install -d %{buildroot}%{_sysconfdir}/%{name} |
155 |
install -d %{buildroot}%{_var}/www/%{name} |
156 |
install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_var}/www/%{name}/config.php |
157 |
install -d %{buildroot}%{_var}/moodledata |
158 |
|
159 |
cp -aRf * %{buildroot}%{_var}/www/%{name}/ |
160 |
ln -s ../www/%{name}/lang %{buildroot}%{_var}/moodledata/lang |
161 |
rm -f %{buildroot}%{_var}/www/%{name}/COPYING.txt |
162 |
rm -f %{buildroot}%{_var}/www/%{name}/README* |
163 |
|
164 |
# apache config, based on moodle/lib/htaccess in upstream tarball |
165 |
cat > %{buildroot}%{_webappconfdir}/%{name}.conf << EOF |
166 |
|
167 |
Alias /%{name} %{_var}/www/%{name} |
168 |
|
169 |
<Directory %{_var}/www/%{name}> |
170 |
Allow from All |
171 |
|
172 |
# On some PHP servers it may help if this file is copied |
173 |
# to the main moodle directory and renamed .htaccess |
174 |
# |
175 |
# As soon as you do this, check your web site. Is it |
176 |
# still working OK? If you are getting a "configuration |
177 |
# error" then you may need to enable overrides by editing |
178 |
# the main httpd.conf for Apache and in the main server |
179 |
# or virtual server area, adding something like: |
180 |
# |
181 |
# <Directory /web/moodle> |
182 |
# AllowOverride All |
183 |
# </Directory> |
184 |
# |
185 |
|
186 |
### Firstly, if you are using Apache 2, you need the following |
187 |
### line to allow Apache to pass a PATH_INFO variable |
188 |
### correctly for URLs like http://server/file.php/arg1/arg2 |
189 |
AcceptPathInfo on |
190 |
|
191 |
### Secondly, you can define the default files in the Moodle |
192 |
### directories as follows: |
193 |
|
194 |
DirectoryIndex index.php index.html index.htm |
195 |
|
196 |
### Thirdly, set up some PHP variables that Moodle needs |
197 |
php_flag magic_quotes_gpc off |
198 |
php_flag magic_quotes_runtime off |
199 |
php_flag register_globals off |
200 |
php_flag file_uploads on |
201 |
php_flag short_open_tag on |
202 |
php_flag session.auto_start off |
203 |
php_flag session.bug_compat_warn off |
204 |
|
205 |
php_flag safe_mode off |
206 |
php_value memory_limit 512M |
207 |
php_value session.save_handler files |
208 |
|
209 |
php_value suhosin.request.max_varname_length 128 |
210 |
php_value suhosin.get.max_name_length 128 |
211 |
|
212 |
### Fourthly, sometimes Apache limits the size of uploaded files |
213 |
### (this is a separate limit to the one in PHP, see below). |
214 |
### The setting here turns off this limitation |
215 |
LimitRequestBody 0 |
216 |
|
217 |
### These are optional - you may not want to override php.ini |
218 |
### To enable them, remove the leading hash (#) |
219 |
#php_value upload_max_filesize 2M |
220 |
#php_value post_max_size 2M |
221 |
#php_value session.gc_maxlifetime 14400 |
222 |
|
223 |
### You can change the following line to point to the |
224 |
### error/index.php file in your Moodle distribution. |
225 |
### It provides a form which emails you (the admin) |
226 |
### about 404 errors (URL not found). |
227 |
#ErrorDocument 404 http://example.org/moodle/error/index.php |
228 |
|
229 |
### People have reported that these can help in some cases |
230 |
### (unusual) when you see errors about undefined functions |
231 |
#php_value auto_prepend_file none |
232 |
#php_value include_path . |
233 |
|
234 |
</Directory> |
235 |
|
236 |
<Directory %{_var}/www/%{name}/install> |
237 |
Require local |
238 |
ErrorDocument 403 "Access denied per %{_webappconfdir}/%{name}.conf" |
239 |
</Directory> |
240 |
|
241 |
<FilesMatch install.php> |
242 |
Require local |
243 |
ErrorDocument 403 "Access denied per %{_webappconfdir}/%{name}.conf" |
244 |
</FilesMatch> |
245 |
|
246 |
EOF |
247 |
|
248 |
cat > %{buildroot}%{_sysconfdir}/cron.d/%{name} << EOF |
249 |
* * * * * apache /usr/bin/php -d memory_limit=512M %{_var}/www/%{name}/admin/cli/cron.php > /dev/null |
250 |
EOF |
251 |
|
252 |
# from fedora, use some system php libs |
253 |
|
254 |
# also markdown, which we don't have packaged |
255 |
# also smarty, which does not appear to be shipped by moodle anymore |
256 |
for phplib in adodb; do |
257 |
rm -rf %{buildroot}%{_var}/www/%{name}/lib/$phplib |
258 |
ln -s %{_datadir}/php/$phplib %{buildroot}%{_var}/www/moodle/lib/$phplib |
259 |
done |
260 |
|
261 |
rm -f %{buildroot}%{_var}/www/moodle/lib/default.ttf |
262 |
ln -s %{_datadir}/fonts/gnu-free/FreeSans.ttf %{buildroot}%{_var}/www/moodle/lib/default.ttf |
263 |
|
264 |
# also php-pear-CAS |
265 |
rm -rf %{buildroot}%{_var}/www/moodle/auth/cas/CAS |
266 |
ln -s %{_datadir}/pear %{buildroot}%{_var}/www/moodle/auth/cas/CAS |
267 |
|
268 |
%files |
269 |
%defattr(-,apache,apache,-) |
270 |
%dir %{_var}/www/%{name} |
271 |
%attr(644,root,root) %config(noreplace) %{_webappconfdir}/%{name}.conf |
272 |
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/cron.d/%{name} |
273 |
%config(noreplace) %{_var}/www/%{name}/config.php |
274 |
%config(noreplace) %{_var}/www/%{name}/cache/classes/config.php |
275 |
%{_var}/www/%{name} |
276 |
%attr(2770,apache,apache) %dir %{_var}/moodledata |
277 |
%{_var}/moodledata/lang |