Commits

Anonymous committed 073946b

Update jdk to 7u45

Signed-off-by: Lee Pak Hong <benreilly@vector.Linux.net>

Comments (0)

Files changed (1)

var/vabs/jdk/src/jdk.SlackBuild

 #  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 #  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-PRGNAM=jdk
-NAME=$PRGNAM # Leave this for compatibility !!!
-VERSION=${VERSION:-7u15}
-LINK32="http://download.oracle.com/otn-pub/java/${NAME}/${VERSION}-b03/${NAME}-${VERSION}-linux-i586.tar.gz"
-LINK64="http://download.oracle.com/otn-pub/java/${NAME}/${VERSION}-b03/${NAME}-${VERSION}-linux-x64.tar.gz"
-LINK=${LINK:-"$LINNK32 $LINK64"}  #Enter URL for package here!
+NAME=jdk
+VERSION=${VERSION:-7u45}
+JDK_BUILD=b18
 
-BUILDNUM=${BUILDNUM:-"1"}
-VL_VERSION=${VL_VERSION:-"$(ls /var/log/packages/|grep vlconfig2|cut -d "-" -f4|cut -c 2-5)"}
-BUILD=${BUILD:-"$BUILDNUM""$VL_VERSION"}
 DVER=1.7.0_$(printf $VERSION | cut -du -f2)
 
-
-if [ "$NORUN" != 1 ]; then
-
-if [ -z "$ARCH" ]; then
-  case "$( uname -m )" in
-    i?86) ARCH=i586 ;;
-    arm*) ARCH=arm echo "Unsupported arch" exit 1;;
-       *) ARCH=$( uname -m ) ;;
-  esac
-fi
-
-CWD=$(pwd)
-PKG=$TMP/package-jdk
-OUTPUT=${OUTPUT:-"$CWD/.."}
-TMP=$OUTPUT/tmp
-if [ "$ARCH" = "x86_64" ]; then
-  LIB_ARCH=amd64
-  LIBDIRSUFFIX="64"
-  SRC_ARCH="x64"
-  LINK=$LINK64
-else
+#CFLAGS SETUP
+#--------------------------------------------
+ARCH=${ARCH:-"$(uname -m)"}
+if [[ "$ARCH" = i?86 ]]; then
+  ARCH=i586
+  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+  CONFIGURE_TRIPLET="i486-slackware-linux"
+  LIBDIRSUFFIX=""
+  JAVA_ARCH="i586"
   LIB_ARCH=i386
+elif [ "$ARCH" = "x86_64" ]; then
+  SLKCFLAGS="-O2 -fpic"
+  CONFIGURE_TRIPLET="x86_64-slackware-linux"
+  LIBDIRSUFFIX="64"
+  JAVA_ARCH="x64"
+  LIB_ARCH=amd64
+elif [ "$ARCH" = "powerpc" ]; then
+  SLKCFLAGS="-O2"
+  CONFIGURE_TRIPLET="powerpc-vlocity-linux"
   LIBDIRSUFFIX=""
-  SRC_ARCH="i586"
-  LINK=$LINK32
 fi
 
+BUILDNUM=${BUILDNUM:-"1"}
+VL_VERSION=${VL_VERSION:-"$(ls /var/log/packages/|grep vlconfig2|cut -d "-" -f4|cut -c 2-5)"}
+BUILD=${BUILD:-"$BUILDNUM""$VL_VERSION"}
+#LINK=${LINK:-"http://uni-smr.ac.ru/archive/dev/java/JRE/oracle/$MAJOR/$NAME-$VERSION-linux-$JAVA_ARCH.tar.gz"}
+LINK=${LINK:-"http://download.oracle.com/otn-pub/java/jdk/$VERSION-$JDK_BUILD/$NAME-$VERSION-linux-$JAVA_ARCH.tar.gz"}
+
+#get the source..........
+for SRC in $(echo $LINK);do
+if [ ! -f $CWD/$(basename $SRC) ]
+then
+	# download jre with cookie
+	# http://ivan-site.com/2012/05/download-oracle-java-jre-jdk-using-a-script/
+	wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" \
+	--no-check-certificate -O $NAME-$VERSION-linux-$JAVA_ARCH.tar.gz -c $SRC
+fi
+done
+CWD=$(pwd)
+cd ../
+RELEASEDIR=$(pwd)
+cd $CWD
+mkdir -p $RELEASEDIR/tmp
+TMP=$RELEASEDIR/tmp
+PKG=$TMP/package-$NAME
+rm -rf $PKG
+mkdir -p $TMP $PKG
+
 set -e
 
 rm -rf $PKG
 cd $PKG
 mkdir -p usr/lib${LIBDIRSUFFIX}
 cd usr/lib${LIBDIRSUFFIX}
-if [ ! -e $CWD/$(basename $LINK) ]; then
-	(cd $CWD;	wget -c --no-check-certificate $LINK )
-fi
-tar xvf $CWD/$(basename $LINK) || exit 1#$PRGNAM-$VERSION-linux-$SRC_ARCH.tar.gz
+tar xvf $CWD/$NAME-$VERSION-linux-${JAVA_ARCH}.tar.gz
 chown -R root.root $PKG
 find $PKG \
-  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+  \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
   -exec chmod 755 {} \; -o \
   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
   -exec chmod 644 {} \;
 
 mkdir -p $PKG/etc/profile.d
-for file in $(ls $CWD/profile.d/${PRGNAM}*) ; do
+for file in $(ls $CWD/profile.d/${NAME}*) ; do
   cat $file | sed -e "s#lib/java#lib${LIBDIRSUFFIX}/java#" \
     > $PKG/etc/profile.d/$(basename $file)
 done
 chmod 755 $PKG/etc/profile.d/*
 
 ( cd $PKG/usr/lib${LIBDIRSUFFIX}
-  mv ${PRGNAM}${DVER} java
-  ln -sf java ${PRGNAM}${DVER}
+  mv ${NAME}${DVER} java
+  ln -sf java ${NAME}${DVER}
 )
 
-mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/mozilla/plugins
-cd $PKG/usr/lib${LIBDIRSUFFIX}/mozilla/plugins
-    ln -sf /usr/lib${LIBDIRSUFFIX}/java/jre/lib/${LIB_ARCH}/libnpjp2.so libnpjp2.so
+if [ ${EXPLOIT_ME:-"no"} = "YES" ] ;then
+  mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/mozilla/plugins
+  cd $PKG/usr/lib${LIBDIRSUFFIX}/mozilla/plugins
+  ln -sf /usr/lib${LIBDIRSUFFIX}/java/jre/lib/${LIB_ARCH}/libnpjp2.so libnpjp2.so
+else
+  echo "
+        The February 2013 Critical Patch Update for Java SE addressed 50
+        security vulnerabilities, 44 of which affected the use of Java
+        as a plug-in for Web browers.
+
+            !! THE MOZILLA PLUGIN IS NO LONGER ACTIVATED BY DEFAULT !!
+       "
+  sleep 5
+fi
 
 cd $PKG/usr/lib${LIBDIRSUFFIX}
     ln -sf ./java/jre/lib/${LIB_ARCH}/server/libjvm.so .
 
 mkdir -p $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc || exit 1
+cat $CWD/slack-desc > $PKG/install/slack-desc
 cat << EOF > $PKG/install/doinst.sh
 # Clean up a potential upgrade mess caused by changing the
 # installation directory to /usr/lib${LIBDIRSUFFIX}/java/:
   $PKG/usr/share/mime/
 
 # Java may not expect compressed manpages, so don't compress them.
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKG/usr/doc/$NAME-$VERSION
 cp -a \
   $PKG/usr/lib${LIBDIRSUFFIX}/java/THIRDPARTYLICENSEREADME.txt \
   $PKG/usr/lib${LIBDIRSUFFIX}/java/LICENSE \
   $PKG/usr/lib${LIBDIRSUFFIX}/java/COPYRIGHT \
   $PKG/usr/lib${LIBDIRSUFFIX}/java/README.html \
-  $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+  $PKG/usr/doc/$NAME-$VERSION
+cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild
+
+# create slapt-get conflict to jre packages
+cat >> $PKG/install/slack-conflicts << EOF
+jre
+EOF
 
 cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD.${PKGTYPE:-txz}
-cat $CWD/slack-desc > $OUTPUT/slack-desc || exit 1
-fi
+requiredbuilder -v -y -s $RELEASEDIR $PKG
+makepkg -c n -l y $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.txz
+
+#rm -rf $TMP
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.