LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Multilib convertpkg-compat32 and java doinst.sh (https://www.linuxquestions.org/questions/slackware-14/multilib-convertpkg-compat32-and-java-doinst-sh-4175581563/)

kjhambrick 06-06-2016 09:03 AM

Multilib convertpkg-compat32 and java doinst.sh
 
I was looking at running convertpkg-compat32 on a 32-bit package generated by the standard slackware java.SlackBuild.

Before installing the resulting package, I looked at install/doinst.sh to make sure it was 'safe' to run.

It is not safe to run because it's missing a closing `fi` which will cause the converted doinst.sh to fail.

I didn't install it and looked around for similar reports on LQ.

Here's one from 2012 ...

http://www.linuxquestions.org/questi...urrent-946939/

As Eric said, fixing that particular issue would require a sophisticated parser in convertpkg-compat32 ...

However, if Pat's team were to modify the 'fi' statement ( by adding a comment after the fi ), convertpkg-compat32 would generate a working doinst.sh script.

Here's a patch:

# diff -Naur java.SlackBuild.orig java.SlackBuild
Code:

--- java.SlackBuild.orig        2012-08-02 10:50:43.000000000 -0500
+++ java.SlackBuild    2016-06-06 07:45:09.696483819 -0500
@@ -124,7 +124,7 @@
 cat << EOF >> $PKG/install/doinst.sh
  mkdir -p usr/lib${LIBDIRSUFFIX}/java/bin
  mkdir -p usr/lib${LIBDIRSUFFIX}/mozilla/plugins
-fi
+fi  # [ -L usr/lib${LIBDIRSUFFIX}/java ] # added for convertpkg-compat32
 if [ -L ControlPanel ]; then
  rm -f ControlPanel
 fi

What you end up with is this doinst.sh script ( note the comment after the first `fi`:

# cat /tmp/package-java/install/doinst.sh

Code:

# Clean up a potential upgrade mess caused by changing the
# installation directory to /usr/lib/java/:
if [ -L usr/lib/java ]; then
  rm -rf usr/lib/java
  mkdir -p usr/lib/java/man
  mkdir -p usr/lib/java/lib/i386/server
  mkdir -p usr/lib/java/lib/i386/client
  mkdir -p usr/lib/java/javaws
  mkdir -p usr/lib/java/bin
  mkdir -p usr/lib/mozilla/plugins
fi  # [ -L usr/lib/java ] # added for convertpkg-compat32
if [ -L ControlPanel ]; then
  rm -f ControlPanel
fi
if [ -L ja ]; then
  rm -f ja
fi
if [ -L javaws ]; then
  rm -f javaws
fi
if [ -L libjsig.so ]; then
  rm -f libjsig.so
fi
# End cleanup.

( cd usr/lib ; rm -rf libjvm.so )
( cd usr/lib ; ln -sf ./java/lib/i386/server/libjvm.so libjvm.so )
( cd usr/lib/mozilla/plugins ; rm -rf libnpjp2.so )
( cd usr/lib/mozilla/plugins ; ln -sf /usr/lib/java/lib/i386/libnpjp2.so libnpjp2.so )
( cd usr/lib/java/bin ; rm -rf ControlPanel )
( cd usr/lib/java/bin ; ln -sf jcontrol ControlPanel )
( cd usr/lib/java/man ; rm -rf ja )
( cd usr/lib/java/man ; ln -sf ja_JP.UTF-8 ja )
( cd usr/lib/java/lib/i386/server ; rm -rf libjsig.so )
( cd usr/lib/java/lib/i386/server ; ln -sf ../libjsig.so libjsig.so )
( cd usr/lib/java/lib/i386/client ; rm -rf libjsig.so )
( cd usr/lib/java/lib/i386/client ; ln -sf ../libjsig.so libjsig.so )
( cd usr/lib ; rm -rf jre1.8.0_92 )
( cd usr/lib ; ln -sf java jre1.8.0_92 )

After running the resulting package thru convertpkg-compat32 you get this install/doinst.sh which runs fine in jre-compat32-${VERSION}-x86_64-1compat32.txz:

Code:

# cat install/doinst.sh
# installation directory to /usr/lib/java/:
if [ -L usr/lib/java ]; then
  rm -rf usr/lib/java
  mkdir -p usr/lib/java/man
  mkdir -p usr/lib/java/lib/i386/server
  mkdir -p usr/lib/java/lib/i386/client
  mkdir -p usr/lib/java/javaws
  mkdir -p usr/lib/java/bin
  mkdir -p usr/lib/mozilla/plugins
fi  # [ -L usr/lib/java ] # added for convertpkg-compat32
( cd usr/lib ; rm -rf libjvm.so )
( cd usr/lib ; ln -sf ./java/lib/i386/server/libjvm.so libjvm.so )
( cd usr/lib/mozilla/plugins ; rm -rf libnpjp2.so )
( cd usr/lib/mozilla/plugins ; ln -sf /usr/lib/java/lib/i386/libnpjp2.so libnpjp2.so )
( cd usr/lib/java/bin ; rm -rf ControlPanel )
( cd usr/lib/java/bin ; ln -sf jcontrol ControlPanel )
( cd usr/lib/java/man ; rm -rf ja )
( cd usr/lib/java/man ; ln -sf ja_JP.UTF-8 ja )
( cd usr/lib/java/lib/i386/server ; rm -rf libjsig.so )
( cd usr/lib/java/lib/i386/server ; ln -sf ../libjsig.so libjsig.so )
( cd usr/lib/java/lib/i386/client ; rm -rf libjsig.so )
( cd usr/lib/java/lib/i386/client ; ln -sf ../libjsig.so libjsig.so )
( cd usr/lib ; rm -rf jre1.8.0_92 )
( cd usr/lib ; ln -sf java jre1.8.0_92 )

Anyhow ... a q&d fix to work around the grep command in convertpkg-compat32

-- kjh


All times are GMT -5. The time now is 10:04 PM.