[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bkcm-grub2=5D_/=3A_Remove_CPack_generator=2E_Use_rel?=
From:       Konstantinos Smanis <konstantinos.smanis () gmail ! com>
Date:       2011-04-20 23:13:18
Message-ID: 20110420231318.84F92A60A6 () git ! kde ! org
[Download RAW message or body]

Git commit ee992138187ee4e5f82894ced2db6a643c112785 by Konstantinos Smanis.
Committed on 21/04/2011 at 01:11.
Pushed by ksmanis into branch 'master'.

Remove CPack generator. Use release script instead.

Script source: http://looksblo.wordpress.com/2011/02/12/my-first-release/

M  +0    -5    CMakeLists.txt     
A  +87   -0    release.sh         [License: UNKNOWN]  *

The files marked with a * at the end have a non valid license. Please read: \
http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are \
listed at that page.


http://commits.kde.org/kcm-grub2/ee992138187ee4e5f82894ced2db6a643c112785

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ebb4576..1f92636 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,8 +32,3 @@ configure_file(config.h.cmake \
${CMAKE_CURRENT_BINARY_DIR}/src/config.h)  add_subdirectory(cfg)
 add_subdirectory(other)
 add_subdirectory(src)
-
-set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${KCM_GRUB2_VERSION}")
-set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*$;kdev4$;${CPACK_SOURCE_IGNORE_FILES}")
-set(CPACK_SOURCE_GENERATOR "TGZ")
-include(CPack)
diff --git a/release.sh b/release.sh
new file mode 100644
index 0000000..79fa926
--- /dev/null
+++ b/release.sh
@@ -0,0 +1,87 @@
+#!/bin/sh
+set -u
+
+WD=$(pwd)
+APP=kcm-grub2
+VERSION="0.3.6"
+MODULE=playground
+SUBMODULE=sysadmin
+THRESHOLD=80
+
+echo "== Start =="
+echo
+echo "== Fetching ${APP} source... =="
+git clone kde:${APP}
+rm -rf ${WD}/${APP}/.git
+rm ${WD}/${APP}/.gitignore
+rm ${WD}/${APP}/Messages.sh
+
+echo
+echo "== Patching ${APP} CMakeLists.txt... =="
+echo "find_package( Msgfmt REQUIRED )" >> ${WD}/${APP}/CMakeLists.txt
+echo "find_package( Gettext REQUIRED )" >> ${WD}/${APP}/CMakeLists.txt
+echo "add_subdirectory( po )" >> ${WD}/${APP}/CMakeLists.txt
+
+echo
+echo "== Fetching translations which are >=${THRESHOLD}% complete... =="
+for lang in $(svn cat svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/subdirs); do
+    test "${lang}" == "x-test" && continue
+    echo
+    echo "-- ${lang} --"
+
+    unset TRANS
+    unset FUZZY
+    unset UNTRANS
+    mkdir -p ${WD}/${APP}/po/${lang}
+    cd ${WD}/${APP}/po/${lang}
+    svn cat svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/${lang}/messages/${MODULE}-${SUBMODULE}/${APP}.po \
>${WD}/${APP}/po/${lang}/${APP}.po 2>/dev/null +    if test "$?" -ne "0"; then
+        echo "  No po file found."
+        rm -r ${WD}/${APP}/po/${lang}
+        continue
+    fi
+    STAT_STR=$(msgfmt --check --statistics -o /dev/null 2>&1 \
${WD}/${APP}/po/${lang}/${APP}.po) +    TRANS=$(echo ${STAT_STR}| awk '{print $1}')
+    if test "untranslated" == "$(echo ${STAT_STR}| awk '{print $5}')"; then
+        UNTRANS=$(echo ${STAT_STR}| awk '{print $4}')
+    else
+        if test "fuzzy" == "$(echo ${STAT_STR}| awk '{print $5}')"; then
+            FUZZY=$(echo ${STAT_STR}| awk '{print $4}')
+        fi
+        if test "untranslated" == "$(echo ${STAT_STR}| awk '{print $8}')"; then
+            UNTRANS=$(echo ${STAT_STR}| awk '{print $7}')
+        fi
+    fi
+    TRANS=${TRANS:-0}
+    FUZZY=${FUZZY:-0}
+    UNTRANS=${UNTRANS:-0}
+
+    TOTAL=$[${TRANS}+${FUZZY}+${UNTRANS}]
+    PERCENT=$[$[${TRANS}*100]/${TOTAL}]
+    if test "${PERCENT}" -ge "${THRESHOLD}"; then
+        echo "  Included (${PERCENT}%)."
+        echo "file( GLOB _po_files *.po )" >> ${WD}/${APP}/po/${lang}/CMakeLists.txt
+        echo "GETTEXT_PROCESS_PO_FILES( ${lang} ALL INSTALL_DESTINATION \
\${LOCALE_INSTALL_DIR} \${_po_files} )" >> ${WD}/${APP}/po/${lang}/CMakeLists.txt +   \
echo "add_subdirectory( ${lang} )" >> ${WD}/${APP}/po/CMakeLists.txt +        \
LANGS+=" ${lang}" +    else
+        echo "  Not included (${PERCENT}%)."
+        rm -r ${WD}/${APP}/po/${lang}
+    fi
+done
+
+echo
+echo "Languages included in the release:"
+echo ${LANGS}
+
+echo
+echo "== Renaming ${WD}/${APP} to ${WD}/${APP}-${VERSION}... =="
+mv ${WD}/${APP} ${WD}/${APP}-${VERSION}
+echo
+echo "== Creating tarball ${WD}/${APP}-${VERSION}.tar.gz... =="
+cd ${WD}
+tar czvf ${APP}-${VERSION}.tar.gz ${APP}-${VERSION}
+rm -rf ${APP}-${VERSION}
+
+echo
+echo "== Finished =="


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic