[arch-commits] Commit in plan9port/trunk (PKGBUILD plan9.sh)

Alexander Rødseth arodseth at nymeria.archlinux.org
Sun Feb 16 22:26:42 UTC 2014


    Date: Sunday, February 16, 2014 @ 23:26:42
  Author: arodseth
Revision: 105870

Perhaps this finally fixes the hardcoded paths

Modified:
  plan9port/trunk/PKGBUILD
  plan9port/trunk/plan9.sh

----------+
 PKGBUILD |   24 +++++++++++++++---------
 plan9.sh |    4 +++-
 2 files changed, 18 insertions(+), 10 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-02-16 20:48:06 UTC (rev 105869)
+++ PKGBUILD	2014-02-16 22:26:42 UTC (rev 105870)
@@ -6,7 +6,7 @@
 
 pkgname=plan9port
 pkgver=20131024
-pkgrel=3
+pkgrel=4
 pkgdesc='Port of many programs from Plan 9 to Unix-like operating systems'
 arch=('x86_64' 'i686')
 url='http://swtch.com/plan9port/'
@@ -19,14 +19,16 @@
 source=("http://$pkgname.googlecode.com/files/$pkgname-$pkgver.tgz"
         'plan9.sh')
 sha256sums=('5cba7856bdb35a96a923120e61d320d424fee1a6f09b7af3e87eb7814a747d4f'
-            'c216efa3455ba0b22b1723ae62e4c1e21b3a776a760d8fcedb902ff994b701c1')
+            '8768c080a8ceb0a52a3f866bd8ffc4b26f9deb97c6877ceea78ec0b316325a6b')
 
 package() {
   cd "$pkgname"
 
-  # TODO: Find a way to install in a better directory than /usr/local/plan9
+  # Try the gentoo way for fixing hardcoded paths
+  PLAN9=/usr/lib/plan9
+  grep --null -l -r '/usr/local/plan9' | xargs --null sed -i "s!/usr/local/plan9!${PLAN9}!g"
 
-  d=usr/local
+  d=usr/lib
 
   ./INSTALL -b
   install -Dm755 ../plan9.sh "$pkgdir/etc/profile.d/plan9.sh"
@@ -44,11 +46,11 @@
   rm -f config install.log install.sum install.txt configure Makefile INSTALL \
     LICENSE
 
-  # Fix hardcoded paths
-  for f in `grep -H -r "$pkgdir$d/$pkgname" | cut -d: -f1`; do
-    echo -n "\t$f"
-    [ -e "$f" ] && sed -i "s:$pkgdir$d/$pkgname:$d/$pkgname:" "$f" || true
-  done
+  # The old method for fixing hardcoded paths
+  #for f in `grep -H -r "$pkgdir$d/$pkgname" | cut -d: -f1`; do
+  #  echo -n "\t$f"
+  #  [ -e "$f" ] && sed -i "s:$pkgdir$d/$pkgname:$d/$pkgname:" "$f" || true
+  #done
 
   # Fix python scripts
   find "$pkgdir" -name '*.py' -print0 |xargs -0 \
@@ -67,6 +69,10 @@
       gunzip "$i"
     fi
   done
+
+  # Once more
+  grep --null -l -r "$pkgdir/usr/local/plan9" | xargs --null sed -i "s!$pkgdir/usr/local/plan9!${PLAN9}!g"
+  grep --null -l -r "$pkgdir$PLAN9" | xargs --null sed -i "s!$pkgdir$PLAN9!${PLAN9}!g"
 }
 
 # vim:set ts=2 sw=2 et:

Modified: plan9.sh
===================================================================
--- plan9.sh	2014-02-16 20:48:06 UTC (rev 105869)
+++ plan9.sh	2014-02-16 22:26:42 UTC (rev 105870)
@@ -1,2 +1,4 @@
-export PLAN9=/usr/local/plan9
+export PLAN9=/usr/lib/plan9
 export PATH=$PATH:$PLAN9/bin
+export ROOTPATH=$ROOTPATH:$PLAN9/bin
+export MANPATH=$MANPATH:$PLAN9/man




More information about the arch-commits mailing list