From e749b9d99fa6ef0a1a89c91185bc5be88242dbe9 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 11 Aug 2010 21:57:59 +0000 Subject: [PATCH] Neues ebuild games-misc/fortune-mod-de git-svn-id: http://svn.brehm-online.com/svn/portage@91 18afd0d2-9f2f-0410-a0ac-b8d70fd81a6b --- games-misc/fortune-mod-de/Manifest | 2 + .../fortune-mod-de/fortune-mod-de-0.25.ebuild | 140 ++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 games-misc/fortune-mod-de/Manifest create mode 100644 games-misc/fortune-mod-de/fortune-mod-de-0.25.ebuild diff --git a/games-misc/fortune-mod-de/Manifest b/games-misc/fortune-mod-de/Manifest new file mode 100644 index 0000000..0d3df91 --- /dev/null +++ b/games-misc/fortune-mod-de/Manifest @@ -0,0 +1,2 @@ +DIST fortunes-de_0.25.orig.tar.gz 1036718 RMD160 66bfa797166bd554e8af6aca95f35e782ab5b399 SHA1 47ed1f3be3c30568debe6b97272a9181acb817ef SHA256 38eb10f59915af6517b73da3b95902c7d56edb41bfcad06ce249a446e3622ab4 +EBUILD fortune-mod-de-0.25.ebuild 3448 RMD160 9a2e109aff8229b60980271fee138b68c9d6e347 SHA1 008bf79d138ad1b48464c1e991b609fecabaf19f SHA256 117c87ab305c1d2821ca4db7f07186e397cf60e333f01944a1cf24c3e363c36a diff --git a/games-misc/fortune-mod-de/fortune-mod-de-0.25.ebuild b/games-misc/fortune-mod-de/fortune-mod-de-0.25.ebuild new file mode 100644 index 0000000..836f7db --- /dev/null +++ b/games-misc/fortune-mod-de/fortune-mod-de-0.25.ebuild @@ -0,0 +1,140 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/games-misc/fortune-mod-fvl/fortune-mod-fvl-20030120.ebuild,v 1.11 2006/07/19 19:48:35 flameeyes Exp $ + +S=${WORKDIR}/fortunes-de-${PV} + +DESCRIPTION="German Quotes for fortune" +HOMEPAGE="http://packages.debian.org/source/lenny/fortunes-de/" +SRC_URI="http://ftp.de.debian.org/debian/pool/main/f/fortunes-de/fortunes-de_${PV}.orig.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd" +IUSE="unicode" + +RDEPEND="games-misc/fortune-mod" +DEPEND="${RDEPEND} + unicode? ( virtual/libiconv )" + +S=${WORKDIR}/fortunes-de-${PV} + +#src_unpack() { +# unpack ${A} +# cd "${S}" +# rm -f install.sh +#} + +src_compile() { + + cd ${S} + + str_it() { + + base="$( basename $1 )" + dat="dat/${base}" + echo " ${base}" + cp -a -f "$1" "${dat}" + if use unicode ; then + # convert to UTF-8 + iconv --from-code latin1 --to-code utf8 -o"${dat}.utf8" "${dat}" + mv "${dat}.utf8" "${dat}" + # Create file with extension *.u8 to give fortune binary a hint to this encoding +# ln -s "${base}" "${dat}".u8 + fi + strfile -s "${dat}" + } + + mkdir dat tmp + for DIR in dat tmp ; do + if [ ! -d ${DIR} ] ; then + mkdir "${DIR}" + fi + done + + echo "Erstelle Fortune-Datenfiles ..." + + ### Databases + FORTUNES=`find data -maxdepth 1 -type f | sed "s?data/??"` + FORTUNESMORE=`find data-more -maxdepth 1 -type f | sed "s?data-more/??"` + DIRS=`find data -maxdepth 1 -type d | sed "s?data/??" | sed "/data/d"` + + ### Rezepte + REZEPTE=`find rezepte -maxdepth 1 -type d | sed "s?rezepte/??" | sed "/rezepte/d"` + REZEPTTMP=rezept.tmp.$$ + + # nicht veränderte Datenfiles + for spruch in $FORTUNES; do + str_it data/$spruch + done + + # Ungeprüfte und unsortierte Datenfiles + for spruch in $FORTUNESMORE; do + str_it data-more/$spruch + done + + # Datenfiles, die einzeln besser pflegbar sind, aber zu einem + # Fortune-File zusammengefaßt werden + for dir in $DIRS; do + cat $( find data/$dir -type f | sort ) > tmp/$dir + str_it tmp/$dir + rm -f tmp/$dir + done + + # zu formatierende Daten + cd predata + # komische Namen + sed "s/.*/Wie man sein Kind nicht nennen sollte: \\ + & \\ +%/" prenamen | sed "\$d" > ../tmp/namen + # "Warmduscher" + sed "s/.*/Hallo &!\\ +%/" prewarmduscher | sed "\$d" > ../tmp/warmduscher + cd .. + str_it tmp/namen + str_it tmp/warmduscher + + # Rezepte + for typ in $REZEPTE ; do + rm -f ${REZEPTTMP} + for rezept in $( ls rezepte/$typ | sort ); do + cat rezepte/$typ/$rezept >> ${REZEPTTMP} + echo "%" >> ${REZEPTTMP} + done + sed "\$d" ${REZEPTTMP} > tmp/$typ + str_it tmp/$typ + rm -f ${REZEPTTMP} + done + + # Script 'spruch' anpassen + cat bin/spruch.sh | \ + sed "s?/usr/local/share/games/fortunes?/usr/share/fortune?" | \ + sed "s?\(FORTUNEPATH=\)/usr/local/games/?\1/usr/bin/?" | \ + sed "s?/etc/locale.alias?/usr/share/locale/locale.alias?g" | \ + sed "s?dpkg-reconfigure fortunes-de?emerge --oneshot ${CATEGORY}/${PN}:${SLOT}?" \ + > bin/spruch + + chmod 755 bin/spruch + +} + +src_install() { + + insinto /usr/share/fortune/de + doins dat/* || die + dobin bin/spruch + dodoc README AUTHORS NEWS LIESMICH GPL-Deutsch + doman man/spruch.6 + doman -i18n=de man/de/spruch.6 + + if use unicode ; then + + dosed "s/iso-8859-1/utf-8/g" usr/bin/spruch + + cd ${S} + for f in $( ls -1 dat | grep -v ".dat$" ) ; do + einfo "Linking '${f}' ..." + dosym ${f} /usr/share/fortune/de/${f}.u8 + done + fi +} -- 2.39.5