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