diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2019-11-28 02:34:44 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2019-11-28 02:34:44 +0100 |
commit | 644110a847c5911c2eb04eb53c93031740561efc (patch) | |
tree | 9658dde1cc70b52b233957b7852f87d997e98156 /Documentation/scripts | |
download | tde-packaging-gentoo-644110a847c5911c2eb04eb53c93031740561efc.tar.gz tde-packaging-gentoo-644110a847c5911c2eb04eb53c93031740561efc.zip |
Initial import of an ebuilds tree
from Fat-Zer's (Alexander Golubev) repository.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'Documentation/scripts')
-rwxr-xr-x | Documentation/scripts/test_separate_compilation.sh | 85 | ||||
-rwxr-xr-x | Documentation/scripts/update-keywords-lists | 32 | ||||
-rw-r--r-- | Documentation/scripts/usefull_commands | 15 | ||||
-rwxr-xr-x | Documentation/scripts/write-ebuild.sh | 60 |
4 files changed, 192 insertions, 0 deletions
diff --git a/Documentation/scripts/test_separate_compilation.sh b/Documentation/scripts/test_separate_compilation.sh new file mode 100755 index 00000000..75b980f1 --- /dev/null +++ b/Documentation/scripts/test_separate_compilation.sh @@ -0,0 +1,85 @@ +#!/bin/bash +# !!!WARNING!!! use with caution +# +# This script suppose the kdelibs to be installed +# how to use : +# dependecies_test_compilation <package![use[,use]...] [...] + +die() { + echo '!!! $@' + exit -100500 +} + + +RESULT_DIR="/tmp/test-build-$(date +%Y-%m-%d_%H-%M)" +SUCCESS_LIST="${RESULT_DIR}/success_list" +FAIL_LIST="${RESULT_DIR}/fail_list" +LOGS_DIR="${RESULT_DIR}/logs/" +CONFIG_BAK="${RESULT_DIR}/portage_bak.tar.gz" +PORTAGE_CONFIG="/etc/portage" +EMERGE_AUTOUNMASK_OPTS="--autounmask y --autounmask-keep-masks y --autounmask-write y" +mkdir -p "${RESULT_DIR}" "${LOGS_DIR}"; + +for pkguse in "$@"; do +done + +# backup config +tar -cf "${CONFIG_BAK}" -C / "${PORTAGE_CONFIG#/}" || die "backup config failed" + +# initial cleanup +( emerge -NuD world && + emerge --depclean && + emerge -NuD world && + revdep-rebuild && + rm -rf /var/tmp/portage ) || die "initial cleaning failed" + +for pkguse in "$@"; do + pkg="${pkguse%!*}" + use="${pkguse#*!}" + use="${use/,// }" + pkg_use_file="${PORTAGE_CONFIG}/package.use" + [ -d ${pkg_use_file} ] && pkg_use_file="${pkg_use_file}/test.use" + echo "$pkg $use" >>"$pkg_use_file" + pkg_failed=no + # check for it can be emerged due to depenencies uses + emerge -p "$pkg" + if [ "$?" != 0 ]; then + #try unmask uses + CONFIG_PROTECT_MASK="/etc/portage" emerge ${EMERGE_AUTOUNMASK_OPTS} "$pkg" + emerge -p "$pkg" + if [ "$?" != 0 ]; then + # we can't emerge the package + mkdir -p "${LOGS_DIR}/${pkg}" + emerge -p "$pkg" >"${LOGS_DIR}/${pkg}/emerge_failed" 2>&1 + pkg_failed=yes + fi + fi + + if [ "$pkg_failed" == no ]; then + emerge -1 "$pkg" + if [ "$?" != 0 ]; then + mkdir -p "${LOGS_DIR}/${pkg}" + for f_pkg in $(cd /var/tmp/portage/ && ls -d */*); do + cp "/var/tmp/portage/${f_pkg}/temp/build.log" "${LOGS_DIR}/${pkg}/${f_pkg/\//_}.build" + done + pkg_failed=yes + fi + fi + + if [ "$pkg_failed" == no ]; then + echo "$pkg" >>"${SUCCESS_LIST}" + else + echo "$pkg" >>"${FAIL_LIST}" + fi + + # restoring config + rm -rf ${PORTAGE_CONFIG} + tar -xf "${CONFIG_BAK}" -C / + + # let's clean system + ( emerge -NuD world && + emerge --depclean && + emerge -NuD world && + revdep-rebuild && + rm -rf /var/tmp/portage ) || die "cleaning failed" +done diff --git a/Documentation/scripts/update-keywords-lists b/Documentation/scripts/update-keywords-lists new file mode 100755 index 00000000..9390cdfb --- /dev/null +++ b/Documentation/scripts/update-keywords-lists @@ -0,0 +1,32 @@ +#!/bin/bash + +DOC="Documentation" +KEYWORDS_LIVE="$DOC/trinity.live.keywords" +KEYWORDS_3_5_13_2="$DOC/trinity.3.5.13.2.keywords" + +resort() { + cp "${1}" "${1}.bak" + cat "${1}.bak" | sort -u >"$1" && rm "${1}.bak" +} + +find trinity-base/ trinity-apps/ -iname '*9999.ebuild' | while read eb; do + PN="$(basename $(dirname ${eb}))" + C="$(basename $(dirname $(dirname ${eb})))" + P="$(basename ${eb%%.ebuild})" + if ! grep "^~$C/$P " "${KEYWORDS_LIVE}" >/dev/null 2>&1; then + echo "~$C/$P **" | tee -a "${KEYWORDS_LIVE}" + fi +done + +resort "${KEYWORDS_LIVE}" + + +find trinity-base/ trinity-apps -iname '*3.5.13.2.ebuild' | while read eb; do + PN="$(basename $(dirname ${eb}))" + C="$(basename $(dirname $(dirname ${eb})))" + P="$(basename ${eb%%.ebuild})" + if ! grep "^~$C/$P" "${KEYWORDS_3_5_13_2}" >/dev/null 2>&1; then + echo "~$C/$P" | tee -a "${KEYWORDS_3_5_13_2}" + fi +done +resort "${KEYWORDS_3_5_13_2}" diff --git a/Documentation/scripts/usefull_commands b/Documentation/scripts/usefull_commands new file mode 100644 index 00000000..8ecaa988 --- /dev/null +++ b/Documentation/scripts/usefull_commands @@ -0,0 +1,15 @@ +# Per ebuild check and commit +for I in <packages> ; do cp kate/metadata.xml $I; ebuild $I/$I-3.9999.ebuild digest; git add $I; git commit -m $I; done +for I in kstart ksystraycmd ksysguard nsplugin kate kxkb ; do cp kate/metadata.xml $I; ebuild $I/$I-3.9999.ebuild digest; git add $I; git commit -m $I; done + +# update trinity live lists +find trinity-base/ -iname '*9999.ebuild' | while read eb; do PN="$(basename $(dirname ${eb}))"; C="$(basename $(dirname $(dirname ${eb})))"; P="$(basename ${eb%%.ebuild})"; echo "~$C/$P"' **'; done | tee Documentation/trinity.live.keywords + +# update all manifests +find . -iname *.ebuild | while read eb; do ebuild $eb digest; done + +# run ./test_separate_compilation.sh +cat Documentation/derived-lists/<LIST> | sed 's/#.*//;s/^\s*//;s/\s*$//;/^\s*$/d' |xargs bash ./test_separate_compilation.sh + +# update manifests which older thatn ebuilds +find . -iname *.ebuild | while read eb; do ma="$(dirname $eb)/Manifest"; find $(dirname $eb) -type f | while read f; do [ $f -nt $ma ] && ebuild $eb digest && touch $ma; done; done diff --git a/Documentation/scripts/write-ebuild.sh b/Documentation/scripts/write-ebuild.sh new file mode 100755 index 00000000..c567bd6f --- /dev/null +++ b/Documentation/scripts/write-ebuild.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# Usage ; write-ebuild.sh <TRINITY_MODULE_NAME> [<CATEGORY/]><PN> [DESCRIPTION] +export LC_ALL=C + +EAPI="5" + +TRINITY_MODULE_NAME=$1 +PN=$(basename ${2}) +CATEGORY=$(dirname ${2}) +CATEGORY=${CATEGORY:-trinity-base} +DESCRIPTION="$3" + +PV=${PV:=9999} +KEYWORDS="amd64 x86" +case "${PV}" in + *3.5.13.2) KEYWORDS="~amd64 ~x86" ;; + *9999*) KEYWORDS="" ;; +esac + +if [ -z "$DESCRIPTION" ]; then + DESCRIPTION_SOURCES=( ${CATEGORY/trinity/kde}/${PN} ${CATEGORY/trinity/kde}/${PN/k/t} kde-base/${PN} kde-base/${PN/k/t} ) + for descsrc in ${DESCRIPTION_SOURCES[@]}; do + DESCRIPTION="$(eix -C $(dirname ${descsrc}) -s $(basename "${descsrc}") | sed -n '/^\s*Description:\s*/{s///;s/\(\<KDE\|\kde\)\>/Trinity/g;p}')" + [ -n "$DESCRIPTION" ] && break + done +fi + +echo "==> Creating ebuild for ${PN}-${PV}" + +mkdir -p "${CATEGORY}/$PN" + +cat <<EOF >${CATEGORY}/$PN/$PN-${PV}.ebuild +# Copyright 1999-$(date +%Y) Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# \$Id\$ +EAPI="$EAPI" +TRINITY_MODULE_NAME="$TRINITY_MODULE_NAME" + +inherit trinity-meta + +DESCRIPTION="$DESCRIPTION" +KEYWORDS="$KEYWORDS" +IUSE+="" +EOF + +cat <<EOF >"${CATEGORY}/$PN"/metadata.xml +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>fatzer2@gmail.com</email> + <name>Alexander Golubev</name> + </maintainer> +</pkgmetadata> +EOF + +if [ -d eclass/trinity-shared-files/${TRINITY_MODULE_NAME}-${PV} ]; then + mkdir -p "${CATEGORY}/$PN/files/" + ln -s "../../../eclass/trinity-shared-files/" "trinity-base/$PN/files/shared" +fi |