aboutsummaryrefslogtreecommitdiffstats
path: root/idea
diff options
context:
space:
mode:
authorSukma Wardana <hey@swardana.com>2020-09-04 11:42:26 +0700
committerSukma Wardana <hey@swardana.com>2020-09-04 11:42:26 +0700
commitf2c2b2df62c6b4fc87a7044b4d7bf6b9538d95af (patch)
tree5e5cb34258fec6f40049c700dbb0b0a83b974ce2 /idea
parent71e481523111e275f554d9cc89cb8f47d7ed490a (diff)
downloadslackbuilds-f2c2b2df62c6b4fc87a7044b4d7bf6b9538d95af.tar.gz
slackbuilds-f2c2b2df62c6b4fc87a7044b4d7bf6b9538d95af.zip
Add Slackware packages for IntelliJ IDEA Community Edition (CE) 2020
Signed-off-by: Sukma Wardana <hey@swardana.com>
Diffstat (limited to 'idea')
-rw-r--r--idea/doinst.sh13
-rw-r--r--idea/idea.SlackBuild186
-rw-r--r--idea/idea.desktop9
-rw-r--r--idea/idea.info10
-rw-r--r--idea/idea.pngbin0 -> 5462 bytes
-rw-r--r--idea/idea.sh3
-rw-r--r--idea/slack-desc19
-rw-r--r--idea/slack-required1
8 files changed, 241 insertions, 0 deletions
diff --git a/idea/doinst.sh b/idea/doinst.sh
new file mode 100644
index 0000000..aea0f89
--- /dev/null
+++ b/idea/doinst.sh
@@ -0,0 +1,13 @@
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+if [ -x /usr/bin/update-mime-database ]; then
+ /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
+fi
+
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+ if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
diff --git a/idea/idea.SlackBuild b/idea/idea.SlackBuild
new file mode 100644
index 0000000..c18abf2
--- /dev/null
+++ b/idea/idea.SlackBuild
@@ -0,0 +1,186 @@
+#!/bin/sh
+#
+# Copyright 2020 Sukma Wardana <hey@swardana.com>
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Run 'sh idea.SlackBuild' to build a Slackware package.
+# The package (.tgz) and .txt file as well as build logs are created in /tmp.
+# Install it using 'installpkg'.
+#
+
+# Set initial variables:
+
+PRGNAM=idea
+VERSION=${VERSION:-2020.2.1}
+BUILD=${BUILD:-1}
+# The TAG is a unique identifier for all your Slackware packages.
+# Use your initials as the value for TAG for instance.
+TAG=${TAG:-_sw}
+
+# This covers most filenames you'd want as documentation. Change if needed.
+DOCS="build* install-linux-tar* LICENSE* NOTICE* product-info.json"
+
+# Where do we look for sources?
+SRCDIR=$(cd $(dirname $0); pwd)
+
+# Place to build (TMP) package (PKG) and output (OUTPUT) the program:
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+IDEA_HOME=/opt/$PRGNAM
+
+SOURCE="$SRCDIR/${PRGNAM}IC-${VERSION}.tar.gz"
+SRCURL="https://download.jetbrains.com/${PRGNAM}/${PRGNAM}IC-${VERSION}.tar.gz"
+
+##
+## --- with a little luck, you won't have to edit below this point --- ##
+##
+
+# Automatically determine the architecture we're building on:
+ARCH=noarch
+
+# Exit the script on errors:
+set -e
+trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR
+# Catch unitialized variables:
+set -u
+P1=${1:-1}
+
+# Save old umask and set to 0022:
+_UMASK_=$(umask)
+umask 0022
+
+# Create working directories:
+mkdir -p $OUTPUT # place for the package to be saved
+mkdir -p $TMP/tmp-$PRGNAM # location to build the source
+mkdir -p $PKG # place for the package to be built
+rm -rf $PKG/* # always erase old package's contents
+rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build
+rm -rf $OUTPUT/{configure,make,install,error,makepkg}-$PRGNAM.log
+ # remove old log files
+mkdir -p $PKG/$IDEA_HOME $PKG/usr/local/{bin,share/java}
+ # create required directory inside $PKG
+
+# Source file availability:
+if ! [ -f ${SOURCE} ]; then
+ echo "Source '$(basename ${SOURCE})' not available yet..."
+ # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
+ [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)"
+ if [ -f ${SOURCE} ]; then echo "Ah, found it!"; continue; fi
+ if ! [ "x${SRCURL}" == "x" ]; then
+ echo "Will download file to $(dirname $SOURCE)"
+ wget -nv -T 20 -O "${SOURCE}" "${SRCURL}" || true
+ if [ $? -ne 0 -o ! -s "${SOURCE}" ]; then
+ echo "Downloading '$(basename ${SOURCE})' failed... aborting the build."
+ mv -f "${SOURCE}" "${SOURCE}".FAIL
+ exit 1
+ fi
+ else
+ echo "File '$(basename ${SOURCE})' not available... aborting the build."
+ exit 1
+ fi
+fi
+
+if [ "$P1" == "--download" ]; then
+ echo "Download complete."
+ exit 0
+fi
+
+# --- PACKAGE BUILDING ---
+echo "++"
+echo "|| $PRGNAM-$VERSION"
+echo "++"
+
+cd $TMP/tmp-$PRGNAM
+
+mkdir -p ${PRGNAM}
+cd ${PRGNAM}
+
+echo "Extracting the source archive(s) for $PRGNAM..."
+tar -xvzf ${SOURCE} --strip-components=1
+ # Extract start from sub-directory 1 level beneath
+
+chown -R root:root .
+chmod -R u+w,go+r-w,a+X-s .
+
+echo "Building ..."
+cp -a bin/ jbr/ lib/ license/ \
+ plugins/ redist/ $PKG/$IDEA_HOME
+
+# Add idea to KDE/GNOME/XFCE menu
+install -D -m 644 ${SRCDIR}/${PRGNAM}.desktop \
+ ${PKG}/usr/share/applications/${PRGNAM}.desktop
+
+# Add an icon for idea
+install -D -m 644 ${SRCDIR}/${PRGNAM}.png ${PKG}/usr/share/pixmaps/${PRGNAM}.png
+
+# Add script to call idea from /usr/local/bin
+install -D -m 755 ${SRCDIR}/${PRGNAM}.sh ${PKG}/usr/local/bin/${PRGNAM}
+
+# Strip binaries (if any):
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+# Add documentation:
+mkdir -p $PKG/usr/local/doc/$PRGNAM-$VERSION
+cp -a $DOCS $PKG/usr/local/doc/$PRGNAM-$VERSION || true
+cat $SRCDIR/$(basename $0) > $PKG/usr/local/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+chown -R root:root $PKG/usr/local/doc/$PRGNAM-$VERSION
+find $PKG/usr/local/doc -type f -exec chmod 644 {} \;
+
+# Compress the man page(s):
+if [ -d $PKG/usr/local/man ]; then
+ find $PKG/usr/local/man -type f -name "*.?" -exec gzip -9f {} \;
+ for i in $(find $PKG/usr/local/man -type l -name "*.?") ; do
+ ln -s $( readlink $i ).gz $i.gz ; rm $i ;
+ done
+fi
+
+# Compress info pages and remove the package's dir file:
+if [ -d $PKG/usr/local/info ]; then
+ rm -f $PKG/usr/local/info/dir
+ gzip -9f $PKG/usr/local/info/*.info*
+ # If any info files are present, consider adding this to a doinst.sh:
+ # chroot . install-info /usr/info/local/XXXXX.info.gz /usr/local/info/dir 2> /dev/null
+fi
+
+# Add a package description:
+mkdir -p $PKG/install
+cat $SRCDIR/slack-desc > $PKG/install/slack-desc
+if [ -f $SRCDIR/doinst.sh ]; then
+ cat $SRCDIR/doinst.sh >> $PKG/install/doinst.sh
+fi
+if [ -f $SRCDIR/slack-required ]; then
+ cat $SRCDIR/slack-required > $PKG/install/slack-required
+fi
+
+# Build the package:
+cd $PKG
+makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-tgz} 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
+cd $OUTPUT
+md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-tgz} > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-tgz}.md5
+cd -
+cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt
+if [ -f $PKG/install/slack-required ]; then
+ cat $PKG/install/slack-required > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.dep
+fi
+
+# Restore the original umask:
+umask ${_UMASK_}
diff --git a/idea/idea.desktop b/idea/idea.desktop
new file mode 100644
index 0000000..88c5980
--- /dev/null
+++ b/idea/idea.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+VERSION=1.0
+Type=Application
+Exec=idea
+Name=IntelliJ IDEA Community Edition
+GenericName=IntelliJ IDEA
+Icon=idea
+StartupNotifiy=true
+Categories=Development;IDE;Qt;KDE;GTK;GNOME;
diff --git a/idea/idea.info b/idea/idea.info
new file mode 100644
index 0000000..4fe02de
--- /dev/null
+++ b/idea/idea.info
@@ -0,0 +1,10 @@
+PRGNAM="idea"
+VERSION="2020.2.1"
+HOMEPAGE="https://www.jetbrains.com/idea/"
+DOWNLOAD="https://download.jetbrains.com/idea/ideaIC-2020.2.1.tar.gz"
+MD5SUM="f547d9ff482c3d887c28b1e58934e0c6"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="jdk"
+MAINTAINER="Sukma Wardana"
+EMAIL="hey@swardana.com"
diff --git a/idea/idea.png b/idea/idea.png
new file mode 100644
index 0000000..60f837c
--- /dev/null
+++ b/idea/idea.png
Binary files differ
diff --git a/idea/idea.sh b/idea/idea.sh
new file mode 100644
index 0000000..98d0923
--- /dev/null
+++ b/idea/idea.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+cd ${HOME}
+/opt/idea/bin/idea.sh $@
diff --git a/idea/slack-desc b/idea/slack-desc
new file mode 100644
index 0000000..74856b8
--- /dev/null
+++ b/idea/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+idea: IntelliJ IDEA Community Edition is the open source version of
+idea: IntelliJ IDEA
+idea:
+idea: IntelliJ IDEA is a premier IDE (Integrated Development Environment)
+idea: for Java, Groovy and other programming languages such as Scala
+idea: or Clojure.
+idea:
+idea:
+idea: Homepage: https://www.jetbrains.com/idea/
+idea:
+idea:
diff --git a/idea/slack-required b/idea/slack-required
new file mode 100644
index 0000000..25feecc
--- /dev/null
+++ b/idea/slack-required
@@ -0,0 +1 @@
+jdk \ No newline at end of file