diff options
author | Tristan Heaven <nyhm@gentoo.org> | 2007-02-17 09:26:11 +0000 |
---|---|---|
committer | Tristan Heaven <nyhm@gentoo.org> | 2007-02-17 09:26:11 +0000 |
commit | e425385f6dfbb289d503e6117b3b98cd6951095e (patch) | |
tree | de2038672611c270c37d54bdae3b5c5416137fe8 /games-strategy/freecraft | |
parent | ensure media-libs/gd is built with jpeg and png thanks to suggestion by Panag... (diff) | |
download | gentoo-2-e425385f6dfbb289d503e6117b3b98cd6951095e.tar.gz gentoo-2-e425385f6dfbb289d503e6117b3b98cd6951095e.tar.bz2 gentoo-2-e425385f6dfbb289d503e6117b3b98cd6951095e.zip |
Fix ROOT abuse, bug #167277
(Portage version: 2.1.2-r9)
Diffstat (limited to 'games-strategy/freecraft')
-rw-r--r-- | games-strategy/freecraft/ChangeLog | 7 | ||||
-rw-r--r-- | games-strategy/freecraft/files/1.18-setup.patch | 150 | ||||
-rw-r--r-- | games-strategy/freecraft/files/freecraft | 4 | ||||
-rw-r--r-- | games-strategy/freecraft/freecraft-1.18-r3.ebuild | 73 |
4 files changed, 169 insertions, 65 deletions
diff --git a/games-strategy/freecraft/ChangeLog b/games-strategy/freecraft/ChangeLog index 6fb13503a072..f302a6968f72 100644 --- a/games-strategy/freecraft/ChangeLog +++ b/games-strategy/freecraft/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for games-strategy/freecraft -# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-strategy/freecraft/ChangeLog,v 1.14 2006/12/21 08:21:53 mr_bones_ Exp $ +# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/games-strategy/freecraft/ChangeLog,v 1.15 2007/02/17 09:26:11 nyhm Exp $ + + 17 Feb 2007; Tristan Heaven <nyhm@gentoo.org> freecraft-1.18-r3.ebuild: + Fix ROOT abuse, bug #167277 21 Dec 2006; Michael Sterrett <mr_bones_@gentoo.org> +files/freecraft-1.18-Makefile.patch, freecraft-1.18-r3.ebuild: diff --git a/games-strategy/freecraft/files/1.18-setup.patch b/games-strategy/freecraft/files/1.18-setup.patch index b92ff5f43335..cfcdd4b4bdcd 100644 --- a/games-strategy/freecraft/files/1.18-setup.patch +++ b/games-strategy/freecraft/files/1.18-setup.patch @@ -1,50 +1,164 @@ ---- setup.orig 2003-06-20 13:07:06.000000000 -0400 -+++ setup 2003-06-20 13:14:36.000000000 -0400 -@@ -31 +31 @@ +--- setup ++++ setup +@@ -28,7 +28,7 @@ + ##----------------------------------------------------------------------------- + ## HERE ARE SOME USER-CONFIGURABLE VARIABLES + -EXTRA_CFLAGS="-DUNIT_ON_MAP -DNEW_AI -DUSE_LIBMODPLUG -DUSE_HP_FOR_XP -DNEW_FOW -DBUILDING_DESTROYED" +EXTRA_CFLAGS="-DUNIT_ON_MAP -DNEW_AI -DUSE_LIBMODPLUG -DUSE_HP_FOR_XP -DNEW_FOW -DBUILDING_DESTROYED ${GENTOO_CFLAGS}" -@@ -462 +462 @@ + + ## These could be used for experimental versions + ## --------------------------------------------- +@@ -133,7 +133,7 @@ + #DEBUG_CFLAGS="-g -O0 -fsigned-char \$(PROFILE) -pipe -Wall -Werror \$(IFLAGS) \$(DFLAGS)" + DEBUG_CFLAGS="-g -O1 -fsigned-char -Wall -Werror \$(IFLAGS) \$(DFLAGS)" + #-- Production (default) +-CFLAGS="-O2 -pipe -fsigned-char -fomit-frame-pointer -fconserve-space -fexpensive-optimizations -ffast-math \$(IFLAGS) \$(DFLAGS)" ++CFLAGS="-fsigned-char \$(IFLAGS) \$(DFLAGS)" + #-- High Optimization + HIGHOPT="-O3 -pipe -fsigned-char -fomit-frame-pointer -foptimize-sibling-calls -ffast-math -fstrength-reduce -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -frerun-cse-after-loop -frerun-loop-opt -fgcse -fgcse-lm -fgcse-sm -fdelete-null-pointer-checks -fexpensive-optimizations -fschedule-insns2 -funroll-loops -frename-registers -fno-cprop-registers \$(IFLAGS) \$(DFLAGS)" + +@@ -459,7 +459,7 @@ + fi + echo + echo -n "Please enter selection: (s) " - read $N VIDSEL + VIDSEL=S -@@ -554 +554 @@ + echo + fi + +@@ -510,7 +510,7 @@ + if [ "$WIN32" = "1" ]; then + SDLLIB="\$(shell $SDL_CONFIG --libs) -lmingwex" + else +- SDLLIB="\$(shell $SDL_CONFIG --libs)" ++ SDLLIB="\$(shell $SDL_CONFIG --libs) -lX11" + fi + echo "SDL = -DUSE_SDL -DUSE_SDLA \$(SDL_CFLAGS)" >> $RULESFILE + echo "SDL_CFLAGS = \$(shell $SDL_CONFIG --cflags)" >> $RULESFILE +@@ -551,7 +551,7 @@ + + echo + echo -n "Do you want to compile with sound? (y) " -read $N ANSWER +ANSWER=y -@@ -575 +575 @@ + echo + case $ANSWER in + [nN]) +@@ -572,7 +572,7 @@ + else + echo + echo -n "Do you want use arts daemon sound output? (n) " - read $N ANSWERA + ANSWERA=n -@@ -598 +598 @@ + echo + case $ANSWERA in + [yY]) +@@ -595,7 +595,7 @@ + echo + echo "Assuming you have a thread-safe X11 (libc6 or glibc)," + echo -n "do you want to compile with threaded sound? (n) " - read $N ANSWER2 + ANSWER2=y -@@ -621 +621 @@ + echo + case $ANSWER2 in + [yY]) +@@ -618,7 +618,7 @@ + LIBCHECK="-lFLAC -lm"; check_for_libs + if test "$?" = 0 ; then + echo -n "Would you like FLAC support? (n) " - read $N ANSWER + ANSWER=n -@@ -641 +641 @@ + echo + case $ANSWER in + [yY]) +@@ -638,7 +638,7 @@ + LIBCHECK="-lvorbisfile -lvorbis -logg"; check_for_libs + if test "$?" = 0 ; then + echo -n "Would you like OGG support? (n) " - read $N ANSWER + ANSWER=n -@@ -674 +674 @@ + echo + case $ANSWER in + [yY]) +@@ -671,7 +671,7 @@ + LIBCHECK="-lmad"; check_for_libs + if test "$?" = 0 ; then + echo -n "Would you like MAD MP3 support? (n) " - read $N ANSWER + ANSWER=n -@@ -696 +696 @@ + echo + case $ANSWER in + [yY]) +@@ -693,7 +693,7 @@ + echo -n "or [S]DL " + fi + echo -n "CD Audio support? (n) " - read $N CDMode + CDMode=s -@@ -780 +780 @@ + echo + case $CDMode in + [sS]) +@@ -777,7 +777,7 @@ + fi + echo + echo -n "Please enter selection ($COMPDEF): " -read $N COMPOPT +COMPOPT=O -@@ -830 +830 @@ + echo + + if test "$COMPOPT x" = " x" ; then COMPOPT=$COMPDEF; fi +@@ -827,7 +827,7 @@ + echo "optimization support, which may cause Freecraft to run much slower." + echo + echo -n "Would you like debug support? (n): " - read $N DEBUGASK + DEBUGASK=n -@@ -870 +870 @@ + case $DEBUGASK in + [yY]) + echo +@@ -867,7 +867,7 @@ + echo " H - High Optimization, not recommended." + echo + echo -n "Please enter selection (n): " - read $N OPTASK + OPTASK=N -@@ -897 +897 @@ + case $OPTASK in + [hH]) + echo +@@ -894,7 +894,7 @@ + echo " Athlon XP, Athlon MP, Duron" + echo + echo -n "Please enter selection: " - read $N TYPEASK + TYPEASK= -@@ -913 +913 @@ + echo + case $TYPEASK in + [iI]) +@@ -910,7 +910,7 @@ + echo " F - Pentium 4" + echo + echo -n "To choose none, press enter: " - read $N PROCASK + PROCASK= -@@ -952 +952 @@ + case $PROCASK in + [aA]) + CFLAGS="$CFLAGS -march=pentium -malign-double -mpreferred-stack-boundary=3" +@@ -949,7 +949,7 @@ + echo + echo "To choose none, just press enter." + echo -n "Please enter selection: " - read $N PROCASK + PROCASK= -@@ -1159 +1159 @@ + case $PROCASK in + [aA]) + CFLAGS="$CFLAGS -march=k6 -malign-double" +@@ -1156,7 +1156,7 @@ + echo "Done generating $RULESFILE." + echo + echo -n "Would you like to compile it now? (y) " -read $N ANSWER +ANSWER=n + echo + + case $ANSWER in diff --git a/games-strategy/freecraft/files/freecraft b/games-strategy/freecraft/files/freecraft index 49e7734f744f..362b5d304c5f 100644 --- a/games-strategy/freecraft/files/freecraft +++ b/games-strategy/freecraft/files/freecraft @@ -1,6 +1,6 @@ #!/bin/bash -if [ ! -d GENTOO_DATADIR/data/music ] ; then +if [[ ! -d "GENTOO_DATADIR"/data/music ]] ; then echo "You have to install the data files in order to play!" echo "You can either \`emerge freecraft-fcmp\` or install" echo "the data files from the Warcraft CD." @@ -12,4 +12,4 @@ if [ ! -d GENTOO_DATADIR/data/music ] ; then exit 1 fi -exec GENTOO_LIBDIR/freecraft -d GENTOO_DATADIR/data "$@" +exec "GENTOO_LIBDIR"/freecraft -d "GENTOO_DATADIR"/data "$@" diff --git a/games-strategy/freecraft/freecraft-1.18-r3.ebuild b/games-strategy/freecraft/freecraft-1.18-r3.ebuild index fd2fd9080214..da68453b3270 100644 --- a/games-strategy/freecraft/freecraft-1.18-r3.ebuild +++ b/games-strategy/freecraft/freecraft-1.18-r3.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/games-strategy/freecraft/freecraft-1.18-r3.ebuild,v 1.13 2006/12/21 08:21:53 mr_bones_ Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-strategy/freecraft/freecraft-1.18-r3.ebuild,v 1.14 2007/02/17 09:26:11 nyhm Exp $ inherit eutils games @@ -15,11 +15,10 @@ KEYWORDS="~ppc x86" IUSE="" RESTRICT="fetch" -DEPEND=">=media-libs/libpng-1.2.3 - >=media-libs/libsdl-1.2.4 - sys-libs/zlib" +DEPEND="media-libs/libpng + media-libs/libsdl" -S="${WORKDIR}/${MY_P}" +S=${WORKDIR}/${MY_P} pkg_nofetch() { einfo "Due to a Cease and Desist given by Blizzard," @@ -32,60 +31,48 @@ pkg_nofetch() { src_unpack() { unpack ${A} cd "${S}" - epatch "${FILESDIR}/${PV}-setup.patch" \ - "${FILESDIR}/${P}"-gcc41.patch \ - "${FILESDIR}/${P}"-Makefile.patch + sed -e "s:GENTOO_DATADIR:${GAMES_DATADIR}/${PN}:" \ + -e "s:GENTOO_LIBDIR:${GAMES_LIBDIR}/${PN}:" \ + "${FILESDIR}"/${PN} > "${T}"/${PN} \ + || die "sed failed" + epatch \ + "${FILESDIR}"/${PV}-setup.patch \ + "${FILESDIR}"/${P}-gcc41.patch \ + "${FILESDIR}"/${P}-Makefile.patch env GENTOO_CFLAGS="${CFLAGS}" ./setup || die } src_compile() { - make depend || die "depend generation failed" - make || die "build failed" + emake depend || die "depend generation failed" + emake -j1 || die "emake failed" } src_install() { - exeinto "${GAMES_LIBDIR}/${PN}" + exeinto "${GAMES_LIBDIR}"/${PN} doexe freecraft || die "doexe failed" - dogamesbin "${FILESDIR}/freecraft" || die "dogamesbin failed" - sed -i \ - -e "s:GENTOO_DATADIR:${GAMES_DATADIR}/${PN}:" \ - -e "s:GENTOO_LIBDIR:${GAMES_LIBDIR}/${PN}:" \ - "${D}${GAMES_BINDIR}/freecraft" \ - || die "sed failed" + dogamesbin "${T}"/${PN} || die "dogamesbin failed" - exeinto "${GAMES_DATADIR}/${PN}/tools" + exeinto "${GAMES_DATADIR}"/${PN}/tools doexe tools/{build.sh,aledoc,startool,wartool} || die "doexe failed" - dodir "${GAMES_DATADIR}/${PN}" - cp -r contrib data "${D}/${GAMES_DATADIR}/${PN}/" || die "cp failed" + insinto "${GAMES_DATADIR}"/${PN} + doins -r contrib data || die "doins failed" dohtml -r doc dodoc README - prepgamesdirs - - # make sure we dont clobber files freecraft and freecraft-fcmp share #39278 - local fcmpver="$(best_version games-strategy/freecraft-fcmp)" - if [ ! -z "${fcmpver}" ] ; then - cd "${D}/${GAMES_DATADIR}/${PN}/data/ccl" - for f in $(grep ${GAMES_DATADIR}/${PN}/data/ccl/ ${ROOT}/var/db/pkg/${fcmpver}/CONTENTS) ; do - [ -d "${f}" ] && continue - [ -e "${f}" -a -e "${D}/${f}" ] && rm "${D}/${f}" - done - fi } pkg_postinst() { games_pkg_postinst - echo - einfo "Freecraft is now installed but in order to actually play" - einfo "you will need to either use a Warcraft CD or install the" - einfo "freecraft-fcmp ebuild. To use a Warcraft CD:" - einfo " 1 mount the cd as /mnt/cdrom" - einfo " 2 cd ${GAMES_DATADIR}/${PN}" - einfo " 3 run tools/build.sh" - einfo "This will extract the data files to the correct place." - einfo "Note that the CD is still needed for the music. To" - einfo "start a game just run \"playfreecraft\"." - einfo "For more info, review \"freecraft --help\"." + elog "Freecraft is now installed but in order to actually play" + elog "you will need to either use a Warcraft CD or install the" + elog "freecraft-fcmp ebuild. To use a Warcraft CD:" + elog " 1 mount the cd as /mnt/cdrom" + elog " 2 cd ${GAMES_DATADIR}/${PN}" + elog " 3 run tools/build.sh" + elog "This will extract the data files to the correct place." + elog "Note that the CD is still needed for the music. To" + elog "start a game just run \"playfreecraft\"." + elog "For more info, review \"freecraft --help\"." } |