diff options
author | Nikoli <nikoli@lavabit.com> | 2011-02-02 22:09:11 +0300 |
---|---|---|
committer | Nikoli <nikoli@lavabit.com> | 2011-02-02 22:09:11 +0300 |
commit | bd5d6b0e1f047ec5f4468bd638f3a41e99ace54d (patch) | |
tree | 3c01b0204b8229cc56610199082ea3dd3dd29089 /games-fps | |
parent | [games/strategy/openxcom] Fixing compilation. (diff) | |
download | gamerlay-bd5d6b0e1f047ec5f4468bd638f3a41e99ace54d.tar.gz gamerlay-bd5d6b0e1f047ec5f4468bd638f3a41e99ace54d.tar.bz2 gamerlay-bd5d6b0e1f047ec5f4468bd638f3a41e99ace54d.zip |
xonotic-data: move maps to xonotic-maps package
Diffstat (limited to 'games-fps')
-rw-r--r-- | games-fps/xonotic-data/ChangeLog | 3 | ||||
-rw-r--r-- | games-fps/xonotic-data/Manifest | 4 | ||||
-rw-r--r-- | games-fps/xonotic-data/xonotic-data-9999.ebuild | 8 | ||||
-rw-r--r-- | games-fps/xonotic-maps/ChangeLog | 10 | ||||
-rw-r--r-- | games-fps/xonotic-maps/Manifest | 3 | ||||
-rw-r--r-- | games-fps/xonotic-maps/metadata.xml | 12 | ||||
-rw-r--r-- | games-fps/xonotic-maps/xonotic-maps-9999.ebuild | 161 |
7 files changed, 192 insertions, 9 deletions
diff --git a/games-fps/xonotic-data/ChangeLog b/games-fps/xonotic-data/ChangeLog index f521590..3702ccb 100644 --- a/games-fps/xonotic-data/ChangeLog +++ b/games-fps/xonotic-data/ChangeLog @@ -2,6 +2,9 @@ # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 02 Feb 2011; Nikoli <nikoli@lavabit.com> xonotic-data-9999.ebuild: + move maps to xonotic-maps package + *xonotic-data-9999 (17 Jan 2011) 17 Jan 2011; Nikoli <nikoli@lavabit.com> +xonotic-data-9999.ebuild, diff --git a/games-fps/xonotic-data/Manifest b/games-fps/xonotic-data/Manifest index c71d031..5991bb4 100644 --- a/games-fps/xonotic-data/Manifest +++ b/games-fps/xonotic-data/Manifest @@ -1,3 +1,3 @@ -EBUILD xonotic-data-9999.ebuild 3269 RMD160 f1b81cc0934fd09aafc200f5192777b2eb5821ca SHA1 b1fce15598b6b887e41a6b75a47c867091b7e514 SHA256 5a79eab902ee302ed90cfd18353155838e66de14a66861cc099d79aff69c34d9 -MISC ChangeLog 262 RMD160 51e22029be52a9b81c7e6162cf5a7ed166471a43 SHA1 116eaa1db6c7d10cce6e99e2b136f0b4133bf6b5 SHA256 eeaa809356bbf326814be955dd8f76ee9bb484a5f3cd278d64879c365a1ec24e +EBUILD xonotic-data-9999.ebuild 3157 RMD160 fa2f059f87af2b82e0d80c457172bc5395862711 SHA1 2efbc89cac57135a3857ccc663f86f9a2a41e89f SHA256 f70034d1544462507cd9bdf8a9539f59e2591752cb47ded58e4c63175ddefdae +MISC ChangeLog 368 RMD160 cb2bc0c07404351cd0a5ba7192c6980beed9ac4c SHA1 6dc140a035ee08b6616a3bd6312fd4e8791f5967 SHA256 982f274a7a8cb7bc852716d65622ed2c792f51dada8e42b97a392a0d64cf033a MISC metadata.xml 464 RMD160 86d7fbea6edcba6452d3581044ca1a1a77239da5 SHA1 4615957949527226200e033661405ed8459f498d SHA256 d9a07557c99e4b12bafbb7f547ee63cf6d9931e4a8a47e2a5a5bbefc89097af2 diff --git a/games-fps/xonotic-data/xonotic-data-9999.ebuild b/games-fps/xonotic-data/xonotic-data-9999.ebuild index 5162d65..3120f81 100644 --- a/games-fps/xonotic-data/xonotic-data-9999.ebuild +++ b/games-fps/xonotic-data/xonotic-data-9999.ebuild @@ -23,6 +23,7 @@ DEPEND=" ~games-util/fteqcc-xonotic-9999 zip? ( app-arch/p7zip ) " +PDEPEND="maps? ( ~games-fps/xonotic-maps-9999 )" pkg_setup() { games_pkg_setup @@ -71,13 +72,6 @@ src_unpack() { else rm -rf "${S}"/data/font-*.pk3dir || die "rm failed" fi - if use maps; then - cd "${S}/data" - wget \ - -r -l1 --no-parent --no-directories \ - -A "*-full.pk3" \ - "http://beta.xonotic.org/autobuild-bsp/latest" - fi } src_prepare() { diff --git a/games-fps/xonotic-maps/ChangeLog b/games-fps/xonotic-maps/ChangeLog new file mode 100644 index 0000000..01529a6 --- /dev/null +++ b/games-fps/xonotic-maps/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for games-fps/xonotic-maps +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: $ + +*xonotic-maps-9999 (02 Feb 2011) + + 02 Feb 2011; Nikoli <nikoli@lavabit.com> +xonotic-maps-9999.ebuild, + +metadata.xml: + initial ebuild + diff --git a/games-fps/xonotic-maps/Manifest b/games-fps/xonotic-maps/Manifest new file mode 100644 index 0000000..c0d885a --- /dev/null +++ b/games-fps/xonotic-maps/Manifest @@ -0,0 +1,3 @@ +EBUILD xonotic-maps-9999.ebuild 4155 RMD160 eac6c10cb4160953eb4cdebe8150fb3faf668a27 SHA1 67167d2088741d7a2f2dc8b9e3121198902d0ae1 SHA256 6ce44b746452c084e584c983e09b7aeaca2ed68049259fc73da9894c845dedea +MISC ChangeLog 262 RMD160 b136ba7dfdaea2696a0575e599b9b8e3b66fc751 SHA1 c3091a3f107febe17c8f5af73b7f9f850760361e SHA256 328a3121bc8755ab9eb647f7face92488dc207ec8dd0d577e555fe47631c636f +MISC metadata.xml 358 RMD160 d359d97e1fe00e091edab63e3f84beac79026591 SHA1 dbc990c52cca3f7b558676366987f9e7a63dc41a SHA256 0174531ceaaeb8b9dc8a81de9624828dc03e5d8ca42e04f9036cac6952493ef0 diff --git a/games-fps/xonotic-maps/metadata.xml b/games-fps/xonotic-maps/metadata.xml new file mode 100644 index 0000000..e452b5a --- /dev/null +++ b/games-fps/xonotic-maps/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>games</herd> + <maintainer> + <email>nikoli@lavabit.com</email> + <name>Nikoli</name> + </maintainer> + <use> + <flag name="unofficial">Install unofficial maps. May be incomplete, unstable or broken.</flag> + </use> +</pkgmetadata> diff --git a/games-fps/xonotic-maps/xonotic-maps-9999.ebuild b/games-fps/xonotic-maps/xonotic-maps-9999.ebuild new file mode 100644 index 0000000..4cf4ad2 --- /dev/null +++ b/games-fps/xonotic-maps/xonotic-maps-9999.ebuild @@ -0,0 +1,161 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=2 + +inherit games check-reqs + +MY_PN="${PN%-maps}" +DESCRIPTION="Xonotic maps" +HOMEPAGE="http://www.xonotic.org/" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="" +IUSE="unofficial" + +RDEPEND="~games-fps/xonotic-data-9999" +DEPEND=" + app-arch/unzip + net-misc/wget +" +S="${WORKDIR}" + +pkg_setup() { + games_pkg_setup + + ewarn "Downloaded pk3 files will be stored in \"xonotic-maps\" subdirectory of your DISTDIR" + echo + + if use unofficial; then + ewarn "You have enabled \"unofficial\" USE flag. Incomplete, unstable or broken maps may be installed." + echo + fi + + CHECKREQS_DISK_USR="350" \ + check_reqs +} + +src_unpack() { + # Used git.eclass,v 1.50 as example + : ${MAPS_STORE_DIR:="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/xonotic-maps"} + # initial download, we have to create master maps storage directory and play + # nicely with sandbox + if [[ ! -d ${MAPS_STORE_DIR} ]] ; then + addwrite / + mkdir -p "${MAPS_STORE_DIR}" \ + || die "can't mkdir ${MAPS_STORE_DIR}." + export SANDBOX_WRITE="${SANDBOX_WRITE%%:/}" + fi + # allow writing into MAPS_STORE_DIR + addwrite "${MAPS_STORE_DIR}" + + # FETCHCOMMAND from make.globals is example + local WGET="/usr/bin/wget -t 3 -T 60" + local base_url="http://beta.xonotic.org/autobuild-bsp/" + + $WGET -O \ + autobuild-bsp.list \ + "${base_url}" || die + + local OfficialMaps="$( + $WGET -O- \ + 'http://git.xonotic.org/?p=xonotic/xonotic-maps.pk3dir.git;a=tree;f=maps' |\ + grep -e '\.map</a>' |\ + sed -e 's,.*">\([^<]*\).map<\/a>.*,\1,' + )" + if [ "x${OfficialMaps}" = "x" ]; then + die "List of official maps is empty" + fi + local Maps="${OfficialMaps}" + + if use unofficial; then + # For maps not in master branch we need to download fullpk3, + # but some old unofficial maps have only bspk3, exclude them. + # AllMaps - OfficialMaps = UnofficialMaps + echo "${OfficialMaps}" |\ + sed -e 's,\(.*\),^\1$,' \ + > OfficialMaps.grep || die + local UnofficialMaps="$( + grep autobuild-bsp.list \ + -e '<td class="mapname">' |\ + sed -e 's,.*="mapname">\([^<]*\)<.*,\1,' |\ + sort -u |\ + grep -v -e '^$' \ + -e '^arahia$' \ + -e '^darkzone$' \ + -e '^facility_114$' \ + -e '^valentine114$' \ + -f OfficialMaps.grep |\ + sed -e 's,$,-full,' + )" + if [ "x${UnofficialMaps}" = "x" ]; then + die "List of unofficial maps is empty" + fi + Maps+=" ${UnofficialMaps}" + fi + + MapFiles="" + for i in ${Maps}; do + local version="$( + grep autobuild-bsp.list -m1 \ + -e "href=\"${i%-full}-.*.pk3\">bspk3<" |\ + sed -e "s,.*href=\"${i%-full}-\([^\"]*\).pk3\">bspk3<.*,\1," + )" + local name="${i}-${version}.pk3" + MapFiles+=" ${name}" + local path="${MAPS_STORE_DIR}/${name}" + local url="${base_url}${name}" + + if [[ ! -f "${path}" ]]; then + rm -f "${path}" 2> /dev/null + einfo "Downloading ${name}" + $WGET "${url}" -O "${path}" || ewarn "downloading ${url} failed" + fi + done + + # Remove obsolete and broken files from MAPS_STORE_DIR + # If map becomes official, it changes branch and git hashes in name => no need to check both fullpk3 and bsppk3 + for i in "${MAPS_STORE_DIR}"/*; do + local name="$( + echo "${i}" |\ + sed -e "s,${MAPS_STORE_DIR}/\([^/]*\)-.*-.*.pk3$,\1," + )" + local version="$( + echo "${i}" |\ + sed -e "s,${MAPS_STORE_DIR}/${name}-\([^/]*\).pk3$,\1," + )" + # latest builds of maps are above + local Cversion="$( + grep autobuild-bsp.list -m1 \ + -e "href=\"${name%-full}-.*.pk3\">bspk3<" |\ + sed -e "s,.*href=\"${name%-full}-\([^\"]*\).pk3\">bspk3<.*,\1," + )" + + if [ "${version}" != "${Cversion}" ]; then + einfo "${i} is obsolete, removing" + rm -f "${i}" + elif [ "x${version}" = "x" ]; then + ewarn "${i} has incorrect name, removing" + rm -f "${i}" + elif [ "x${Cversion}" = "x" ]; then + ewarn "${i} is not available in ${base_url}, removing" + rm -f "${i}" + elif unzip -t "${i}" > /dev/null; then + true + else + ewarn "${i} is not valid pk3 file, removing" + rm -f "${i}" + fi + done +} + +src_install() { + insinto "${GAMES_DATADIR}/${MY_PN}/data" + for i in ${MapFiles}; do + doins "${MAPS_STORE_DIR}/${i}" || ewarn "installing ${i} failed" + done + + prepgamesdirs +} |