--- rpms/smeserver-user-webspace/contribs8/smeserver-user-webspace.spec 2013/10/27 23:09:14 1.2 +++ rpms/smeserver-user-webspace/contribs8/smeserver-user-webspace.spec 2013/11/24 09:03:23 1.6 @@ -2,7 +2,7 @@ Summary: Enables user web spave on the e %define name smeserver-user-webspace Name: %{name} %define version 0.1 -%define release 6 +%define release 10 Version: %{version} Release: %{release}%{dist} License: GPL @@ -12,7 +12,9 @@ Patch0: %{name}-%{version}.patch0 Patch1: %{name}-%{version}.patch1 Patch2: %{name}-%{version}.patch2 Patch3: smeserver-user-webspace-0.1.patch3 -Packager: Jean-Philippe Pialasse +Patch4: smeserver-user-webspace-0.1-actions.patch +Patch5: smeserver-user-webspace-0.1-patch5.patch +Packager: Jean-Philippe Pialasse BuildRoot: /var/tmp/e-smith-buildroot BuildArchitectures: noarch Requires: smeserver-release >= 8.0 @@ -20,11 +22,23 @@ AutoReqProv: no BuildRequires: e-smith-devtools %changelog +* Sun Nov 24 2013 Jean-Philippe Pialasse 0.1-10.sme +- fix more typos in patchs +- patch5 for httpd template + +* Sat Nov 23 2013 Jean-Philippe Pialasse 0.1-8.sme +- moved spec dirty work on action to real actions +- added skel folders +- added two events and link to actions in the proper events +- precleaning spec +- patchs typo fixes + * Sun Oct 27 2013 Jean-Philippe Pialasse 0.1-6.sme - initial import for sme8 * Fri Sep 08 2006 Jean-Philippe Pialasse - adaptation ot the contrib to the SME 7 architecture + * Thu Nov 23 2000 Damien Curtain - Moved the userdir template into templates-custom, utilising - a new feature of e-smith-4.0.1 and greater. @@ -45,8 +59,9 @@ will be available via the urls http://ww %prep %setup -rm createlinks -rm -r root/etc/e-smith/events +#rm createlinks +rm -r root/etc/e-smith/events/console-save +rm -r root/etc/e-smith/events/actions/action1 rm root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess50UserDir00 %patch0 -p1 @@ -54,6 +69,10 @@ rm root/etc/e-smith/templates/etc/httpd/ %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 +perl createlinks +%patch5 -p1 + %build @@ -68,9 +87,9 @@ rm -rf $RPM_BUILD_ROOT %pre %preun -%post -if [ $1 = 1 ] ; then - enable_user_webspace() { +#%post +#if [ $1 = 1 ] ; then +# enable_user_webspace() { # echo 'You now have the option to enable user web directories.' # echo @@ -92,68 +111,69 @@ if [ $1 = 1 ] ; then # # echo "adding html folder in user skeleton" # mkdir -p /etc/e-smith/skel/user/home/public_html - cp /etc/e-smith/events/actions/user-create-unix /tmp/user-create-unix - cp /etc/e-smith/events/actions/user-create-unix /etc/e-smith/events/actions/user-create-unix.backup - echo "modifying user folder permission in user-create-unix from chmod 0700 to chmod 0755" + +# cp /etc/e-smith/events/actions/user-create-unix /tmp/user-create-unix +# cp /etc/e-smith/events/actions/user-create-unix /etc/e-smith/events/actions/user-create-unix.backup +# echo "modifying user folder permission in user-create-unix from chmod 0700 to chmod 0755" #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 -sed -e "/chmod 0700/{ -s|chmod 0700|chmod 0710| -a \\ -chmod 0770, \"/home/e-smith/files/users/\$userName/home/public_html\"; -a \\ -system(\"/bin/chown\", \":www\", \"/home/e-smith/files/users/\$userName/home/public_html\"); -a\\ -system(\"/bin/chown\", \":www\", \"/home/e-smith/files/users/\$userName\"); -}" /etc/e-smith/events/actions/user-create-unix.backup > /etc/e-smith/events/actions/user-create-unix -# here we need to add something for tmp folder - - echo "modifying existing users spaces" - ls -1 /home/e-smith/files/users/ >/tmp/listeusers - cat /tmp/listeusers|while read line - do - if [ "admin" != "$line" ] - then - chmod 0710 /home/e-smith/files/users/$line - echo "chmod $line:www /home/e-smith/files/users/$line" - chown $line:www /home/e-smith/files/users/$line - mkdir -p /home/e-smith/files/users/$line/home/public_html - chown -R $line:www /home/e-smith/files/users/$line/home/public_html - chmod -R 2770 /home/e-smith/files/users/$line/home/public_html - mkdir -p /home/e-smith/files/users/$line/tmp - chown -R $line:www /home/e-smith/files/users/$line/tmp - chmod -R 2770 /home/e-smith/files/users/$line/tmp - fi - done - } +#sed -e "/chmod 0700/{ +#s|chmod 0700|chmod 0710| +#a \\ +#chmod 0770, \"/home/e-smith/files/users/\$userName/home/public_html\"; +#a \\ +#system(\"/bin/chown\", \":www\", \"/home/e-smith/files/users/\$userName/home/public_html\"); +#a\\ +#system(\"/bin/chown\", \":www\", \"/home/e-smith/files/users/\$userName\"); +#}" /etc/e-smith/events/actions/user-create-unix.backup > /etc/e-smith/events/actions/user-create-unix +## here we need to add something for tmp folder +# +# echo "modifying existing users spaces" +# ls -1 /home/e-smith/files/users/ >/tmp/listeusers +# cat /tmp/listeusers|while read line +# do +# if [ "admin" != "$line" ] +# then +# chmod 0710 /home/e-smith/files/users/$line +# echo "chmod $line:www /home/e-smith/files/users/$line" +# chown $line:www /home/e-smith/files/users/$line +# mkdir -p /home/e-smith/files/users/$line/home/public_html +# chown -R $line:www /home/e-smith/files/users/$line/home/public_html +# chmod -R 2770 /home/e-smith/files/users/$line/home/public_html +# mkdir -p /home/e-smith/files/users/$line/tmp +# chown -R $line:www /home/e-smith/files/users/$line/tmp +# chmod -R 2770 /home/e-smith/files/users/$line/tmp +# fi +# done +# } - enable_user_webspace -fi +# enable_user_webspace +#fi -%postun -if [ $1 = 0 ] ; then +#%postun +#if [ $1 = 0 ] ; then # /sbin/e-smith/config delete UserPublicWeb # /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf # service httpd-e-smith restart - cp /etc/e-smith/events/actions/user-create-unix /tmp/user-create-unix - echo "modifying user folder permission in user-create-unix from chmod 0755 to chmod 0700" - sed -e "/chmod 0770/d" /tmp/user-create-unix > /tmp/user-create-unix2 - sed -e "s|chmod 0710|chmod 0700|g" /tmp/user-create-unix2 > /tmp/user-create-unix3 - sed -e "/chown/d" /tmp/user-create-unix3 > /etc/e-smith/events/actions/user-create-unix +# cp /etc/e-smith/events/actions/user-create-unix /tmp/user-create-unix +# echo "modifying user folder permission in user-create-unix from chmod 0755 to chmod 0700" +# sed -e "/chmod 0770/d" /tmp/user-create-unix > /tmp/user-create-unix2 +# sed -e "s|chmod 0710|chmod 0700|g" /tmp/user-create-unix2 > /tmp/user-create-unix3 +# sed -e "/chown/d" /tmp/user-create-unix3 > /etc/e-smith/events/actions/user-create-unix # echo "removing html folder in user directory skeleton" # rm -r /etc/e-smith/skel/user/home/public_html # ls -1 /home/e-smith/files/users/ >/tmp/listeusers - cat /tmp/listeusers|while read line - do - if [ "admin" != "$line" ] - then - chmod -R 0755 /home/e-smith/files/users/$line - chmod 0700 /home/e-smith/files/users/$line - chown -R $line:$line /home/e-smith/files/users/$line - fi - done - -fi +# cat /tmp/listeusers|while read line +# do +# if [ "admin" != "$line" ] +# then +# chmod -R 0755 /home/e-smith/files/users/$line +# chmod 0700 /home/e-smith/files/users/$line +# chown -R $line:$line /home/e-smith/files/users/$line +# fi +# done +# +#fi %files -f %{name}-%{version}-filelist %defattr(-,root,root)