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

Eric Bélanger eric at archlinux.org
Tue Sep 6 19:49:03 UTC 2011


    Date: Tuesday, September 6, 2011 @ 15:49:02
  Author: eric
Revision: 137217

upgpkg: oprofile 0.9.7-2

Fix oprofile user home directory

Modified:
  oprofile/trunk/PKGBUILD
  oprofile/trunk/oprofile.install

------------------+
 PKGBUILD         |    3 ++-
 oprofile.install |    7 +++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-09-06 19:33:18 UTC (rev 137216)
+++ PKGBUILD	2011-09-06 19:49:02 UTC (rev 137217)
@@ -3,7 +3,7 @@
 
 pkgname=oprofile
 pkgver=0.9.7
-pkgrel=1
+pkgrel=2
 pkgdesc="A system-wide profiler for Linux systems, capable of profiling all running code at low overhead"
 arch=('i686' 'x86_64')
 url="http://oprofile.sourceforge.net"
@@ -26,6 +26,7 @@
 package() {
   cd "$srcdir/$pkgname-$pkgver"
   make DESTDIR="$pkgdir" install
+  install -d "$pkgdir/var/lib/oprofile"
 
 # installing development libraries - FS#20089
   install -m644 libutil/op_types.h libop/op_sample_file.h libutil/op_list.h libop/op_events.h libop/op_cpu_type.h libop/op_config.h libdb/odb.h "$pkgdir/usr/include"

Modified: oprofile.install
===================================================================
--- oprofile.install	2011-09-06 19:33:18 UTC (rev 137216)
+++ oprofile.install	2011-09-06 19:49:02 UTC (rev 137217)
@@ -1,11 +1,14 @@
 post_install(){
   groupadd -g 492 oprofile &>/dev/null
-  useradd -u 492 -g oprofile -s /bin/false oprofile &>/dev/null
+  useradd -u 492 -g oprofile -d /var/lib/oprofile -s /bin/false oprofile &>/dev/null
 }
 
 post_upgrade(){
   getent group oprofile >/dev/null 2>&1 || groupadd -g 492 oprofile &>/dev/null
-  getent passwd oprofile >/dev/null 2>&1 || useradd -u 492 -g oprofile -s /bin/false oprofile &>/dev/null
+  getent passwd oprofile >/dev/null 2>&1 || useradd -u 492 -g oprofile -d /var/lib/oprofile -s /bin/false oprofile &>/dev/null
+  if [ "$(vercmp $2 0.9.7-2)" -lt 0 ] ; then
+    usermod -d /var/lib/oprofile oprofile
+  fi
 }
 
 post_remove(){




More information about the arch-commits mailing list