From 265171f619a45ca440cb494e84eac49b4d8118da Mon Sep 17 00:00:00 2001 From: Tristan Heaven Date: Sat, 17 Feb 2007 09:26:11 +0000 Subject: [PATCH] Fix ROOT abuse, bug #167277 Package-Manager: portage-2.1.2-r9 --- games-strategy/freecraft/ChangeLog | 7 +- games-strategy/freecraft/Manifest | 42 +++-- .../freecraft/files/1.18-setup.patch | 150 +++++++++++++++--- games-strategy/freecraft/files/freecraft | 4 +- .../freecraft/freecraft-1.18-r3.ebuild | 73 ++++----- 5 files changed, 195 insertions(+), 81 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 freecraft-1.18-r3.ebuild: + Fix ROOT abuse, bug #167277 21 Dec 2006; Michael Sterrett +files/freecraft-1.18-Makefile.patch, freecraft-1.18-r3.ebuild: diff --git a/games-strategy/freecraft/Manifest b/games-strategy/freecraft/Manifest index 31e7e6f89c87..4dd4887c584c 100644 --- a/games-strategy/freecraft/Manifest +++ b/games-strategy/freecraft/Manifest @@ -1,11 +1,14 @@ -AUX 1.18-setup.patch 1057 RMD160 90f5b5352fe6150ad944ac1ec601be81d605853c SHA1 cd2f754ff0d928c838b950418f8210654ffa5dc9 SHA256 524cc950b93c4c674e2d37f8a41bd7dfaf48f80c86bd339196350552c153c6fe -MD5 c7be4012a9ba721244dec67d4abc2e53 files/1.18-setup.patch 1057 -RMD160 90f5b5352fe6150ad944ac1ec601be81d605853c files/1.18-setup.patch 1057 -SHA256 524cc950b93c4c674e2d37f8a41bd7dfaf48f80c86bd339196350552c153c6fe files/1.18-setup.patch 1057 -AUX freecraft 493 RMD160 af4d83c1f1a8bd436c73a2fb5905d6693d7cafd5 SHA1 22e539e97c0e4ee2d70f04032b1ee63e705c1916 SHA256 a34fe93b034bd82e5430a466c19bb3d32b7601cc9da4c2b09fcbdf0b0a8d181d -MD5 0e6f6ecc763f6ca1565717fa90296b45 files/freecraft 493 -RMD160 af4d83c1f1a8bd436c73a2fb5905d6693d7cafd5 files/freecraft 493 -SHA256 a34fe93b034bd82e5430a466c19bb3d32b7601cc9da4c2b09fcbdf0b0a8d181d files/freecraft 493 +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +AUX 1.18-setup.patch 4544 RMD160 2a48171035fbe12878a12a6131c534947f3fbd23 SHA1 d7aa0cef759b0334b5b4512a8841ce07d7d22c0d SHA256 af180d7243ec589c5f2465343833767f3cd0070f52f9895ccf7d51ec47f032b8 +MD5 2d30822f0db692db078a3c3d64a61d57 files/1.18-setup.patch 4544 +RMD160 2a48171035fbe12878a12a6131c534947f3fbd23 files/1.18-setup.patch 4544 +SHA256 af180d7243ec589c5f2465343833767f3cd0070f52f9895ccf7d51ec47f032b8 files/1.18-setup.patch 4544 +AUX freecraft 501 RMD160 e34f41bf3003e3917163cde5793ad30e87929508 SHA1 71ed20a78464f5b83a69c2017757a4543bb71b00 SHA256 8853d81789843d4b1d724d82ab06797184ad619d3463abc61c96718936785fbf +MD5 3940f1656dd11b740188a0e13866bc7a files/freecraft 501 +RMD160 e34f41bf3003e3917163cde5793ad30e87929508 files/freecraft 501 +SHA256 8853d81789843d4b1d724d82ab06797184ad619d3463abc61c96718936785fbf files/freecraft 501 AUX freecraft-1.18-Makefile.patch 470 RMD160 3ad637fc1b0e1d7bc535a30d087fdc7d6c6132e7 SHA1 ecd39f58175abc4801421fe0c35f530a32b7e3da SHA256 a8a80e5dddacbd3bab48257fad3c51a87660a57f8f4bd2187346f9827551fc63 MD5 0bfb78784434b883206d4e852f18e69f files/freecraft-1.18-Makefile.patch 470 RMD160 3ad637fc1b0e1d7bc535a30d087fdc7d6c6132e7 files/freecraft-1.18-Makefile.patch 470 @@ -15,14 +18,14 @@ MD5 a58042c2d290371950eba4fcd99ad0ec files/freecraft-1.18-gcc41.patch 2816 RMD160 eac34a4203bc0682022fd795fbab3211f3fc6ddd files/freecraft-1.18-gcc41.patch 2816 SHA256 5008fe57339babba5421ed8a454fc18b0f32c4d4e372287563cf4049dded717f files/freecraft-1.18-gcc41.patch 2816 DIST freecraft-030311-src.tar.gz 1883435 RMD160 6f35070a8c9f953d1fffdc673219d8ab7ccaba6f SHA1 4104b720e717b89111b7e301fa1bcbd54ae8aefc SHA256 1728b6249a2618ccad0fbb4b2fa06c479eab5294017b397cbfd245ff9dbd0c19 -EBUILD freecraft-1.18-r3.ebuild 2724 RMD160 e9ac27925cea0cc8857ef0d91a7429d8436aa4a8 SHA1 770261ce4f2a24c8b8fa99c63e5bf2049e2b9612 SHA256 a57b3008d7099ae4e819c140368259dfebbdebf86439fa8404d4a59052beb5c8 -MD5 bc4e61ffe6b2a43214197a7f48ddbe86 freecraft-1.18-r3.ebuild 2724 -RMD160 e9ac27925cea0cc8857ef0d91a7429d8436aa4a8 freecraft-1.18-r3.ebuild 2724 -SHA256 a57b3008d7099ae4e819c140368259dfebbdebf86439fa8404d4a59052beb5c8 freecraft-1.18-r3.ebuild 2724 -MISC ChangeLog 2871 RMD160 072646bd866c4c5567395ae86b5a7d7716cd2a8a SHA1 257e7d9930b1f8e63559728305cd2502587db983 SHA256 25a1edf82dd7647ab935f65bb27f164ea32d792f416396c6dcf3ceaaf4e587e3 -MD5 2e7c4a3d6d91bd2f1e1a507563c831aa ChangeLog 2871 -RMD160 072646bd866c4c5567395ae86b5a7d7716cd2a8a ChangeLog 2871 -SHA256 25a1edf82dd7647ab935f65bb27f164ea32d792f416396c6dcf3ceaaf4e587e3 ChangeLog 2871 +EBUILD freecraft-1.18-r3.ebuild 2232 RMD160 d66fd49329049b766a50cad0eb444ad00dd857cc SHA1 005e795778616c19261805ba0aacafc995b850df SHA256 4b307931ef6a23ee1408458115e8ecd501d712a7f71459f12bc3148fe1a6fba7 +MD5 37d468a234f57159a7b42f280a3d685a freecraft-1.18-r3.ebuild 2232 +RMD160 d66fd49329049b766a50cad0eb444ad00dd857cc freecraft-1.18-r3.ebuild 2232 +SHA256 4b307931ef6a23ee1408458115e8ecd501d712a7f71459f12bc3148fe1a6fba7 freecraft-1.18-r3.ebuild 2232 +MISC ChangeLog 2971 RMD160 1a08884cdc452e822e6d82fb534270998cc8989c SHA1 85f53426c97edff5e7d9a5c2d1323a16e6a4db97 SHA256 33356443fa989e81621f42218040ed5f37122796080d9227ec70f144e6be56d4 +MD5 33d460471a55272f74899a3f192ee136 ChangeLog 2971 +RMD160 1a08884cdc452e822e6d82fb534270998cc8989c ChangeLog 2971 +SHA256 33356443fa989e81621f42218040ed5f37122796080d9227ec70f144e6be56d4 ChangeLog 2971 MISC metadata.xml 158 RMD160 cbd9984bb6b426c8c9cee5022fe0a26261612fea SHA1 be5251fa1dacef5c41b74761bb1c8c54fb633b9e SHA256 1423a4fdd4a79b1728a2056d9e300f7e1074253095d82726218d9e9b953888a3 MD5 f17b9b8fa07a38914fe1c03268f51678 metadata.xml 158 RMD160 cbd9984bb6b426c8c9cee5022fe0a26261612fea metadata.xml 158 @@ -30,3 +33,10 @@ SHA256 1423a4fdd4a79b1728a2056d9e300f7e1074253095d82726218d9e9b953888a3 metadata MD5 654d2fd7b68e87cd7a861d31c68f54aa files/digest-freecraft-1.18-r3 265 RMD160 6838485b92571f3ae97ba3c40c0fcc3e8b10470f files/digest-freecraft-1.18-r3 265 SHA256 4637a2d97f43044b7385627c51288a2bd91f451f9c212c96441cf07da3be4275 files/digest-freecraft-1.18-r3 265 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.2 (GNU/Linux) + +iD8DBQFF1so6dz7hIScOURERAldcAJ9O7S1O/+Vm2+EPgtCSg1e1GG0q/ACfXjC9 +dgiRUAg3fJ3W8JsUpYOdw+k= +=9Wqt +-----END PGP SIGNATURE----- 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\"." } -- 2.26.2