Summary: Enables user web spave on the e-smith server and gateway. %define name smeserver-user-webspace Name: %{name} %define version 0.1 %define release 13 Version: %{version} Release: %{release}%{dist} License: GPL Group: Networking/Daemons Source: %{name}-%{version}.tar.gz Patch0: %{name}-%{version}.patch0 Patch1: %{name}-%{version}.patch1 Patch2: %{name}-%{version}.patch2 Patch3: smeserver-user-webspace-0.1.patch3 Patch4: smeserver-user-webspace-0.1-actions.patch Patch5: smeserver-user-webspace-0.1-patch5.patch Patch6: smeserver-user-webspace-0.1-patch6.patch Patch7: smeserver-user-webspace-0.1-patch7.patch Patch8: smeserver-user-webspace-0.1-migratesme7.patch Packager: Jean-Philippe Pialasse BuildRoot: /var/tmp/e-smith-buildroot BuildArchitectures: noarch Requires: smeserver-release >= 8.0 AutoReqProv: no BuildRequires: e-smith-devtools %changelog * Wed Dec 11 2013 Jean-Philippe Pialasse 0.1-13.sme - fix migration from sme7 config db type [SME: 8055] * Tue Nov 26 2013 Jean-Philippe Pialasse 0.1-12.sme - spec fixing createlink * Mon Nov 25 2013 Jean-Philippe Pialasse 0.1-11.sme - added httpd reconfiguration for user create, modify,delete,lock events * 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. * Wed Nov 22 2000 Damien Curtain - 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 - initial release %description Enables the e-smith server and gateway to host user web pages from their home directories. Simply create a public_html directory inside your ~/home/ directory and any web pages placed there in will be available via the urls http://www/~user and http://www/user. %prep %setup #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 rm root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/50UserDir00 %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 %build perl createlinks %install rm -rf $RPM_BUILD_ROOT (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) rm -f %{name}-%{version}-filelist /sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist %clean rm -rf $RPM_BUILD_ROOT %pre %preun #%post #if [ $1 = 1 ] ; then # enable_user_webspace() { # echo 'You now have the option to enable user web directories.' # echo # echo -n 'Would you like to enable User Directories? (y/N): ' # # read choice < /dev/tty # # if [ x$choice = xy ] ; then # /sbin/e-smith/config set UserPublicWeb service status on # /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf # service httpd-e-smith restart # elif [ x$choice = xY ] ; then # /sbin/e-smith/config set UserPublicWeb service status on # /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf # service httpd-e-smith restart # else # /sbin/e-smith/config set UserPublicWeb service status off # fi # # 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" #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 # } # enable_user_webspace #fi #%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 # 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 %files -f %{name}-%{version}-filelist %defattr(-,root,root)