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