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

2014-02-16 Thread Alexander Rødseth
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
===
--- PKGBUILD2014-02-16 20:48:06 UTC (rev 105869)
+++ PKGBUILD2014-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.sh2014-02-16 20:48:06 UTC (rev 105869)
+++ plan9.sh2014-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



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

2013-10-03 Thread Alexander Rødseth
Date: Thursday, October 3, 2013 @ 21:11:20
  Author: arodseth
Revision: 98016

Moved from /opt/plan9 to /usr/local/plan9 due to hardcoded paths in the binary 
files

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

--+
 PKGBUILD |   20 +++-
 plan9.sh |2 +-
 2 files changed, 12 insertions(+), 10 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2013-10-03 17:42:09 UTC (rev 98015)
+++ PKGBUILD2013-10-03 19:11:20 UTC (rev 98016)
@@ -6,7 +6,7 @@
 
 pkgname=plan9port
 pkgver=20130927
-pkgrel=1
+pkgrel=2
 pkgdesc='Port of many programs from Plan 9 to Unix-like operating systems'
 arch=('x86_64' 'i686')
 url='http://swtch.com/plan9port/'
@@ -19,18 +19,20 @@
 source=("http://swtch.com/$pkgname/$pkgname-$pkgver.tgz";
 'plan9.sh')
 sha256sums=('580927688ae2df295bf7f78d0ba19588104c6b0403558ffa3cd9ed0b7b110542'
-'0247c4446497359d305aaec069b07180fbf79ce4fa5191464cd9ebb8c7f0228d')
+'c216efa3455ba0b22b1723ae62e4c1e21b3a776a760d8fcedb902ff994b701c1')
 
 package() {
   cd plan9
 
+  d=/usr/local # /opt
+
   ./INSTALL -b
   install -Dm755 ../plan9.sh "$pkgdir/etc/profile.d/plan9.sh"
-  install -d "$pkgdir/opt"
+  install -d "$pkgdir$d"
   install -d "$pkgdir/usr/share/doc/$pkgname"
-  cp -r "$srcdir/plan9" "$pkgdir/opt/"
-  cd "$pkgdir/opt/plan9"
-  ./INSTALL -c -r "$pkgdir/opt/plan9"
+  cp -r "$srcdir/plan9" "$pkgdir/$d/"
+  cd "$pkgdir$d/plan9"
+  ./INSTALL -c -r "$pkgdir$d/plan9"
   install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 
   # Clean up
@@ -41,9 +43,9 @@
 LICENSE
 
   # Fix hardcoded paths
-  for f in `grep -H -r "$pkgdir/opt/plan9" | cut -d: -f1`; do
+  for f in `grep -H -r "$pkgdir$d/plan9" | cut -d: -f1`; do
 echo -n "\t$f"
-[ -e "$f" ] && sed -i "s:$pkgdir/opt/plan9:/opt/plan9:" "$f" || true
+[ -e "$f" ] && sed -i "s:$pkgdir$d/plan9:$d/plan9:" "$f" || true
   done
 
   # Fix python scripts
@@ -58,7 +60,7 @@
   done
 
   # Decompress the plan9 man pages
-  for i in `find /opt/plan9/man -type f`; do
+  for i in `find $pkgdir$d/plan9/man -type f`; do
 if [ ${i##*.} = "gz" ]; then
   gunzip "$i"
 fi

Modified: plan9.sh
===
--- plan9.sh2013-10-03 17:42:09 UTC (rev 98015)
+++ plan9.sh2013-10-03 19:11:20 UTC (rev 98016)
@@ -1,2 +1,2 @@
-export PLAN9=/opt/plan9
+export PLAN9=/usr/local/plan9
 export PATH=$PATH:$PLAN9/bin