From 6cab99493eb5798b183e1f3160827cc02438c1e3 Mon Sep 17 00:00:00 2001 From: grepwood Date: Fri, 5 Feb 2021 03:08:58 +0100 Subject: [PATCH] Forgot to add those --- eclass/wise.eclass | 86 +++++++++++++++++++ games-fps/counter-strike-data/Manifest | 2 + .../counter-strike-data-1.5.ebuild | 37 ++++++++ 3 files changed, 125 insertions(+) create mode 100644 eclass/wise.eclass create mode 100644 games-fps/counter-strike-data/Manifest create mode 100644 games-fps/counter-strike-data/counter-strike-data-1.5.ebuild diff --git a/eclass/wise.eclass b/eclass/wise.eclass new file mode 100644 index 0000000..28db1c0 --- /dev/null +++ b/eclass/wise.eclass @@ -0,0 +1,86 @@ +# Copyright 2021-2021 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: wise.eclass +# @MAINTAINER: +# moog621@gmail.com +# @AUTHOR: +# moog621@gmail.com +# @SUPPORTED_EAPIS: 7 +# @BLURB: Functions to work with WISE installers. +# @DESCRIPTION: +# This class will provide various bits and bobs to work with WISE installers +# that were popular in retail and shareware softwares in the 1990s. +# There are 2 key components at play. +# First, there is a Pascal program that runs in DOS, Windows and OS/2. +# There exists source code for it, but porting it to FreePascal and Linux +# proves very challenging. Instead, the DOS version is run inside of DOSBox. +# It takes a considerable amount of time, but it gets it right. Unfortunately, +# the program does not respect any directory structures or filenames, so +# we are left to pick up the pieces with key component 2: shell functions +# made for cleaning up this mess. + +# In order to disable network-sandbox: +PROPERTIES+="live" + +# @ECLASS-VARIABLE: WISE_INSTALLER +# @DESCRIPTION: +# WISE installer filename. It can be an array! +: ${WISE_INSTALLER:=} + +LICENSE+="e_wise-mit-like" +SRC_URI+=" + http://kannegieser.net/veit/programm/e_wise.arj +" + +BDEPEND+=" + games-emulation/dosbox + app-arch/p7zip +" + +wise_unpack_installers() { + mkdir wise_output + mkdir ewise + pushd ewise + 7z x "${DISTDIR}/e_wise.arj" + popd + local counter=0 + for wiseguy in ${WISE_INSTALLER[@]}; do + wiseguy_abs=$(readlink -f ${wiseguy}) + wiseguy_dir=$(echo ${wiseguy} | sed 's/\.exe//') + wiseguy_config="${wiseguy}.dosbox" + cat < "${wiseguy_config}" +[autoexec] +mount D ${WORKDIR}/ewise +mount E ${WORKDIR}/${wiseguy_dir} +mount F ${WORKDIR} +D:\\E_WISE_D.EXE F:\\${counter}.exe E:\\ +exit +EOF + mkdir ${wiseguy_dir} + ln -s ${DISTDIR}/${wiseguy} ${counter}.exe + pushd ${wiseguy_dir} + elog "Extracting ${wiseguy} in DOSBox" + SDL_VIDEODRIVER=dummy dosbox -conf ${WORKDIR}/${wiseguy_config} + elog "Creating directory structures" + grep filename:\ MAINDIR 00000000.BAT | sed 's/^.*filename:\ MAINDIR\\//;s/\\/\//g;s:[^/]*$::;s/\/$//' | sort -u | xargs mkdir -p + elog "Renaming files" + grep ^MOVE\s*.*\ MAINDIR 00000000.BAT -B1 | tr -d '\r' | sed 's/\\/\//g;s/^MOVE\s*\([^/]*\)\ MAINDIR\/\(.*\)$/\2\/\1/;s/^RENAME\ \([^/]*\)\ .*$/mv\ \1/;/^\-\-$/d' | sed 'N;s/\.EWI\n/\.EWI\ /' | sh + for i in $(ls | grep \\.EWI$); do + if [ $(grep -c "^RENAME\ $i\ .*$" 00000000.BAT) -eq 0 ]; then + elog "Removing homeless file $i" + rm -f $i + fi + done + for i in $(grep EWI\ W32INST_PATH_ 00000000.BAT | awk '{print $2}'); do + elog "Removing useless file $i" + rm -f $i + done + elog "Removing useless file 00000000.BAT" + elog "Removing useless file 00000000.TXT" + rm -f 00000000.BAT 00000000.TXT + mv * ${WORKDIR}/wise_output + popd + counter=$((${counter} + 1)) + done +} diff --git a/games-fps/counter-strike-data/Manifest b/games-fps/counter-strike-data/Manifest new file mode 100644 index 0000000..587b988 --- /dev/null +++ b/games-fps/counter-strike-data/Manifest @@ -0,0 +1,2 @@ +DIST csv15full.exe 127194009 BLAKE2B fd2593370cfd3dd5f93932d0509ab308d30de4028c9f60eb4ecc7bf83c7f8acb5f2831f05108b74d06c263a145a2293c6780ca17aa1ed04b5b7b8e26449d9e00 SHA512 5b2816e61d26b0017affcf59db7e6117f01410988529094c2cba62b2f0f07d0b5828d73cb527b03a60c7b89aa5453f2cdab255ed15a011f56e2fc0423d4883fe +DIST e_wise.arj 108222 BLAKE2B 8bd042899b1edf6ab93cefe72837e7892bd290d32bf9dfa37139abbd4bf1731292f95e1a300e676f1258797bb17fe68416d8040de1cf076cefd44ca7bd95f01f SHA512 cfce00151d4e67810287be885a917389cb36c42d8e6bb9d25e4f64628352579cfe260959c4eef31f8fa30bfbc739678b8d5a88c4c35c1d2a6b263bd538e39780 diff --git a/games-fps/counter-strike-data/counter-strike-data-1.5.ebuild b/games-fps/counter-strike-data/counter-strike-data-1.5.ebuild new file mode 100644 index 0000000..e5739b2 --- /dev/null +++ b/games-fps/counter-strike-data/counter-strike-data-1.5.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit wise + +DESCRIPTION="Freeware release of Counter-Strike 1.5" +HOMEPAGE="web.archive.org/web/20031231214931/http://www.counter-strike.net/" +WISE_INSTALLER="csv15full.exe" +SRC_URI+=" + https://archive.org/download/counter-strike-1.5/${WISE_INSTALLER} +" + +LICENSE="UNKNOWN" +SLOT="0" +KEYWORDS="~amd64 ~arm ~ppc64 ~x86" + +RDEPEND="" +BDEPEND="" + +S="${WORKDIR}" + +src_unpack() { + wise_unpack_installers +} + +src_install() { + insinto "/usr/share" + doins -r wise_output/cstrike +} + +pkg_postinst() { + echo + elog "In order to play this mod run FreeCS" + echo +}