/[smecontribs]/rpms/smeserver-user-webspace/contribs8/smeserver-user-webspace.spec
ViewVC logotype

Diff of /rpms/smeserver-user-webspace/contribs8/smeserver-user-webspace.spec

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.2 by unnilennium, Sun Oct 27 23:09:14 2013 UTC Revision 1.5 by unnilennium, Sun Nov 24 08:54:06 2013 UTC
# Line 2  Summary: Enables user web spave on the e Line 2  Summary: Enables user web spave on the e
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 6  %define release 9
6  Version: %{version}  Version: %{version}
7  Release: %{release}%{dist}  Release: %{release}%{dist}
8  License: GPL  License: GPL
# Line 12  Patch0: %{name}-%{version}.patch0 Line 12  Patch0: %{name}-%{version}.patch0
12  Patch1: %{name}-%{version}.patch1  Patch1: %{name}-%{version}.patch1
13  Patch2: %{name}-%{version}.patch2  Patch2: %{name}-%{version}.patch2
14  Patch3: smeserver-user-webspace-0.1.patch3  Patch3: smeserver-user-webspace-0.1.patch3
15  Packager: Jean-Philippe Pialasse <unnilennium@pialasse.com>  Patch4: smeserver-user-webspace-0.1-actions.patch
16    Patch5: smeserver-user-webspace-0.1-patch5.patch
17    Packager: Jean-Philippe Pialasse <tests@pialasse.com>
18  BuildRoot: /var/tmp/e-smith-buildroot  BuildRoot: /var/tmp/e-smith-buildroot
19  BuildArchitectures: noarch  BuildArchitectures: noarch
20  Requires: smeserver-release >= 8.0  Requires: smeserver-release >= 8.0
# Line 20  AutoReqProv: no Line 22  AutoReqProv: no
22  BuildRequires:  e-smith-devtools  BuildRequires:  e-smith-devtools
23    
24  %changelog  %changelog
25    * Sun Nov 24 2013 Jean-Philippe Pialasse <tests@pialasse.com> 0.1-9.sme
26    - 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    - 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    - precleaning spec
34    - patchs typo fixes
35    
36  * Sun Oct 27 2013 Jean-Philippe Pialasse <tests@pialasse.com> 0.1-6.sme  * Sun Oct 27 2013 Jean-Philippe Pialasse <tests@pialasse.com> 0.1-6.sme
37  - initial import for sme8  - initial import for sme8
38    
39  * Fri Sep 08 2006 Jean-Philippe Pialasse <unnilennium@pialasse.com>  * Fri Sep 08 2006 Jean-Philippe Pialasse <unnilennium@pialasse.com>
40  - adaptation ot  the contrib to the SME 7 architecture  - adaptation ot  the contrib to the SME 7 architecture
41    
42  * Thu Nov 23 2000 Damien Curtain <damien@pagefault.org>  * Thu Nov 23 2000 Damien Curtain <damien@pagefault.org>
43  - Moved the userdir template into templates-custom, utilising  - Moved the userdir template into templates-custom, utilising
44  - a new feature of e-smith-4.0.1 and greater.  - a new feature of e-smith-4.0.1 and greater.
# Line 45  will be available via the urls http://ww Line 59  will be available via the urls http://ww
59    
60  %prep  %prep
61  %setup  %setup
62  rm createlinks  #rm createlinks
63  rm -r root/etc/e-smith/events  rm -r  root/etc/e-smith/events/console-save
64    rm -r root/etc/e-smith/events/actions/action1
65  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
66    
67  %patch0 -p1  %patch0 -p1
# Line 54  rm root/etc/e-smith/templates/etc/httpd/ Line 69  rm root/etc/e-smith/templates/etc/httpd/
69  %patch1 -p1  %patch1 -p1
70  %patch2 -p1  %patch2 -p1
71  %patch3 -p1  %patch3 -p1
72    %patch4 -p1
73    perl createlinks
74    %patch5 -p1
75    
76    
77  %build  %build
78    
# Line 68  rm -rf $RPM_BUILD_ROOT Line 87  rm -rf $RPM_BUILD_ROOT
87    
88  %pre  %pre
89  %preun  %preun
90  %post  #%post
91  if [ $1 = 1 ] ; then  #if [ $1 = 1 ] ; then
92      enable_user_webspace() {  #    enable_user_webspace() {
93    
94  #        echo 'You now have the option to enable user web directories.'  #        echo 'You now have the option to enable user web directories.'
95  #        echo  #        echo
# Line 92  if [ $1 = 1 ] ; then Line 111  if [ $1 = 1 ] ; then
111  #        #      
112  #       echo "adding html folder in user skeleton"  #       echo "adding html folder in user skeleton"
113  #       mkdir -p  /etc/e-smith/skel/user/home/public_html  #       mkdir -p  /etc/e-smith/skel/user/home/public_html
114          cp /etc/e-smith/events/actions/user-create-unix  /tmp/user-create-unix  
115          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
116          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
117    #       echo "modifying user folder permission in user-create-unix from chmod 0700 to chmod 0755"
118          #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
119                    
120  sed -e  "/chmod 0700/{  #sed -e  "/chmod 0700/{
121  s|chmod 0700|chmod 0710|  #s|chmod 0700|chmod 0710|
122  a \\  #a \\
123  chmod 0770, \"/home/e-smith/files/users/\$userName/home/public_html\";  #chmod 0770, \"/home/e-smith/files/users/\$userName/home/public_html\";
124  a \\  #a \\
125  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\");
126  a\\  #a\\
127  system(\"/bin/chown\", \":www\", \"/home/e-smith/files/users/\$userName\");  #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  #}" /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  ## here we need to add  something for tmp folder
130            #      
131          echo "modifying existing users spaces"  #       echo "modifying existing users spaces"
132          ls -1 /home/e-smith/files/users/ >/tmp/listeusers  #       ls -1 /home/e-smith/files/users/ >/tmp/listeusers
133          cat /tmp/listeusers|while read line  #       cat /tmp/listeusers|while read line
134          do  #       do
135              if [ "admin" !=  "$line" ]  #           if [ "admin" !=  "$line" ]
136              then  #           then
137                  chmod  0710 /home/e-smith/files/users/$line  #               chmod  0710 /home/e-smith/files/users/$line
138                  echo "chmod  $line:www /home/e-smith/files/users/$line"  #               echo "chmod  $line:www /home/e-smith/files/users/$line"
139                  chown  $line:www  /home/e-smith/files/users/$line  #               chown  $line:www  /home/e-smith/files/users/$line
140                  mkdir -p /home/e-smith/files/users/$line/home/public_html  #               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              #               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  #               chmod -R 2770 /home/e-smith/files/users/$line/home/public_html
143                  mkdir -p /home/e-smith/files/users/$line/tmp  #                mkdir -p /home/e-smith/files/users/$line/tmp
144                  chown -R $line:www  /home/e-smith/files/users/$line/tmp  #                chown -R $line:www  /home/e-smith/files/users/$line/tmp
145                  chmod -R 2770 /home/e-smith/files/users/$line/tmp  #                chmod -R 2770 /home/e-smith/files/users/$line/tmp
146              fi  #           fi
147          done  #       done
148      }  #    }
149    
150      enable_user_webspace  #    enable_user_webspace
151  fi  #fi
152    
153  %postun  #%postun
154  if [ $1 = 0 ] ; then  #if [ $1 = 0 ] ; then
155  #    /sbin/e-smith/config delete UserPublicWeb  #    /sbin/e-smith/config delete UserPublicWeb
156  #    /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf  #    /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
157  #    service httpd-e-smith restart  #    service httpd-e-smith restart
158      cp /etc/e-smith/events/actions/user-create-unix  /tmp/user-create-unix  #    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"  #    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  #    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  #    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  #    sed -e "/chown/d"  /tmp/user-create-unix3 > /etc/e-smith/events/actions/user-create-unix
163  #    echo "removing html folder in user directory skeleton"  #    echo "removing html folder in user directory skeleton"
164  #    rm -r  /etc/e-smith/skel/user/home/public_html        #    rm -r  /etc/e-smith/skel/user/home/public_html      
165  #    ls -1 /home/e-smith/files/users/ >/tmp/listeusers  #    ls -1 /home/e-smith/files/users/ >/tmp/listeusers
166      cat /tmp/listeusers|while read line  #    cat /tmp/listeusers|while read line
167      do  #    do
168          if [ "admin" != "$line" ]  #       if [ "admin" != "$line" ]
169              then  #           then
170                  chmod  -R 0755 /home/e-smith/files/users/$line  #               chmod  -R 0755 /home/e-smith/files/users/$line
171                  chmod  0700 /home/e-smith/files/users/$line  #               chmod  0700 /home/e-smith/files/users/$line
172                  chown -R $line:$line  /home/e-smith/files/users/$line  #               chown -R $line:$line  /home/e-smith/files/users/$line
173          fi  #       fi
174      done  #    done
175    #
176  fi  #fi
177    
178  %files -f %{name}-%{version}-filelist  %files -f %{name}-%{version}-filelist
179  %defattr(-,root,root)  %defattr(-,root,root)


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed