summaryrefslogtreecommitdiffstats
path: root/kde/plasma_checkout.sh
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2014-12-22 15:23:54 +0100
committer Eric Hameleers <alien@slackware.com>2014-12-22 15:23:54 +0100
commitb1b35d20ce6b70330b23a9d056dcb44b58795bd6 (patch)
treed393ca76dae97b64e8de58184a15f60ca1a7412a /kde/plasma_checkout.sh
parentf0e6e91722ec10bf7aa6a4bf53d1aedd8aee4c74 (diff)
downloadktown-b1b35d20ce6b70330b23a9d056dcb44b58795bd6.tar.gz
ktown-b1b35d20ce6b70330b23a9d056dcb44b58795bd6.tar.xz
KDE 5 for Slackware current (post-14.1) (16sep2014)5
The KDE 5 Software Compilation no longer exists as such. The components are now: - Frameworks 5.2.0 - Plasma 5.0.2 These packages need to be installed on top of the most recent KDE 4.14.x because Applications tarballs which build on top of Frameworks and Plasma have not yet been released.
Diffstat (limited to 'kde/plasma_checkout.sh')
-rw-r--r--kde/plasma_checkout.sh146
1 files changed, 146 insertions, 0 deletions
diff --git a/kde/plasma_checkout.sh b/kde/plasma_checkout.sh
new file mode 100644
index 0000000..edb8bf7
--- /dev/null
+++ b/kde/plasma_checkout.sh
@@ -0,0 +1,146 @@
+#!/bin/sh
+# $id$
+# -----------------------------------------------------------------------------
+# Purpose: A script to checkout sources for KDE Plasma Next from the
+# git repositories and create tarballs of them.
+# Author: Eric Hameleers <alien@slackware.com>
+# Date: 20140604
+# -----------------------------------------------------------------------------
+
+# Defaults:
+
+# Directory where we start:
+CWD=$(pwd)
+
+# Cleanup (delete) the directories containing the local clones afterwards:
+CLEANUP="NO"
+
+# Checkout at a custom date instead of today:
+CUSTDATE="NO"
+
+# Forced overwriting of existing tarballs:
+FORCE="NO"
+
+# Where to write the files by default:
+MYDIR="${CWD}/_plasma_checkouts"
+
+# KDE git repositories:
+KDEGITURI="git://anongit.kde.org"
+
+# Prefered branch to check out from if it exists (HEAD otherwise):
+BRANCH="frameworks"
+
+# Shrink the tarball by removing git repository metadata:
+SHRINK="YES"
+
+# Today's timestamp:
+THEDATE=$(date +%Y%m%d)
+
+# The KDE topdirectory ( by default the location of this script):
+TOPDIR=$(cd $(dirname $0); pwd)
+
+# -----------------------------------------------------------------------------
+while getopts "cd:fghk:o:" Option
+do
+ case $Option in
+ c ) CLEANUP="YES"
+ ;;
+ d ) THEDATE="date --date='${OPTARG}' +%Y%m%d"
+ CUSTDATE="${OPTARG}"
+ ;;
+ f ) FORCE="YES"
+ ;;
+ g ) SHRINK="NO"
+ ;;
+ k ) TOPDIR="${OPTARG}"
+ ;;
+ o ) MYDIR="${OPTARG}"
+ ;;
+ h|* )
+ echo "$(basename $0) [<param> <param> ...] [<module> <module> ...]"
+ echo "Parameters are:"
+ echo " -h This help."
+ echo " -c Cleanup afterwards (delete the cloned repos)."
+ echo " -d <date> Checkout git at <date> instead of today."
+ echo " -f Force overwriting of tarballs if they exist."
+ echo " -g Keep git repository metadata (bigger tarball)."
+ echo " -o <dir> Create tarballs in <dir> instead of $MYDIR/."
+ echo " -k <dir> Location of KDE sources if not $(cd $(dirname $0), pwd)/."
+ exit
+ ;;
+ esac
+done
+
+shift $(($OPTIND - 1))
+# End of option parsing.
+# $1 now references the first non option item supplied on the command line
+# if one exists.
+# -----------------------------------------------------------------------------
+
+# Catch any individual requests on the commandline:
+MODS=${1:-""}
+
+# Verify that our TOPDIR is the KDE source top directory:
+if ! [ -f ${TOPDIR}/KDE.SlackBuild -a -d ${TOPDIR}/src ]; then
+ echo ">> Error: '$TOPDIR' does not seem to contain the KDE SlackBuild plus sources"
+ echo ">> Either place this script in the KDE directory before running it,"
+ echo ">> Or specify the KDE toplevel source directory with the '-k' parameter"
+ exit 1
+fi
+
+# No modules specified on the commandline; get all enabled plasma modules:
+if [ ! -n "$MODS" ]; then
+ MODS="$(cat ${TOPDIR}/modules/plasma | grep -v " *#" | grep -v "^$")"
+fi
+
+# Create the work directory:
+mkdir -p "${MYDIR}"
+if [ $? -ne 0 ]; then
+ echo "Error creating '${MYDIR}' - aborting."
+ exit 1
+fi
+cd "${MYDIR}"
+
+# Proceed with checking out all plasma-next sources.
+# Some packages are called foo-framework to make them co-installable with the
+# KDE4 packages with the same source-name. Strip the '-framework' off the
+# package name to get the source name):
+
+for MOD in $MODS ; do
+ git clone ${KDEGITURI}/${MOD%-framework}.git ${MOD%-framework}-${THEDATE}git
+ ( cd ${MOD%-framework}-${THEDATE}git
+ git checkout ${BRANCH} # If this fails we should have 'master' anyway
+ if [ $? -ne 0 ]; then
+ BRANCH="master"
+ fi
+ if [ "$CUSTDATE" != "NO" ]; then
+ # Checkout at a specified date instead of HEAD:
+ git checkout $(git rev-list -n 1 --before="`date -d $THEDATE`" $BRANCH)
+ fi
+ )
+done
+
+if [ "$SHRINK" = "YES" ]; then
+ # Remove git meta data from the tarballs:
+ for DIR in $(ls |grep git$) ; do
+ find ${DIR%/} -name ".git*" -depth -exec rm -rf {} \;
+ done
+fi
+
+# Zip them up:
+for DIR in $(ls |grep git$) ; do
+ if [ "$FORCE" = "NO" -a -f ${DIR%/}.tar.xz ]; then
+ echo ">> Not overwriting existng file '${DIR%/}.tar.xz'"
+ echo ">> Use '-f' to force ovewriting existing files"
+ else
+ tar -Jcf ${DIR%/}.tar.xz ${DIR%/}
+ fi
+done
+
+if [ "$CLEANUP" = "YES" ]; then
+ # Remmove the cloned directories now that we have the tarballs:
+ rm -r *git
+fi
+
+cd $CWD
+# Done!