# $Id: smeserver-moodle.spec,v 1.6 2008/06/02 09:25:24 dungog Exp $ # Authority: dungog # Name: Stephen Noble %define name smeserver-moodle %define version 1.0 %define release 7 Summary: smserver rpm to setup moodle, a course management system Name: %{name} Version: %{version} Release: %{release}%{?dist} License: GNU GPL version 2 URL: http://www.dungog.net/sme Group: SMEserver/addon Source: %{name}-%{version}.tar.gz Patch0: smeserver-moodle-1.0-null.patch Patch1: smeserver-moodle-1.0-20db.patch2 Patch2: smeserver-moodle-1.0-clamscan.patch Patch3: smeserver-moodle-1.0-191.patch Patch4: smeserver-moodle-1.0-191fix.patch BuildArchitectures: noarch BuildRequires: e-smith-devtools >= 1.13.1-03 BuildRoot: /var/tmp/%{name}-%{version} Requires: e-smith-release >= 7.0 Requires: moodle >= 1.9 Requires: gd AutoReqProv: no %description smserver rpm to setup moodle, a course management system %changelog * Mon Jun 2 2008 Stephen Noble 1.0-7 - fix syntax error * Mon Jun 2 2008 Stephen Noble 1.0-6 - update config.php file to 1.9.1 * Mon Jun 2 2008 Stephen Noble 1.0-5 - allow clamscan [SME 4369] * Sun Sep 2 2007 Stephen Noble 1.0-4 - 20db patch fixed * Sun Sep 2 2007 Stephen Noble 1.0-3 - crontab redirect to null not nul - remove 20db patch * Sun Jul 29 2007 Stephen Noble 1.0-2 - 20db template fixed * Fri Jul 06 2007 Stephen Noble 1.0-1 - http alias, auto setup, template config.php * Mon Dec 11 2006 Stephen Noble - rpm %post events reordered, to enable clean install - [0.9-2] * Fri Dec 1 2006 Stephen Noble - initial release - [0.9-1] %prep %setup %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %build mkdir -p root/etc/e-smith/db/accounts/defaults/moodle echo "reserved" > root/etc/e-smith/db/accounts/defaults/moodle/type mkdir -p root/etc/e-smith/db/configuration/defaults/moodle echo "Online Learning" > root/etc/e-smith/db/configuration/defaults/moodle/Name echo "global-pw-remote" > root/etc/e-smith/db/configuration/defaults/moodle/PublicAccess echo "enabled" > root/etc/e-smith/db/configuration/defaults/moodle/status echo "moodle" > root/etc/e-smith/db/configuration/defaults/moodle/DbName echo "moodle" > root/etc/e-smith/db/configuration/defaults/moodle/DbUser mkdir -p root/etc/e-smith/templates.metadata/etc/e-smith/sql/init echo "PERMS=0750" > root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/80moodle #only needed so it is removed afterwards mkdir -p root/opt/moodle/html touch root/opt/moodle/html/config.php %install rm -rf $RPM_BUILD_ROOT (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) rm -f %{name}-%{version}-filelist /sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist echo "%doc COPYING" >> %{name}-%{version}-filelist %clean cd .. rm -rf %{name}-%{version} %pre %preun %post /etc/e-smith/events/actions/initialize-default-databases /sbin/e-smith/expand-template /etc/e-smith/sql/init/80moodle /etc/rc.d/init.d/mysql.init start /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf /sbin/e-smith/expand-template /opt/moodle/html/config.php /usr/bin/sv h /service/httpd-e-smith /sbin/e-smith/expand-template /etc/crontab echo "" echo "see http://wiki.contribs.org/moodle" %postun #uninstall if [ $1 = 0 ] ; then /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf /usr/bin/sv h /service/httpd-e-smith /sbin/e-smith/expand-template /etc/crontab fi %files -f %{name}-%{version}-filelist %defattr(-,root,root)