1 |
Summary: smserver rpm to setup moodle, a course management system |
2 |
%define name smeserver-moodle |
3 |
Name: %{name} |
4 |
%define version 0.9 |
5 |
%define release 2 |
6 |
Version: %{version} |
7 |
Release: %{release} |
8 |
Distribution: SME Server |
9 |
Copyright: GPL |
10 |
URL: http://www.dungog.net/sme |
11 |
Group: SMEserver/addon |
12 |
Source: %{name}-%{version}.tar.gz |
13 |
Packager: Stephen Noble <support@dungog.net> |
14 |
BuildArchitectures: noarch |
15 |
BuildRoot: /var/tmp/%{name}-%{version} |
16 |
Requires: e-smith-release >= 7.0 |
17 |
Requires: moodle |
18 |
Requires: gd |
19 |
AutoReqProv: no |
20 |
|
21 |
%description |
22 |
smserver rpm to setup moodle, a course management system |
23 |
|
24 |
%changelog |
25 |
* Mon Dec 11 2006 Stephen Noble <support@dungog.net> |
26 |
- rpm %post events reordered, to enable clean install |
27 |
- [0.9-2] |
28 |
|
29 |
* Fri Dec 1 2006 Stephen Noble <support@dungog.net> |
30 |
- initial release |
31 |
- [0.9-1] |
32 |
|
33 |
%prep |
34 |
%setup |
35 |
|
36 |
%build |
37 |
#perl createlinks |
38 |
mkdir -p root/etc/e-smith/db/accounts/defaults/moodle |
39 |
echo "reserved" > root/etc/e-smith/db/accounts/defaults/moodle/type |
40 |
|
41 |
mkdir -p root/etc/e-smith/db/configuration/defaults/moodle |
42 |
echo "Online Learning" > root/etc/e-smith/db/configuration/defaults/moodle/Name |
43 |
echo "global-pw-remote" > root/etc/e-smith/db/configuration/defaults/moodle/PublicAccess |
44 |
|
45 |
%install |
46 |
rm -rf $RPM_BUILD_ROOT |
47 |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
48 |
rm -f %{name}-%{version}-filelist |
49 |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist |
50 |
echo "%doc COPYING" >> %{name}-%{version}-filelist |
51 |
|
52 |
%clean |
53 |
cd .. |
54 |
rm -rf %{name}-%{version} |
55 |
|
56 |
%pre |
57 |
|
58 |
%preun |
59 |
|
60 |
%post |
61 |
/etc/e-smith/events/actions/initialize-default-databases |
62 |
/sbin/e-smith/expand-template /etc/e-smith/sql/init/80moodle.sql |
63 |
/etc/rc.d/init.d/mysql.init start |
64 |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
65 |
/usr/local/bin/svc -h /service/httpd-e-smith |
66 |
/sbin/e-smith/expand-template /etc/crontab |
67 |
|
68 |
echo "" |
69 |
echo "see www.dungog.net/sme/webapp.php" |
70 |
echo "current settings, config show moodle ..." |
71 |
/sbin/e-smith/config show moodle |
72 |
|
73 |
%postun |
74 |
#uninstall |
75 |
if [ $1 = 0 ] ; then |
76 |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
77 |
/usr/local/bin/svc -h /service/httpd-e-smith |
78 |
/sbin/e-smith/expand-template /etc/crontab |
79 |
fi |
80 |
|
81 |
%files -f %{name}-%{version}-filelist |
82 |
%defattr(-,root,root) |
83 |
|