[arch-commits] Commit in x2goserver/trunk (PKGBUILD x2goserver.install)

Andreas Radke andyrtr at archlinux.org
Fri Feb 13 21:20:15 UTC 2015


    Date: Friday, February 13, 2015 @ 22:20:15
  Author: andyrtr
Revision: 231385

upgpkg: x2goserver 4.0.1.18-2

don't groupdel/userdel in .install - simplify install file

Modified:
  x2goserver/trunk/PKGBUILD
  x2goserver/trunk/x2goserver.install

--------------------+
 PKGBUILD           |   19 ++++++++++++++--
 x2goserver.install |   60 +++++++--------------------------------------------
 2 files changed, 26 insertions(+), 53 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-02-13 20:52:49 UTC (rev 231384)
+++ PKGBUILD	2015-02-13 21:20:15 UTC (rev 231385)
@@ -8,7 +8,7 @@
 
 pkgname=x2goserver
 pkgver=4.0.1.18
-pkgrel=1
+pkgrel=2
 pkgdesc="Open source terminal server"
 arch=('i686' 'x86_64')
 url="http://www.x2go.org/"
@@ -84,6 +84,10 @@
 }
 
 package() {
+  
+  # system user/group x2gouser - 111
+  # system user/group x2goprint - 112
+  
   cd "${srcdir}/${pkgname}-${pkgver}"
   make -j1 PREFIX=/usr SBINDIR=/usr/bin DESTDIR="$pkgdir" install
 
@@ -92,7 +96,7 @@
   
   # X2go homedir + printing spool dir
   install -dm 770 $pkgdir/var/lib/x2go
-  install -dm 770 $pkgdir/var/spool/x2go
+  install -dm 770 --owner=112 --group=112 $pkgdir/var/spool/x2go
   
   # load fuse module at system start
   install -dm755 $pkgdir/usr/lib/modules-load.d
@@ -103,4 +107,15 @@
 
   # fix permission
   chmod 750 ${pkgdir}/etc/sudoers.d
+  
+  # fix more permissions - see INSTALL file
+  chown root:111 ${pkgdir}/usr/lib/x2go/x2gosqlitewrapper
+  chmod 2755 ${pkgdir}/usr/lib/x2go/x2gosqlitewrapper
+  
+  chown root:112 ${pkgdir}/usr/bin/x2goprint
+  chmod 2755 ${pkgdir}/usr/bin/x2goprint
 }
+
+
+
+

Modified: x2goserver.install
===================================================================
--- x2goserver.install	2015-02-13 20:52:49 UTC (rev 231384)
+++ x2goserver.install	2015-02-13 21:20:15 UTC (rev 231385)
@@ -3,49 +3,15 @@
   ==> Use the following command to setup sqlite database:
   ==> x2godbadmin --createdb
 EOM
+
+  getent group x2gouser &> /dev/null   || groupadd -g 111 x2gouser &> /dev/null
+  getent group x2goprint &> /dev/null  || groupadd -g 112 x2goprint &> /dev/null
+  getent passwd x2gouser &> /dev/null   || useradd -s /usr/bin/false -c "X2GoUser user" -M -d /var/lib/x2go -u 111 -g x2gouser -r x2gouser &> /dev/null
+  getent passwd x2goprint &> /dev/null  || useradd -s /usr/bin/false -c "X2GoPrint user" -M -d /var/spool/x2go -u 112 -g x2goprint -r x2goprint &> /dev/null
+
 }
 
-
 post_install() {
-
-  # Make sure the group and user "x2gouser"(111) +"x2goprint"(112) exists on this system and have the correct values
-
-  # x2gouser
-  if grep -q "^x2gouser:" /etc/group &> /dev/null ; then
-    groupmod -g 111 -n x2gouser x2gouser &> /dev/null
-  else
-    groupadd -g 111 x2gouser &> /dev/null
-  fi
-
-  if grep -q "^x2gouser:" /etc/passwd 2> /dev/null ; then
-    usermod -s /usr/bin/false -c "X2GoUser user" -M -d /var/lib/x2go -u 111 -g x2gouser x2gouser &> /dev/null
-  else
-    useradd -s /usr/bin/false -c "X2GoUser user" -M -d /var/lib/x2go -u 111 -g x2gouser -r x2gouser &> /dev/null
-  fi 
-
-  # x2goprint
-  if grep -q "^x2goprint:" /etc/group &> /dev/null ; then
-    groupmod -g 112 -n x2goprint x2goprint &> /dev/null
-  else
-    groupadd -g 112 x2goprint &> /dev/null
-  fi
-
-  if grep -q "^x2goprint:" /etc/passwd 2> /dev/null ; then
-    usermod -s /usr/bin/false -c "X2GoPrint user" -M -d /var/spool/x2go -u 112 -g x2goprint x2goprint &> /dev/null
-  else
-    useradd -s /usr/bin/false -c "X2GoPrint user" -M -d /var/spool/x2go -u 112 -g x2goprint -r x2goprint &> /dev/null
-  fi
-  
-  # fix permissions - see INSTALL file
-  chown -R x2goprint:x2goprint /var/spool/x2go
-  chmod 0770 /var/spool/x2go
-    
-  chown root:x2gouser /usr/lib/x2go/x2gosqlitewrapper
-  chmod 2755 /usr/lib/x2go/x2gosqlitewrapper
-  
-  chown root:x2goprint /usr/bin/x2goprint
-  chmod 2755 /usr/bin/x2goprint
-  
   update-desktop-database -q
   update-mime-database usr/share/mime &> /dev/null
 }
@@ -54,16 +20,8 @@
   post_install $1
 }
 
-pre_remove() {
-    userdel x2gouser &> /dev/null
-    userdel x2goprint &> /dev/null
-    groupdel x2gouser &> /dev/null || /bin/true
-    groupdel x2goprint &> /dev/null || /bin/true
-    rm -rf /var/lib/x2go/* &> /dev/null || /bin/true
-    rm -rf /var/spool/x2go/* &> /dev/null || /bin/true
-}
-
 post_remove() {
-    update-desktop-database -q
-    update-mime-database usr/share/mime &> /dev/null
+  rm -rf /var/lib/x2go/* &> /dev/null || /bin/true
+  rm -rf /var/spool/x2go/* &> /dev/null || /bin/true
+  post_install $1
 }



More information about the arch-commits mailing list