diff options
author | Slashbunny | 2014-11-24 19:53:25 -0500 |
---|---|---|
committer | Slashbunny | 2014-11-24 19:53:25 -0500 |
commit | de3dcfbe80e90c9856e4f2a1786bc3bc6f90751f (patch) | |
tree | 484f3033ec8c479e64846227efa12d0c2325a4d8 /PKGBUILD | |
parent | 0efca9af9aef8a89f248c249301466365714b686 (diff) | |
download | aur-de3dcfbe80e90c9856e4f2a1786bc3bc6f90751f.tar.gz |
Large refactoring of nwn-diamond PKGBUILD
* Modernize PKGBUILD (prepare, build, package functions)
* All DVD operations and archive extractions now happen in prepare()
* Patching only happens in prepare()
* Update nwn addons to use new github source location
* Quote all paths with variables
* Add default key file, instructions during install on how to use it
* Add key file to backup array
* Move all addon compilation to build() function
* Move all addon installation into custom _install_addons() function for
clarity
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 311 |
1 files changed, 149 insertions, 162 deletions
@@ -1,109 +1,91 @@ -# Contributor: Slash <demodevil5[at]yahoo[dot]com> +# Maintainer: Slash <demodevil5[at]yahoo[dot]com> # Contributor: Adam Griffiths <adam_griffithsAATTdart.net.au> pkgname=nwn-diamond pkgver=1.69 -pkgrel=7 -pkgdesc="Neverwinter Nights is an RPG from Bioware. This requires the Diamond Collection DVD Release." -url="http://nwn.bioware.com/" -license=('custom') +pkgrel=8 +pkgdesc='Neverwinter Nights RPG from Bioware. Requires the Diamond Collection DVD. Update PKGBUILD with path to your DVD.' +url='http://nwn.bioware.com/' +license=('custom:EULA') arch=('i686' 'x86_64') -if [ "$CARCH" = "x86_64" ]; then +if [ "$CARCH" = 'x86_64' ]; then depends=('binkplayer' 'elfutils' 'lib32-elfutils' 'lib32-libgl' 'lib32-libstdc++5' 'lib32-libxcursor' 'lib32-libxdamage' 'lib32-mesa' 'perl' 'lib32-sdl_mixer') else depends=('binkplayer' 'elfutils' 'libgl' 'libstdc++5' 'libxcursor' 'mesa' 'perl' 'sdl_mixer') fi -makedepends=('unzip' 'p7zip' 'perl') +makedepends=('git' 'unzip' 'p7zip' 'perl') provides=('nwn') conflicts=('nwn') -install=nwn.install -source=("http://nwdownloads.bioware.com/neverwinternights/linux/gold/nwclientgold.tar.gz" \ -"http://nwdownloads.bioware.com/neverwinternights/linux/161/nwclienthotu.tar.gz" \ -"http://files.bioware.com/neverwinternights/updates/linux/169/English_linuxclient169_xp2.tar.gz" \ -"http://home.roadrunner.com/~nwmovies/nwlinux-beta.tar.bz2" \ -"http://home.roadrunner.com/~nwmovies/cursors.tar.gz" \ -"http://home.roadrunner.com/~nwmovies/nwmovies/nwmovies-latest.tar.gz" \ -"nwn.launcher" "nwn.desktop") -noextract=('nwclientgold.tar.gz' 'nwclienthotu.tar.gz' 'English_linuxclient169_xp2.tar.gz' 'nwmovies-latest.tar.gz') -md5sums=('0a059d55225fc32f905e86191d88a11f' - '376cdece07106ea058d42b531f3146bb' - 'b021f0da3b3e00848521926716fdf487' - '3961f7464d3d5b7ac9f097aa9aa2f4d3' - '7be935418f0ececb5660f53b7a902b38' - '1698a83bce2050174670e30c42b9d673' - '7fd0497f55856edf50480b5acd3136d3' - 'bd7f80f5faa5ee1203371b4e8ec40638') +install='nwn.install' +backup=('opt/nwn/nwncdkey.ini') +source=( + 'http://nwdownloads.bioware.com/neverwinternights/linux/gold/nwclientgold.tar.gz' + 'http://nwdownloads.bioware.com/neverwinternights/linux/161/nwclienthotu.tar.gz' + 'http://files.bioware.com/neverwinternights/updates/linux/169/English_linuxclient169_xp2.tar.gz' + 'git+https://github.com/nwnlinux/nwlogger.git#commit=3bfa7aa5' + 'git+https://github.com/nwnlinux/nwmouse.git#commit=6df8b96f' + 'git+https://github.com/nwnlinux/nwmovies.git#commit=61fb3645' + 'git+https://github.com/nwnlinux/nwuser.git#commit=3fbbf546' + 'nwn.launcher' + 'nwn.desktop' + 'nwn.key' +) +noextract=( + 'English_linuxclient169_xp2.tar.gz' + 'nwclientgold.tar.gz' + 'nwclienthotu.tar.gz' +) +sha256sums=('6aea73cee2f6c9733ef4a121888cb3451d8a31b968a02e1ec897242df53395f3' + '0a4ace1aacd69fb166d09bd249ce5ae98dd28f580765f52e0147bb85f7dfcfd7' + '09715e2b95c025ef7f00d218deec1b1edce501530d8cba51d61097c69699763f' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'bcaa399db7fdaba64535cc79ee9b8e0c02851fe6c06a72c47abe98530eff63e7' + '50f6272eebd8de19c018a24a5b3ce4ca15bd1fff0aef818ec1036f249faa612c' + 'SKIP') PKGEXT='.pkg.tar' -# Directory where the NWN Diamond DVD is Mounted +# Directory where the NWN Diamond DVD is mounted +# Tip: Create an ISO from your DVD to speed up the process _dvdpath=/media/dvd -# NWN Diamond CD-Keys (Neverwinter Nights, Shadows of Undrentide, and Hordes of the Underdark) -_key_nwn=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx -_key_sou=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx -_key_hou=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx - -build() +prepare() { - cd $srcdir/ - - # Create Destination Directory - install -d $pkgdir/opt/nwn - - # Remove nwmovies which ships with the beta code; Replace with latest - rm -rf nwmovies - tar --overwrite -zxvf $srcdir/nwmovies-latest.tar.gz -C $srcdir/ - - # Extract Data Files from DVD ROM - unzip $_dvdpath/Data_Shared.zip -d $pkgdir/opt/nwn/ || return 1 - unzip $_dvdpath/Data_linux.zip -d $pkgdir/opt/nwn/ || return 1 - unzip -o $_dvdpath/data/XP1.zip -d $pkgdir/opt/nwn/ || return 1 - unzip -o $_dvdpath/data/XP2.zip -d $pkgdir/opt/nwn/ || return 1 + # Extract Data Files from DVD + unzip -o "${_dvdpath}/Data_Shared.zip" -d "${srcdir}/gametmp/" + unzip -o "${_dvdpath}/Data_linux.zip" -d "${srcdir}/gametmp/" + unzip -o "${_dvdpath}/data/XP1.zip" -d "${srcdir}/gametmp/" + unzip -o "${_dvdpath}/data/XP2.zip" -d "${srcdir}/gametmp/" # Extract Game Clients - tar -zxvf $srcdir/nwclientgold.tar.gz -C $pkgdir/opt/nwn/ - tar -zxvf $srcdir/nwclienthotu.tar.gz -C $pkgdir/opt/nwn/ - - # Extract Kingmaker Files - 7z x $_dvdpath/KingmakerSetup.exe -xr0\!*PLUGINSDIR* -xr\!*.exe -xr\!*.dat \ - -o$srcdir/kingmakertmp/ - - # Install Kingmaker Files - cp -r $srcdir/kingmakertmp/\$0/* \ - $pkgdir/opt/nwn/ + tar -zxvf "${srcdir}/nwclientgold.tar.gz" -C "${srcdir}/gametmp/" + tar -zxvf "${srcdir}/nwclienthotu.tar.gz" -C "${srcdir}/gametmp/" # Extract Latest Patch - tar -zxvf $srcdir/English_linuxclient169_xp2.tar.gz -C $pkgdir/opt/nwn + tar -zxvf "${srcdir}/English_linuxclient169_xp2.tar.gz" -C \ + "${srcdir}/gametmp/" - # Check the Installation - cd $pkgdir/opt/nwn/ - ./fixinstall + # Extract Kingmaker Files + 7z x "${_dvdpath}/KingmakerSetup.exe" -xr0\!*PLUGINSDIR* -xr\!*.exe -xr\!*.dat \ + -o"${srcdir}/kingmakertmp/" -aoa - # Remove Unneeded Files & Directories - rm -r $pkgdir/opt/nwn/SDL-1.2.5/ + # Copy License, Icon off DVD + cp -f "${_dvdpath}/"{EULA.txt,nwn.ico} "${srcdir}" - # Install CD Key File - cat << EOF > $pkgdir/opt/nwn/nwncdkey.ini -;These are your CD Keys for Neverwinter Nights. -;DO NOT share these CD Keys with ANYONE. -;Apart from this installation, or when registering with the Official Neverwinter Nights Community Site [http://nwn.bioware.com], BioWare and Infogrames will NEVER ask you for this CD Key. - -[CDKEY] -Key3=$_key_hou -Key2=$_key_sou -Key1=$_key_nwn -EOF - - cd $srcdir/ - - ########################################################################### - # - # nwmovies: - # - # Movies in Linux Client Support for NWN - # - ########################################################################### + # Patch nwmouse so it can find user.h + /bin/sed -i 's|linux/user.h|sys/user.h|1' \ + "${srcdir}/nwmouse/nwmouse/nwmouse_cookie.c" + # Patch nwlogger so it can find user.h + /bin/sed -i 's|linux/user.h|sys/user.h|1' \ + "${srcdir}/nwlogger/nwlogger/nwlogger_cookie.c" +} + +build() +{ + cd "${srcdir}/nwmovies" # Compile nwmovies using the appropriate SDL library if [ "$CARCH" = "x86_64" ]; then ./nwmovies_install.pl /usr/lib32/libSDL-1.2.so.0 @@ -111,110 +93,115 @@ EOF ./nwmovies_install.pl /usr/lib/libSDL-1.2.so.0 fi - # Install nwmovies binaries - install -D -m 755 -t $pkgdir/opt/nwn/ \ - $srcdir/nwmovies/{nwmovies.so,nwmovies.pl} + # Compile nwuser + cd "${srcdir}/nwuser" + ./nwuser_install.pl - # Install binkplayer binaries - install -D -m 755 $srcdir/nwmovies/binklib.so \ - $pkgdir/opt/nwn/nwmovies/binklib.so + # Compile nwmouse + cd "${srcdir}/nwmouse" + ./nwmouse_install.pl - # Install libdis binaries - install -D -m 755 $srcdir/nwmovies/libdis/libdisasm.so \ - $pkgdir/opt/nwn/nwmovies/libdis/libdisasm.so + # Compile nwlogger + cd "${srcdir}/nwlogger" + ./nwlogger_install.pl +} - # SymLink BinkPlayer to the NWN Directory so the Movie Launcher (nwmovies.pl) can find it - ln -s /usr/bin/binkplayer $pkgdir/opt/nwn/BinkPlayer +package() +{ + # Create Destination Directory + install -d "${pkgdir}/opt/" - ########################################################################### - # - # nwuser: - # - # Per-User Settings Support for NWN - # - ########################################################################### + # Install Base Game Files + mv "${srcdir}/gametmp/" \ + "${pkgdir}/opt/nwn" - # Compile nwuser - ./nwuser_install.pl + # Install Kingmaker Files + cp -r "${srcdir}/kingmakertmp/\$0/"* \ + "${pkgdir}/opt/nwn/" - # Install nwuser binaries - install -D -m 755 $srcdir/nwuser/nwuser.so \ - $pkgdir/opt/nwn/nwuser.so + # Check the Installation + cd "${pkgdir}/opt/nwn/" + ./fixinstall - # Install 64bit binaries if Arch64 - if [ "$CARCH" = "x86_64" ]; then - install -D -m 755 $srcdir/nwuser/nwuser64.so \ - $pkgdir/opt/nwn/nwuser64.so - fi + # Install Addons (nwmovies, nwuser, nwmouse, and nwlogger) + _install_addons - ########################################################################### - # - # nwmouse: - # - # Hardware Mouse Cursors Support for NWN - # - ########################################################################### + # Install CD Key File + install -D -m 0644 "${srcdir}/nwn.key" \ + "${pkgdir}/opt/nwn/nwncdkey.ini" - # Patch file so it can find user.h - /bin/sed -i 's|linux/user.h|sys/user.h|1' $srcdir/nwmouse/nwmouse_cookie.c + # Install Custom License + install -D -m 0644 "${srcdir}/EULA.txt" \ + "${pkgdir}/usr/share/licenses/${pkgname}/EULA.txt" - # Compile nwmouse - ./nwmouse_install.pl + # Install Launcher (Client) + install -D -m 0755 "${srcdir}/nwn.launcher" \ + "${pkgdir}/usr/bin/nwn" - # Install nwmouse binaries - install -D -m 755 $srcdir/nwmouse/nwmouse.so \ - $pkgdir/opt/nwn/nwmouse.so + # Install Desktop File + install -D -m 0644 "${srcdir}/nwn.desktop" \ + "${pkgdir}/usr/share/applications/nwn.desktop" - # Install libdis binaries - install -D -m 755 $srcdir/nwmouse/libdis/libdisasm.so \ - $pkgdir/opt/nwn/nwmouse/libdis/libdisasm.so + # Install Icon File + install -D -m 0644 "${srcdir}/nwn.ico" \ + "${pkgdir}/usr/share/pixmaps/nwn.ico" - ########################################################################### - # - # nwlogger: - # - # Client-Side Chat Window Logging Support for NWN - # - ########################################################################### + # Remove Unneeded Files & Directories + rm -r "${pkgdir}/opt/nwn/SDL-1.2.5/" - # Patch file so it can find user.h - /bin/sed -i 's|linux/user.h|sys/user.h|1' $srcdir/nwlogger/nwlogger_cookie.c + # Fix Whacky Permissions + chown -R root:root "${pkgdir}" + chmod -R o+r "${pkgdir}" +} - # Compile nwlogger - ./nwlogger_install.pl +_install_addons() +{ + cd "${srcdir}" - # Install nwlogger binaries - install -D -m 755 $srcdir/nwlogger/nwlogger.so \ - $pkgdir/opt/nwn/nwlogger.so + # Install nwmovies binaries + install -D -m 0755 -t "${pkgdir}/opt/nwn/" \ + "${srcdir}/nwmovies/"{nwmovies.so,nwmovies.pl} + + # Install binkplayer binaries + install -D -m 0755 "${srcdir}/nwmovies/nwmovies/binklib.so" \ + "${pkgdir}/opt/nwn/nwmovies/binklib.so" # Install libdis binaries - install -D -m 755 $srcdir/nwlogger/libdis/libdisasm.so \ - $pkgdir/opt/nwn/nwlogger/libdis/libdisasm.so + install -D -m 0755 "${srcdir}/nwmovies/nwmovies/libdis/libdisasm.so" \ + "${pkgdir}/opt/nwn/nwmovies/libdis/libdisasm.so" - ########################################################################### + # SymLink BinkPlayer to the NWN Directory so the Movie Launcher (nwmovies.pl) can find it + ln -s /usr/bin/binkplayer "${pkgdir}/opt/nwn/BinkPlayer" - # Install Cursors - install -d $pkgdir/opt/nwn/nwmouse/cursors/ - tar -zxvf $srcdir/cursors.tar.gz -C $pkgdir/opt/nwn/nwmouse/cursors/ + # Install nwuser binaries + install -D -m 0755 "${srcdir}/nwuser/nwuser/nwuser.so" \ + "${pkgdir}/opt/nwn/nwuser.so" - # Install Custom License - install -D -m 644 $_dvdpath/EULA.txt \ - $pkgdir/usr/share/licenses/$pkgname/EULA.txt + # Install 64bit binaries if Arch64 + if [ "$CARCH" = "x86_64" ]; then + install -D -m 0755 "${srcdir}/nwuser/nwuser/nwuser64.so" \ + "${pkgdir}/opt/nwn/nwuser64.so" + fi - # Install Launcher (Client) - install -D -m 755 $srcdir/nwn.launcher \ - $pkgdir/usr/bin/nwn + # Install nwmouse binaries + install -D -m 0755 "${srcdir}/nwmouse/nwmouse/nwmouse.so" \ + "${pkgdir}/opt/nwn/nwmouse.so" - # Install Desktop File - install -D -m 644 $srcdir/nwn.desktop \ - $pkgdir/usr/share/applications/nwn.desktop + # Install libdis binaries + install -D -m 0755 "${srcdir}/nwmouse/nwmouse/libdis/libdisasm.so" \ + "${pkgdir}/opt/nwn/nwmouse/libdis/libdisasm.so" - # Install Icon File - install -D -m 644 $_dvdpath/nwn.ico \ - $pkgdir/usr/share/pixmaps/nwn.ico + # Install nwlogger binaries + install -D -m 0755 "${srcdir}/nwlogger/nwlogger/nwlogger.so" \ + "${pkgdir}/opt/nwn/nwlogger.so" - # Fix Whacky Permissions - chown -R root:root $pkgdir/ - chmod -R o+r $pkgdir/ + # Install libdis binaries + install -D -m 0755 "${srcdir}/nwlogger/nwlogger/libdis/libdisasm.so" \ + "${pkgdir}/opt/nwn/nwlogger/libdis/libdisasm.so" + + # Install Cursors + install -d "${pkgdir}/opt/nwn/nwmouse/cursors/" + tar -zxvf "${srcdir}/nwmouse/nwmouse/cursors.tar.gz" -C \ + "${pkgdir}/opt/nwn/nwmouse/cursors/" } |