diff options
author | Andrzej Giniewicz | 2015-07-07 21:33:00 +0200 |
---|---|---|
committer | Andrzej Giniewicz | 2015-07-07 21:33:00 +0200 |
commit | 0f57465432277e6859c9f2f5230b64b873175ab9 (patch) | |
tree | 1f09a22bb088bf846030f050324997e371b9baa4 | |
download | aur-0f57465432277e6859c9f2f5230b64b873175ab9.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 26 | ||||
-rw-r--r-- | ARENA.BAT | 1 | ||||
-rw-r--r-- | PKGBUILD | 52 | ||||
-rw-r--r-- | SOUND.CFG | bin | 0 -> 4242 bytes | |||
-rwxr-xr-x | arena-launcher.pl | 262 | ||||
-rwxr-xr-x | arena.conf | 33 | ||||
-rw-r--r-- | arena.install | 35 | ||||
-rw-r--r-- | license | 39 |
8 files changed, 448 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..b173a2cff690 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,26 @@ +pkgbase = arena + pkgdesc = The Elder Scrolls I: Arena + pkgver = 1.06 + pkgrel = 2 + url = http://www.elderscrolls.com/arena/ + install = arena.install + arch = any + license = custom:arena + makedepends = unrar + depends = dosbox + options = emptydirs + source = http://cms.elderscrolls.com/sites/default/files/tes/extras/Arena106Setup.zip + source = license + source = arena-launcher.pl + source = ARENA.BAT + source = SOUND.CFG + source = arena.conf + md5sums = b55b3ddcce98c1905a723781dbe1df7c + md5sums = 2b726b740a5ef663556dea5fe3f25931 + md5sums = b1cc68ee04ad1ff652f1a764a8461b62 + md5sums = f125209433385b76e6cdf10977bd1d6a + md5sums = 7b7c3c2b9961c8d9e649b12c41266662 + md5sums = 36e4de3a8b1030bbf12c6badd23da2ec + +pkgname = arena + diff --git a/ARENA.BAT b/ARENA.BAT new file mode 100644 index 000000000000..ea98c85c4b63 --- /dev/null +++ b/ARENA.BAT @@ -0,0 +1 @@ +@A -sa:220 -si:7 -sd:1 -ma:330 -mq:2 -md:1 -ssbdig.adv -mgenmidi.adv
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..88a1b344b563 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,52 @@ +# Maintainer: Andrzej Giniewicz <gginiu@gmail.com> +pkgname=arena +pkgver=1.06 +pkgrel=2 +pkgdesc="The Elder Scrolls I: Arena" +arch=('any') +url="http://www.elderscrolls.com/arena/" +license=('custom:arena') +depends=('dosbox') +makedepends=('unrar') +options=(emptydirs) +install='arena.install' +source=(http://cms.elderscrolls.com/sites/default/files/tes/extras/Arena106Setup.zip + license arena-launcher.pl ARENA.BAT SOUND.CFG + arena.conf) +md5sums=('b55b3ddcce98c1905a723781dbe1df7c' + '2b726b740a5ef663556dea5fe3f25931' + 'b1cc68ee04ad1ff652f1a764a8461b62' + 'f125209433385b76e6cdf10977bd1d6a' + '7b7c3c2b9961c8d9e649b12c41266662' + '36e4de3a8b1030bbf12c6badd23da2ec') + +package() { + cd "$srcdir" + _target="${pkgdir}"/usr/share/games/arena + install -d -m 775 "$_target" + + cd "$_target" + unrar x "$srcdir/Arena106.exe" + chmod 775 "$_target/ARENA" + + install "$srcdir/SOUND.CFG" "$_target/ARENA" + install "$srcdir/ARENA.BAT" "$_target/ARENA" + mv "$_target/ARENA/Docs/Passwords.txt" "$_target/passwords.txt" + rm -rf "$_target/ARENA/Docs" + cd ARENA + ls | while read file + do + _A=$file + _B=`echo $file | sed 's/.*/\U&/'` + if [ $_A != $_B ] + then + mv $_A $_B + fi + done + cd .. + + install "$srcdir/arena.conf" "$_target" + install -D -m644 "$srcdir/license" "$pkgdir/usr/share/licenses/arena/license" + install -D -m754 "$srcdir/arena-launcher.pl" "$pkgdir/usr/bin/arena" +} + diff --git a/SOUND.CFG b/SOUND.CFG Binary files differnew file mode 100644 index 000000000000..72a2e3fb206e --- /dev/null +++ b/SOUND.CFG diff --git a/arena-launcher.pl b/arena-launcher.pl new file mode 100755 index 000000000000..9fa8bf501a49 --- /dev/null +++ b/arena-launcher.pl @@ -0,0 +1,262 @@ +#!/usr/bin/perl +use warnings; +use strict; + +#================================================================================= +# Arena Launcher +#================================================================================= +# +# This launcher should work, but I cannot guarantee that, +# it was written on Arch Linux and not tried anywhere else +# if you want to use it on other system, adjust configuration +# below and keep your fingers crossed! +# +# Run it with "--help" option to get help. +# +# Remember that you use it at your own risk :-) + +#================================================================================= +# License +#================================================================================= +# Copyright (C) 2011 by Andrzej Giniewicz <gginiu@gmail.com> +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +#================================================================================= +# Configuration variables +#================================================================================= +my $user_group = 'games'; +my $arena_path = "/usr/share/games/arena"; +my $license = "/usr/share/licenses/arena/license"; +my $dosbox = "/usr/bin/dosbox"; +my $dosbox_config = "arena.conf"; +my $arena_dir = "ARENA"; +my $license_lock = "terms-accepted"; +my $passwords_file = "passwords.txt"; + +#================================================================================= +# Declarations and description of available functions +#================================================================================= + +# check if terms of use were accepted +# no arguments +# returns boolean +sub terms_accepted; + +# get terms of use +# no arguments +# returns array of lines +sub get_terms; + +# accept terms of use +# no arguments +# no return value +sub accept_terms; + +# run Arena, requires that terms of use are already accepted +# no arguments +# no return value +sub run_arena; + +# run sound setup utility +# no arguments +# no return value +sub run_setup; + +#================================================================================= +# Gory details :-) +#================================================================================= + +use File::Copy qw(copy move); +use File::Find qw(find); +use File::Path qw(remove_tree); +use File::Spec::Functions qw(catfile); +use List::Util qw(min max); + +my $gid = getgrnam($user_group); + +sub terms_accepted +{ + return ( -e catfile($arena_path, $license_lock) ); +} + +sub accept_terms +{ + my $file = catfile($arena_path, $license_lock); + open(FILE, ">$file") or die "Cannot create license lock"; + close(FILE); + chmod 0664, $file; + chown -1, $gid, $file; +} + +sub get_terms +{ + open(FILE, "<$license") or die "Cannot open license"; + my @text = <FILE>; + close(FILE); + return @text; +} + +sub get_passwords +{ + my $file = catfile($arena_path, $passwords_file); + open(FILE, "<$file") or die "Cannot open passwords file"; + my @text = <FILE>; + close(FILE); + return @text; +} + +sub fix_dirs; +sub fix_dirs +{ + my $path = shift; + chmod 0775, $path; + chown -1, $gid, $path; + opendir(DIR, $path) or die "Cannot access target directory"; + my @files = readdir(DIR); + closedir(DIR); + @files = grep(!/\./, @files); + foreach my $file (@files) { + my $full = catfile($path, $file); + if ( -d $full) { + fix_dirs $full; + } else { + chmod 0664, $full; + chown -1, $gid, $full; + } + } +} + +sub run_dosbox +{ + my ($app, $exit) = @_; + terms_accepted or die "Terms of usage not accepted"; + my $run = catfile($arena_path, $arena_dir, $app); + ( -e $run) or die "Cannot find requested application"; + my $cfg = catfile($arena_path, $dosbox_config); + ( -e $cfg) or die "Cannot find dosbox config file"; + if ($exit) { + system($dosbox." ".$run." -exit -conf ".$cfg); + } else { + system($dosbox." ".$run." -conf ".$cfg); + } + fix_dirs catfile($arena_path, $arena_dir); +} + +sub run_arena +{ + run_dosbox "ARENA.BAT", 1; +} + +sub run_setup +{ + run_dosbox "INSTALL.EXE", 1; +} + +#================================================================================= +# Command line interface, options parsing +#================================================================================= + +use Getopt::Long; + +my $opt_run_arena=1; +my $opt_force_run_arena=0; +my $opt_help=0; +my $opt_accept_terms=0; +my $opt_run_setup=0; +my $opt_show_passwords=0; + +Getopt::Long::Configure('pass_through'); +GetOptions ( + 'help' => \$opt_help, + 'accept-terms' => \$opt_accept_terms, + 'run-arena' => \$opt_force_run_arena, + 'run-setup' => \$opt_run_setup, + 'show-passwords' => \$opt_show_passwords, +); + +if ($#ARGV >= 0) { + foreach my $arg (@ARGV) { + print "Unknown option: $arg\n"; + } + $opt_help = 1; +} + +#================================================================================= +# Command line interface, commands +#================================================================================= + +if ($opt_help) { + print +" +The Elder Scrolls: Arena launcher + +usage: + arena [options] + +available conflicting options: + + --run-setup run the sound setup utility + --run-arena when any option is specified Arena will not be started by + launcher. This options forces start of game when all other + tasks are finished + --show-passwords show the spell costs, answers to copy-protection questions + + --accept-terms accept Arena terms of use + + --help display this help message +"; + exit; +} + +if ($opt_accept_terms) { + $opt_run_arena=0; + accept_terms; +} + +if ($opt_run_setup) { + $opt_run_arena=0; + run_setup; +} + +if ($opt_show_passwords) { + $opt_run_arena=0; + foreach (get_passwords) { print $_ } +} + +$opt_run_arena or $opt_force_run_arena or exit; + +if ( ! terms_accepted ) { + foreach (get_terms) { print $_ } + my $ans = 0; + until ($ans =~ /yes|no/) { + print "Do you accept the license? (yes/no) "; + $ans = <>; + ($ans =~ /yes|no/) or print "Please answer with \"yes\" or \"no\"\n"; + } + if ($ans =~ /yes/) { + accept_terms + } else { + print "You should uninstall Arena at once!\n"; + exit + } +} + +run_arena; + diff --git a/arena.conf b/arena.conf new file mode 100755 index 000000000000..0d5e908806c7 --- /dev/null +++ b/arena.conf @@ -0,0 +1,33 @@ +[sdl] +fullscreen=false +fulldouble=true +fullresolution=1152x720 +windowresolution=960x720 +waitonerror=false +output=opengl + +[dosbox] +memsize=32 + +[render] +aspect=true +scaler=normal3x + +[cpu] +core=dynamic +cycles=max + +[mixer] +blocksize=2048 +prebuffer=10 + +[midi] +mididevice=alsa +midiconfig=128:0 + +[sblaster] +oplmode=opl3 + +[speaker] +pcspeaker=false + diff --git a/arena.install b/arena.install new file mode 100644 index 000000000000..97c9d58887be --- /dev/null +++ b/arena.install @@ -0,0 +1,35 @@ + +pre_install() { + getent group games > /dev/null || /usr/sbin/groupadd -g 50 games +} + +post_install() { + echo "You must read and accept the Arena terms of use" + echo " /usr/share/licenses/arena/license" + echo "" + echo "To accept license run arena from command line" + echo "and answer \"yes\" when asked, or issue command" + echo " arena --accept-terms" + echo "" + echo "You should tweak dosbox settings to match your needs" + echo " /usr/share/games/arena/arena.conf" + echo "" + echo "To play, make sure you are in games group and use command" + echo " arena" + echo "" + echo "To grab/ungrab mouse in window mode press CTRL+F10" + echo "To switch fullscreen press ALT+ENTER" + echo "" + echo "To see more commands, use" + echo " arena --help" + chgrp -R games /usr/share/games/arena + chmod -R g+rw /usr/share/games/arena + chgrp games /usr/bin/arena + chmod g+rx /usr/bin/arena + /bin/true +} + +post_upgrade() { + post_install +} + diff --git a/license b/license new file mode 100644 index 000000000000..5d75ff60c8e5 --- /dev/null +++ b/license @@ -0,0 +1,39 @@ +Terms Of Use For Arena + +THE ELDER SCROLLS: ARENA +For Win2k/WinXP + +IMPORTANT - PLEASE READ CAREFULLY BEFORE INSTALLING THE ELDER SCROLLS: ARENA +("THIS PRODUCT"). + +THIS IS A LEGAL DOCUMENT STATING THE TERMS AND CONDITIONS GOVERNING INSTALLATION +AND USE OF THIS PRODUCT. BY CLICKING YOUR ACCEPTANCE BELOW OR BY INSTALLING OR +USING THIS PRODUCT, YOU AGREE TO THE TERMS STATED HEREIN BY BETHESDA SOFTWORKS. + +IF YOU DO NOT AGREE, DO NOT INSTALL. + +1. You have a non-exclusive, non-transferable license and right to use this +Product for your own personal use and enjoyment. This Product is not provided +for any non-personal, commercial purpose. All rights not expressly granted to +you herein are hereby reserved by Bethesda Softworks. + +2. As between you and Bethesda Softworks, all rights, title and interest in and +to the Product, and all worldwide intellectual property rights that are embodied +in, related to, or represented by the Product, are and at all times shall remain +the sole and exclusive property of Bethesda Softworks. + +3. This Product is provided "as is." Bethesda Softworks makes no representation, +warranty or covenant of any kind as to merchantability or fitness for a +particular purpose or use, and disclaims any liability with respect thereto. In +no event shall Bethesda Softworks, its affiliates, or their respective officers, +directors, employees or agents be liable in any way to you or to any third party +for any damage whatsoever that may result from use of this Product or its +installation. + +4. Neither Bethesda Softworks nor any of its affiliates will provide any +technical or customer support with respect to this Product or its use by you or +any third party. + +5. You acknowledge that Bethesda Softworks owns any and all trademark, copyright +and other proprietary rights to this Product. + |