2 |
%define name smeserver-user-webspace |
%define name smeserver-user-webspace |
3 |
Name: %{name} |
Name: %{name} |
4 |
%define version 0.1 |
%define version 0.1 |
5 |
%define release 5.SME7 |
%define release 12 |
6 |
Version: %{version} |
Version: %{version} |
7 |
Release: %{release} |
Release: %{release}%{dist} |
8 |
Copyright: GPL |
License: GPL |
9 |
Group: Networking/Daemons |
Group: Networking/Daemons |
10 |
Source: %{name}-%{version}.tar.gz |
Source: %{name}-%{version}.tar.gz |
11 |
Patch0: %{name}-%{version}.patch0 |
Patch0: %{name}-%{version}.patch0 |
12 |
Patch1: %{name}-%{version}.patch1 |
Patch1: %{name}-%{version}.patch1 |
13 |
Patch2: %{name}-%{version}.patch2 |
Patch2: %{name}-%{version}.patch2 |
14 |
Packager: Jean-Philippe Pialasse <unnilennium@pialasse.com> |
Patch3: smeserver-user-webspace-0.1.patch3 |
15 |
|
Patch4: smeserver-user-webspace-0.1-actions.patch |
16 |
|
Patch5: smeserver-user-webspace-0.1-patch5.patch |
17 |
|
Patch6: smeserver-user-webspace-0.1-patch6.patch |
18 |
|
Patch7: smeserver-user-webspace-0.1-patch7.patch |
19 |
|
Packager: Jean-Philippe Pialasse <tests@pialasse.com> |
20 |
BuildRoot: /var/tmp/e-smith-buildroot |
BuildRoot: /var/tmp/e-smith-buildroot |
21 |
BuildArchitectures: noarch |
BuildArchitectures: noarch |
22 |
Requires: smeserver-release >= 7.0 |
Requires: smeserver-release >= 8.0 |
23 |
AutoReqProv: no |
AutoReqProv: no |
24 |
|
BuildRequires: e-smith-devtools |
25 |
|
|
26 |
|
%changelog |
27 |
|
* Tue Nov 26 2013 Jean-Philippe Pialasse <tests@pialasse.com> 0.1-12.sme |
28 |
|
- spec fixing createlink |
29 |
|
|
30 |
|
* Mon Nov 25 2013 Jean-Philippe Pialasse <tests@pialasse.com> 0.1-11.sme |
31 |
|
- added httpd reconfiguration for user create, modify,delete,lock events |
32 |
|
|
33 |
|
* Sun Nov 24 2013 Jean-Philippe Pialasse <tests@pialasse.com> 0.1-10.sme |
34 |
|
- fix more typos in patchs |
35 |
|
- patch5 for httpd template |
36 |
|
|
37 |
|
* Sat Nov 23 2013 Jean-Philippe Pialasse <tests@pialasse.com> 0.1-8.sme |
38 |
|
- moved spec dirty work on action to real actions |
39 |
|
- added skel folders |
40 |
|
- added two events and link to actions in the proper events |
41 |
|
- precleaning spec |
42 |
|
- patchs typo fixes |
43 |
|
|
44 |
|
* Sun Oct 27 2013 Jean-Philippe Pialasse <tests@pialasse.com> 0.1-6.sme |
45 |
|
- initial import for sme8 |
46 |
|
|
47 |
|
* Fri Sep 08 2006 Jean-Philippe Pialasse <unnilennium@pialasse.com> |
48 |
|
- adaptation ot the contrib to the SME 7 architecture |
49 |
|
|
50 |
|
* Thu Nov 23 2000 Damien Curtain <damien@pagefault.org> |
51 |
|
- Moved the userdir template into templates-custom, utilising |
52 |
|
- a new feature of e-smith-4.0.1 and greater. |
53 |
|
|
54 |
|
* Wed Nov 22 2000 Damien Curtain <damien@pagefault.org> |
55 |
|
- Added new templates. Added then removed;) ability to |
56 |
|
- set userdir. Added www/user aliases. Post install script |
57 |
|
- to prompt people to turn this on/off. |
58 |
|
|
59 |
|
* Tue Nov 21 2000 Paul Nesbit <pkn@e-smith.com> |
60 |
|
- initial release |
61 |
|
|
62 |
%description |
%description |
63 |
Enables the e-smith server and gateway to host user web pages |
Enables the e-smith server and gateway to host user web pages |
67 |
|
|
68 |
%prep |
%prep |
69 |
%setup |
%setup |
70 |
rm createlinks |
#rm createlinks |
71 |
rm -r root/etc/e-smith/events |
rm -r root/etc/e-smith/events/console-save |
72 |
|
rm -r root/etc/e-smith/events/actions/action1 |
73 |
rm root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess50UserDir00 |
rm root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess50UserDir00 |
74 |
|
|
75 |
%patch0 -p1 |
%patch0 -p1 |
76 |
rm root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/50UserDir00 |
rm root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/50UserDir00 |
77 |
%patch1 -p1 |
%patch1 -p1 |
78 |
%patch2 -p1 |
%patch2 -p1 |
79 |
|
%patch3 -p1 |
80 |
|
%patch4 -p1 |
81 |
|
%patch5 -p1 |
82 |
|
%patch6 -p1 |
83 |
|
%patch7 -p1 |
84 |
|
|
85 |
%build |
%build |
86 |
|
perl createlinks |
87 |
|
|
88 |
%install |
%install |
89 |
rm -rf $RPM_BUILD_ROOT |
rm -rf $RPM_BUILD_ROOT |
96 |
|
|
97 |
%pre |
%pre |
98 |
%preun |
%preun |
99 |
%post |
#%post |
100 |
if [ $1 = 1 ] ; then |
#if [ $1 = 1 ] ; then |
101 |
enable_user_webspace() { |
# enable_user_webspace() { |
102 |
|
|
103 |
echo 'You now have the option to enable user web directories.' |
# echo 'You now have the option to enable user web directories.' |
104 |
echo |
# echo |
105 |
echo -n 'Would you like to enable User Directories? (y/N): ' |
# echo -n 'Would you like to enable User Directories? (y/N): ' |
106 |
|
# |
107 |
read choice < /dev/tty |
# read choice < /dev/tty |
108 |
|
# |
109 |
if [ x$choice = xy ] ; then |
# if [ x$choice = xy ] ; then |
110 |
/sbin/e-smith/config set UserPublicWeb on |
# /sbin/e-smith/config set UserPublicWeb service status on |
111 |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
# /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
112 |
service httpd-e-smith restart |
# service httpd-e-smith restart |
113 |
elif [ x$choice = xY ] ; then |
# elif [ x$choice = xY ] ; then |
114 |
/sbin/e-smith/config set UserPublicWeb on |
# /sbin/e-smith/config set UserPublicWeb service status on |
115 |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
# /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
116 |
service httpd-e-smith restart |
# service httpd-e-smith restart |
117 |
else |
# else |
118 |
/sbin/e-smith/config set UserPublicWeb off |
# /sbin/e-smith/config set UserPublicWeb service status off |
119 |
fi |
# fi |
120 |
|
# |
121 |
echo "adding html folder in user skeleton" |
# echo "adding html folder in user skeleton" |
122 |
mkdir -p /etc/e-smith/skel/user/home/public_html |
# mkdir -p /etc/e-smith/skel/user/home/public_html |
123 |
cp /etc/e-smith/events/actions/user-create-unix /tmp/user-create-unix |
|
124 |
cp /etc/e-smith/events/actions/user-create-unix /etc/e-smith/events/actions/user-create-unix.backup |
# cp /etc/e-smith/events/actions/user-create-unix /tmp/user-create-unix |
125 |
echo "modifying user folder permission in user-create-unix from chmod 0700 to chmod 0755" |
# cp /etc/e-smith/events/actions/user-create-unix /etc/e-smith/events/actions/user-create-unix.backup |
126 |
|
# echo "modifying user folder permission in user-create-unix from chmod 0700 to chmod 0755" |
127 |
#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 |
#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 |
128 |
|
|
129 |
sed -e "/chmod 0700/{ |
#sed -e "/chmod 0700/{ |
130 |
s|chmod 0700|chmod 0710| |
#s|chmod 0700|chmod 0710| |
131 |
a \\ |
#a \\ |
132 |
chmod 0770, \"/home/e-smith/files/users/\$userName/home/public_html\"; |
#chmod 0770, \"/home/e-smith/files/users/\$userName/home/public_html\"; |
133 |
a \\ |
#a \\ |
134 |
system(\"/bin/chown\", \":www\", \"/home/e-smith/files/users/\$userName/home/public_html\"); |
#system(\"/bin/chown\", \":www\", \"/home/e-smith/files/users/\$userName/home/public_html\"); |
135 |
a\\ |
#a\\ |
136 |
system(\"/bin/chown\", \":www\", \"/home/e-smith/files/users/\$userName\"); |
#system(\"/bin/chown\", \":www\", \"/home/e-smith/files/users/\$userName\"); |
137 |
}" /etc/e-smith/events/actions/user-create-unix.backup > /etc/e-smith/events/actions/user-create-unix |
#}" /etc/e-smith/events/actions/user-create-unix.backup > /etc/e-smith/events/actions/user-create-unix |
138 |
|
## here we need to add something for tmp folder |
139 |
echo "modifying existing users spaces" |
# |
140 |
ls -1 /home/e-smith/files/users/ >/tmp/listeusers |
# echo "modifying existing users spaces" |
141 |
cat /tmp/listeusers|while read line |
# ls -1 /home/e-smith/files/users/ >/tmp/listeusers |
142 |
do |
# cat /tmp/listeusers|while read line |
143 |
if [ "admin" != "$line" ] |
# do |
144 |
then |
# if [ "admin" != "$line" ] |
145 |
chmod 0710 /home/e-smith/files/users/$line |
# then |
146 |
echo "chmod $line:www /home/e-smith/files/users/$line" |
# chmod 0710 /home/e-smith/files/users/$line |
147 |
chown $line:www /home/e-smith/files/users/$line |
# echo "chmod $line:www /home/e-smith/files/users/$line" |
148 |
mkdir -p /home/e-smith/files/users/$line/home/public_html |
# chown $line:www /home/e-smith/files/users/$line |
149 |
chown -R $line:www /home/e-smith/files/users/$line/home/public_html |
# mkdir -p /home/e-smith/files/users/$line/home/public_html |
150 |
chmod -R 2770 /home/e-smith/files/users/$line/home/public_html |
# chown -R $line:www /home/e-smith/files/users/$line/home/public_html |
151 |
|
# chmod -R 2770 /home/e-smith/files/users/$line/home/public_html |
152 |
fi |
# mkdir -p /home/e-smith/files/users/$line/tmp |
153 |
done |
# chown -R $line:www /home/e-smith/files/users/$line/tmp |
154 |
} |
# chmod -R 2770 /home/e-smith/files/users/$line/tmp |
155 |
|
# fi |
156 |
enable_user_webspace |
# done |
157 |
fi |
# } |
158 |
|
|
159 |
%postun |
# enable_user_webspace |
160 |
if [ $1 = 0 ] ; then |
#fi |
161 |
/sbin/e-smith/config delete UserPublicWeb |
|
162 |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
#%postun |
163 |
service httpd-e-smith restart |
#if [ $1 = 0 ] ; then |
164 |
cp /etc/e-smith/events/actions/user-create-unix /tmp/user-create-unix |
# /sbin/e-smith/config delete UserPublicWeb |
165 |
echo "modifying user folder permission in user-create-unix from chmod 0755 to chmod 0700" |
# /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
166 |
sed -e "/chmod 0770/d" /tmp/user-create-unix > /tmp/user-create-unix2 |
# service httpd-e-smith restart |
167 |
sed -e "s|chmod 0710|chmod 0700|g" /tmp/user-create-unix2 > /tmp/user-create-unix3 |
# cp /etc/e-smith/events/actions/user-create-unix /tmp/user-create-unix |
168 |
sed -e "/chown/d" /tmp/user-create-unix3 > /etc/e-smith/events/actions/user-create-unix |
# echo "modifying user folder permission in user-create-unix from chmod 0755 to chmod 0700" |
169 |
echo "removing html folder in user directory skeleton" |
# sed -e "/chmod 0770/d" /tmp/user-create-unix > /tmp/user-create-unix2 |
170 |
rm -r /etc/e-smith/skel/user/home/public_html |
# sed -e "s|chmod 0710|chmod 0700|g" /tmp/user-create-unix2 > /tmp/user-create-unix3 |
171 |
ls -1 /home/e-smith/files/users/ >/tmp/listeusers |
# sed -e "/chown/d" /tmp/user-create-unix3 > /etc/e-smith/events/actions/user-create-unix |
172 |
cat /tmp/listeusers|while read line |
# echo "removing html folder in user directory skeleton" |
173 |
do |
# rm -r /etc/e-smith/skel/user/home/public_html |
174 |
if [ "admin" != "$line" ] |
# ls -1 /home/e-smith/files/users/ >/tmp/listeusers |
175 |
then |
# cat /tmp/listeusers|while read line |
176 |
chmod -R 0755 /home/e-smith/files/users/$line |
# do |
177 |
chmod 0700 /home/e-smith/files/users/$line |
# if [ "admin" != "$line" ] |
178 |
chown -R $line:$line /home/e-smith/files/users/$line |
# then |
179 |
fi |
# chmod -R 0755 /home/e-smith/files/users/$line |
180 |
done |
# chmod 0700 /home/e-smith/files/users/$line |
181 |
|
# chown -R $line:$line /home/e-smith/files/users/$line |
182 |
fi |
# fi |
183 |
|
# done |
184 |
|
# |
185 |
|
#fi |
186 |
|
|
187 |
%files -f %{name}-%{version}-filelist |
%files -f %{name}-%{version}-filelist |
188 |
%defattr(-,root,root) |
%defattr(-,root,root) |
189 |
|
|
|
%changelog |
|
|
* Fri Sep 08 2006 Jean-Philippe Pialasse <unnilennium@pialasse.com> |
|
|
- adaptation ot the contrib to the SME 7 architecture |
|
|
* Thu Nov 23 2000 Damien Curtain <damien@pagefault.org> |
|
|
- Moved the userdir template into templates-custom, utilising |
|
|
- a new feature of e-smith-4.0.1 and greater. |
|
|
|
|
|
* Wed Nov 22 2000 Damien Curtain <damien@pagefault.org> |
|
|
- Added new templates. Added then removed;) ability to |
|
|
- set userdir. Added www/user aliases. Post install script |
|
|
- to prompt people to turn this on/off. |
|
|
|
|
|
* Tue Nov 21 2000 Paul Nesbit <pkn@e-smith.com> |
|
|
- initial release |
|