$NetBSD: patch-install-sh,v 1.4 2019/06/10 02:48:23 jym Exp $

* Handle pkgsrc hierarchy especially paths to man pages;
* pkgsrc will handle the MIME and desktopdb updates. No need to ask user
  to do it manually afterwards;
* Change "cp -r" to "cp -R". OpenGroup deprecated -r, and -R is the only
  reliable portable option;
* Remove the systemd directory creation and make the PLIST handle
  the presence/absence of systemd ecosystem.
* Remove the `-e' option of echo as it is not portable

--- install-sh.orig	2020-07-09 17:06:29.000000000 +0000
+++ install-sh
@@ -53,10 +53,9 @@ mkdir -p $DESTDIR$INSTALL_PREFIX/bin/
 mkdir -p $DESTDIR$INSTALL_PREFIX/share/appdata/
 mkdir -p $DESTDIR$INSTALL_PREFIX/share/applications/
 mkdir -p $DESTDIR$INSTALL_PREFIX/share/icons/hicolor/48x48/apps/
-mkdir -p $DESTDIR$INSTALL_PREFIX/share/man/man1/
+mkdir -p $DESTDIR$INSTALL_PREFIX/$PKGMANDIR/man1/
 mkdir -p $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/
 mkdir -p $DESTDIR$INSTALL_PREFIX/share/doc/phoronix-test-suite/
-mkdir -p $DESTDIR$INSTALL_PREFIX/../etc/bash_completion.d/
 #mkdir -p $DESTDIR$INSTALL_PREFIX/../usr/lib/systemd/system/
 #mkdir -p $DESTDIR$INSTALL_PREFIX/../etc/init/
 
@@ -65,27 +64,26 @@ cp COPYING $DESTDIR$INSTALL_PREFIX/share
 cp AUTHORS $DESTDIR$INSTALL_PREFIX/share/doc/phoronix-test-suite/
 
 cd documentation/
-cp -r * $DESTDIR$INSTALL_PREFIX/share/doc/phoronix-test-suite/
+cp -R * $DESTDIR$INSTALL_PREFIX/share/doc/phoronix-test-suite/
 cd ..
 rm -rf $DESTDIR$INSTALL_PREFIX/share/doc/phoronix-test-suite/man-pages/
 
-cp documentation/man-pages/*.1 $DESTDIR$INSTALL_PREFIX/share/man/man1/
-cp pts-core/static/bash_completion $DESTDIR$INSTALL_PREFIX/../etc/bash_completion.d/phoronix-test-suite
+cp documentation/man-pages/*.1 $DESTDIR$INSTALL_PREFIX/$PKGMANDIR/man1/
+cp pts-core/static/bash_completion $DESTDIR$INSTALL_PREFIX/share/bash-completion.d
 cp pts-core/static/images/phoronix-test-suite.png $DESTDIR$INSTALL_PREFIX/share/icons/hicolor/48x48/apps/phoronix-test-suite.png
 cp pts-core/static/phoronix-test-suite.desktop $DESTDIR$INSTALL_PREFIX/share/applications/
 cp pts-core/static/phoronix-test-suite-launcher.desktop $DESTDIR$INSTALL_PREFIX/share/applications/
 cp pts-core/static/phoronix-test-suite.appdata.xml $DESTDIR$INSTALL_PREFIX/share/appdata/
 
-mkdir -p $DESTDIR$INSTALL_PREFIX/../usr/lib/systemd/system/
-cp deploy/*-systemd/*.service $DESTDIR$INSTALL_PREFIX/../usr/lib/systemd/system/
+cp deploy/*-systemd/*.service $DESTDIR$INSTALL_PREFIX/lib/systemd/system/
 
 # mkdir -p $DESTDIR$INSTALL_PREFIX/../etc/init/
 # cp pts-core/static/upstart/*.conf $DESTDIR$INSTALL_PREFIX/../etc/init/
 
 rm -rf $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/pts-core
-cp -r pts-core $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/
-cp -r ob-cache $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/
-cp -r deploy $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/
+cp -R pts-core $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/
+cp -R ob-cache $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/
+cp -R deploy $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/
 rm -f $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/pts-core/static/phoronix-test-suite.desktop
 rm -f $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/pts-core/static/phoronix-test-suite-launcher.desktop
 rm -f $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/pts-core/openbenchmarking.org/openbenchmarking-mime.xml
@@ -114,14 +112,16 @@ else
 
 fi
 
-echo -e "\nPhoronix Test Suite Installation Completed\n
-Executable File: $INSTALL_PREFIX/bin/phoronix-test-suite
-Documentation: $INSTALL_PREFIX/share/doc/phoronix-test-suite/
-Phoronix Test Suite Files: $INSTALL_PREFIX/share/phoronix-test-suite/\n"
+echo
+echo "Phoronix Test Suite Installation Completed"
+echo
+echo "Executable File: $INSTALL_PREFIX/bin/phoronix-test-suite"
+echo "Documentation: $INSTALL_PREFIX/share/doc/phoronix-test-suite/"
+echo "Phoronix Test Suite Files: $INSTALL_PREFIX/share/phoronix-test-suite/"
+echo
 
 if [ "X$DESTDIR" != "X" ]
 then
 	echo "Installed to chroot: $DESTDIR"
-	echo "Please update your desktop and mime-database manually"
 fi
 
