1 |
unnilennium |
1.1 |
Summary: Enables user web spave on the e-smith server and gateway. |
2 |
|
|
%define name smeserver-user-webspace |
3 |
|
|
Name: %{name} |
4 |
|
|
%define version 0.1 |
5 |
unnilennium |
1.2 |
%define release 6 |
6 |
unnilennium |
1.1 |
Version: %{version} |
7 |
unnilennium |
1.2 |
Release: %{release}%{dist} |
8 |
|
|
License: GPL |
9 |
unnilennium |
1.1 |
Group: Networking/Daemons |
10 |
|
|
Source: %{name}-%{version}.tar.gz |
11 |
|
|
Patch0: %{name}-%{version}.patch0 |
12 |
|
|
Patch1: %{name}-%{version}.patch1 |
13 |
|
|
Patch2: %{name}-%{version}.patch2 |
14 |
unnilennium |
1.2 |
Patch3: smeserver-user-webspace-0.1.patch3 |
15 |
unnilennium |
1.1 |
Packager: Jean-Philippe Pialasse <unnilennium@pialasse.com> |
16 |
|
|
BuildRoot: /var/tmp/e-smith-buildroot |
17 |
|
|
BuildArchitectures: noarch |
18 |
unnilennium |
1.2 |
Requires: smeserver-release >= 8.0 |
19 |
unnilennium |
1.1 |
AutoReqProv: no |
20 |
unnilennium |
1.2 |
BuildRequires: e-smith-devtools |
21 |
|
|
|
22 |
|
|
%changelog |
23 |
|
|
* Sun Oct 27 2013 Jean-Philippe Pialasse <tests@pialasse.com> 0.1-6.sme |
24 |
|
|
- initial import for sme8 |
25 |
|
|
|
26 |
|
|
* Fri Sep 08 2006 Jean-Philippe Pialasse <unnilennium@pialasse.com> |
27 |
|
|
- adaptation ot the contrib to the SME 7 architecture |
28 |
|
|
* Thu Nov 23 2000 Damien Curtain <damien@pagefault.org> |
29 |
|
|
- Moved the userdir template into templates-custom, utilising |
30 |
|
|
- a new feature of e-smith-4.0.1 and greater. |
31 |
|
|
|
32 |
|
|
* Wed Nov 22 2000 Damien Curtain <damien@pagefault.org> |
33 |
|
|
- Added new templates. Added then removed;) ability to |
34 |
|
|
- set userdir. Added www/user aliases. Post install script |
35 |
|
|
- to prompt people to turn this on/off. |
36 |
|
|
|
37 |
|
|
* Tue Nov 21 2000 Paul Nesbit <pkn@e-smith.com> |
38 |
|
|
- initial release |
39 |
unnilennium |
1.1 |
|
40 |
|
|
%description |
41 |
|
|
Enables the e-smith server and gateway to host user web pages |
42 |
|
|
from their home directories. Simply create a public_html directory |
43 |
|
|
inside your ~/home/ directory and any web pages placed there in |
44 |
|
|
will be available via the urls http://www/~user and http://www/user. |
45 |
|
|
|
46 |
|
|
%prep |
47 |
|
|
%setup |
48 |
|
|
rm createlinks |
49 |
|
|
rm -r root/etc/e-smith/events |
50 |
|
|
rm root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess50UserDir00 |
51 |
|
|
|
52 |
|
|
%patch0 -p1 |
53 |
|
|
rm root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/50UserDir00 |
54 |
|
|
%patch1 -p1 |
55 |
|
|
%patch2 -p1 |
56 |
unnilennium |
1.2 |
%patch3 -p1 |
57 |
unnilennium |
1.1 |
|
58 |
|
|
%build |
59 |
|
|
|
60 |
|
|
%install |
61 |
|
|
rm -rf $RPM_BUILD_ROOT |
62 |
|
|
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
63 |
|
|
rm -f %{name}-%{version}-filelist |
64 |
|
|
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist |
65 |
|
|
|
66 |
|
|
%clean |
67 |
|
|
rm -rf $RPM_BUILD_ROOT |
68 |
|
|
|
69 |
|
|
%pre |
70 |
|
|
%preun |
71 |
|
|
%post |
72 |
|
|
if [ $1 = 1 ] ; then |
73 |
|
|
enable_user_webspace() { |
74 |
|
|
|
75 |
unnilennium |
1.2 |
# echo 'You now have the option to enable user web directories.' |
76 |
|
|
# echo |
77 |
|
|
# echo -n 'Would you like to enable User Directories? (y/N): ' |
78 |
|
|
# |
79 |
|
|
# read choice < /dev/tty |
80 |
|
|
# |
81 |
|
|
# if [ x$choice = xy ] ; then |
82 |
|
|
# /sbin/e-smith/config set UserPublicWeb service status on |
83 |
|
|
# /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
84 |
|
|
# service httpd-e-smith restart |
85 |
|
|
# elif [ x$choice = xY ] ; then |
86 |
|
|
# /sbin/e-smith/config set UserPublicWeb service status on |
87 |
|
|
# /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
88 |
|
|
# service httpd-e-smith restart |
89 |
|
|
# else |
90 |
|
|
# /sbin/e-smith/config set UserPublicWeb service status off |
91 |
|
|
# fi |
92 |
|
|
# |
93 |
|
|
# echo "adding html folder in user skeleton" |
94 |
|
|
# mkdir -p /etc/e-smith/skel/user/home/public_html |
95 |
unnilennium |
1.1 |
cp /etc/e-smith/events/actions/user-create-unix /tmp/user-create-unix |
96 |
|
|
cp /etc/e-smith/events/actions/user-create-unix /etc/e-smith/events/actions/user-create-unix.backup |
97 |
|
|
echo "modifying user folder permission in user-create-unix from chmod 0700 to chmod 0755" |
98 |
|
|
#cat /tmp/user-create-unix | sed -e "a|chmod 0700|chmod 0770, \"/home/e-smith/files/users/\$userName/home/public_html\";|g" |sed -e "a|chmod 0700|chown \$userName:www, \"/home/e-smith/files/users/\$userName\" |g"|sed -e "s|chmod 0700|chmod 0710|g" > /etc/e-smith/events/actions/user-create-unix |
99 |
|
|
|
100 |
|
|
sed -e "/chmod 0700/{ |
101 |
|
|
s|chmod 0700|chmod 0710| |
102 |
|
|
a \\ |
103 |
|
|
chmod 0770, \"/home/e-smith/files/users/\$userName/home/public_html\"; |
104 |
|
|
a \\ |
105 |
|
|
system(\"/bin/chown\", \":www\", \"/home/e-smith/files/users/\$userName/home/public_html\"); |
106 |
|
|
a\\ |
107 |
|
|
system(\"/bin/chown\", \":www\", \"/home/e-smith/files/users/\$userName\"); |
108 |
|
|
}" /etc/e-smith/events/actions/user-create-unix.backup > /etc/e-smith/events/actions/user-create-unix |
109 |
unnilennium |
1.2 |
# here we need to add something for tmp folder |
110 |
unnilennium |
1.1 |
|
111 |
|
|
echo "modifying existing users spaces" |
112 |
|
|
ls -1 /home/e-smith/files/users/ >/tmp/listeusers |
113 |
|
|
cat /tmp/listeusers|while read line |
114 |
|
|
do |
115 |
|
|
if [ "admin" != "$line" ] |
116 |
|
|
then |
117 |
|
|
chmod 0710 /home/e-smith/files/users/$line |
118 |
|
|
echo "chmod $line:www /home/e-smith/files/users/$line" |
119 |
|
|
chown $line:www /home/e-smith/files/users/$line |
120 |
|
|
mkdir -p /home/e-smith/files/users/$line/home/public_html |
121 |
|
|
chown -R $line:www /home/e-smith/files/users/$line/home/public_html |
122 |
|
|
chmod -R 2770 /home/e-smith/files/users/$line/home/public_html |
123 |
unnilennium |
1.2 |
mkdir -p /home/e-smith/files/users/$line/tmp |
124 |
|
|
chown -R $line:www /home/e-smith/files/users/$line/tmp |
125 |
|
|
chmod -R 2770 /home/e-smith/files/users/$line/tmp |
126 |
unnilennium |
1.1 |
fi |
127 |
|
|
done |
128 |
|
|
} |
129 |
|
|
|
130 |
|
|
enable_user_webspace |
131 |
|
|
fi |
132 |
|
|
|
133 |
|
|
%postun |
134 |
|
|
if [ $1 = 0 ] ; then |
135 |
unnilennium |
1.2 |
# /sbin/e-smith/config delete UserPublicWeb |
136 |
|
|
# /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
137 |
|
|
# service httpd-e-smith restart |
138 |
unnilennium |
1.1 |
cp /etc/e-smith/events/actions/user-create-unix /tmp/user-create-unix |
139 |
|
|
echo "modifying user folder permission in user-create-unix from chmod 0755 to chmod 0700" |
140 |
|
|
sed -e "/chmod 0770/d" /tmp/user-create-unix > /tmp/user-create-unix2 |
141 |
|
|
sed -e "s|chmod 0710|chmod 0700|g" /tmp/user-create-unix2 > /tmp/user-create-unix3 |
142 |
|
|
sed -e "/chown/d" /tmp/user-create-unix3 > /etc/e-smith/events/actions/user-create-unix |
143 |
unnilennium |
1.2 |
# echo "removing html folder in user directory skeleton" |
144 |
|
|
# rm -r /etc/e-smith/skel/user/home/public_html |
145 |
|
|
# ls -1 /home/e-smith/files/users/ >/tmp/listeusers |
146 |
unnilennium |
1.1 |
cat /tmp/listeusers|while read line |
147 |
|
|
do |
148 |
|
|
if [ "admin" != "$line" ] |
149 |
|
|
then |
150 |
|
|
chmod -R 0755 /home/e-smith/files/users/$line |
151 |
|
|
chmod 0700 /home/e-smith/files/users/$line |
152 |
|
|
chown -R $line:$line /home/e-smith/files/users/$line |
153 |
|
|
fi |
154 |
|
|
done |
155 |
|
|
|
156 |
|
|
fi |
157 |
|
|
|
158 |
|
|
%files -f %{name}-%{version}-filelist |
159 |
|
|
%defattr(-,root,root) |
160 |
|
|
|