diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2019-11-19 17:45:28 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2019-11-19 17:45:28 +0100 |
commit | e6636bd5d6280d92996bd70b744e8a29e54c7e18 (patch) | |
tree | 014989bddcbc22c7a8d4dafa7b78f3e55b184718 /gentoo/Documentation/scripts/write-ebuild.sh | |
parent | 4b7471734323c7cb5bdc129857c94041418c81b5 (diff) | |
download | tde-packaging-e6636bd5d6280d92996bd70b744e8a29e54c7e18.tar.gz tde-packaging-e6636bd5d6280d92996bd70b744e8a29e54c7e18.zip |
Gentoo: 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 'gentoo/Documentation/scripts/write-ebuild.sh')
-rwxr-xr-x | gentoo/Documentation/scripts/write-ebuild.sh | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/gentoo/Documentation/scripts/write-ebuild.sh b/gentoo/Documentation/scripts/write-ebuild.sh new file mode 100755 index 000000000..c567bd6fe --- /dev/null +++ b/gentoo/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 |