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