updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / nwn-diamond / PKGBUILD
blobf2589e18e30fb9b39467e26080ea493ab45e8efb
1 # Contributor: Slash <demodevil5[at]yahoo[dot]com>
2 # Contributor: Adam Griffiths <adam_griffithsAATTdart.net.au>
4 pkgname=nwn-diamond
5 pkgver=1.69
6 pkgrel=6
7 pkgdesc="Neverwinter Nights is an RPG from Bioware. This requires the Diamond Collection DVD Release."
8 url="http://nwn.bioware.com/"
9 license=('custom')
10 arch=('i686' 'x86_64')
11 if [ "$CARCH" = "x86_64" ]; then
12     depends=('binkplayer' 'elfutils' 'lib32-elfutils' 'lib32-libgl' 'lib32-libstdc++5' 'lib32-libxcursor' 'lib32-libxdamage' 'lib32-mesa' 'perl' 'lib32-sdl_mixer')
13 else
14     depends=('binkplayer' 'elfutils' 'libgl' 'libstdc++5' 'libxcursor' 'mesa' 'perl' 'sdl_mixer')
16 makedepends=('unzip' 'p7zip' 'perl')
17 provides=('nwn')
18 conflicts=('nwn')
19 install=nwn.install
20 source=("http://nwdownloads.bioware.com/neverwinternights/linux/gold/nwclientgold.tar.gz" \
21 "http://nwdownloads.bioware.com/neverwinternights/linux/161/nwclienthotu.tar.gz" \
22 "http://files.bioware.com/neverwinternights/updates/linux/169/English_linuxclient169_xp2.tar.gz" \
23 "http://home.roadrunner.com/~nwmovies/nwlinux-beta.tar.bz2" \
24 "http://home.roadrunner.com/~nwmovies/cursors.tar.gz" \
25 "nwn.launcher" "nwn.desktop")
26 noextract=('nwclientgold.tar.gz' 'nwclienthotu.tar.gz' 'English_linuxclient169_xp2.tar.gz')
27 md5sums=('0a059d55225fc32f905e86191d88a11f'
28          '376cdece07106ea058d42b531f3146bb'
29          'b021f0da3b3e00848521926716fdf487'
30          '3961f7464d3d5b7ac9f097aa9aa2f4d3'
31          '7be935418f0ececb5660f53b7a902b38'
32          '7fd0497f55856edf50480b5acd3136d3'
33          'bd7f80f5faa5ee1203371b4e8ec40638')
34 PKGEXT='.pkg.tar'
36 # Directory where the NWN Diamond DVD is Mounted
37 _dvdpath=/media/dvd
39 # NWN Diamond CD-Keys (Neverwinter Nights, Shadows of Undrentide, and Hordes of the Underdark)
40 _key_nwn=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
41 _key_sou=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
42 _key_hou=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
44 build()
46     cd $srcdir/
48     # Create Destination Directory
49     install -d $pkgdir/opt/nwn
51     # Extract Data Files from DVD ROM
52     unzip $_dvdpath/Data_Shared.zip -d $pkgdir/opt/nwn/ || return 1
53     unzip $_dvdpath/Data_linux.zip  -d $pkgdir/opt/nwn/ || return 1
54     unzip -o $_dvdpath/data/XP1.zip -d $pkgdir/opt/nwn/ || return 1
55     unzip -o $_dvdpath/data/XP2.zip -d $pkgdir/opt/nwn/ || return 1
57     # Extract Game Clients
58     tar -zxvf $srcdir/nwclientgold.tar.gz -C $pkgdir/opt/nwn/
59     tar -zxvf $srcdir/nwclienthotu.tar.gz -C $pkgdir/opt/nwn/
61     # Extract Kingmaker Files
62     7z x $_dvdpath/KingmakerSetup.exe -xr0\!*PLUGINSDIR* -xr\!*.exe -xr\!*.dat \
63         -o$srcdir/kingmakertmp/
65     # Install Kingmaker Files
66     cp -r $srcdir/kingmakertmp/\$0/* \
67         $pkgdir/opt/nwn/
69     # Extract Latest Patch
70     tar -zxvf $srcdir/English_linuxclient169_xp2.tar.gz -C $pkgdir/opt/nwn
72     # Check the Installation
73     cd $pkgdir/opt/nwn/
74     ./fixinstall
76     # Remove Unneeded Files & Directories
77     rm -r $pkgdir/opt/nwn/SDL-1.2.5/
79     # Install CD Key File
80     cat << EOF > $pkgdir/opt/nwn/nwncdkey.ini
81 ;These are your CD Keys for Neverwinter Nights.
82 ;DO NOT share these CD Keys with ANYONE.
83 ;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.
85 [CDKEY]
86 Key3=$_key_hou
87 Key2=$_key_sou
88 Key1=$_key_nwn
89 EOF
91     cd $srcdir/
93     ###########################################################################
94     #
95     # nwmovies:
96     #
97     #     Movies in Linux Client Support for NWN
98     #
99     ###########################################################################
101     # Compile nwmovies using the appropriate SDL library
102     if [ "$CARCH" = "x86_64" ]; then
103         ./nwmovies_install.pl /usr/lib32/libSDL-1.2.so.0
104     else
105         ./nwmovies_install.pl /usr/lib/libSDL-1.2.so.0
106     fi
108     # Install nwmovies binaries
109     install -D -m 755 -t $pkgdir/opt/nwn/ \
110         $srcdir/nwmovies/{nwmovies.so,nwmovies.pl}
112     # Install binkplayer binaries
113     install -D -m 755 $srcdir/nwmovies/binklib.so \
114         $pkgdir/opt/nwn/nwmovies/binklib.so
116     # Install libdis binaries
117     install -D -m 755 $srcdir/nwmovies/libdis/libdisasm.so \
118         $pkgdir/opt/nwn/nwmovies/libdis/libdisasm.so
120     # SymLink BinkPlayer to the NWN Directory so the Movie Launcher (nwmovies.pl) can find it
121     ln -s /usr/bin/binkplayer $pkgdir/opt/nwn/BinkPlayer
123     ###########################################################################
124     #
125     # nwuser:
126     #
127     #     Per-User Settings Support for NWN
128     #
129     ###########################################################################
131     # Compile nwuser
132     ./nwuser_install.pl
134     # Install nwuser binaries
135     install -D -m 755 $srcdir/nwuser/nwuser.so \
136         $pkgdir/opt/nwn/nwuser.so
138     # Install 64bit binaries if Arch64
139     if [ "$CARCH" = "x86_64" ]; then
140         install -D -m 755 $srcdir/nwuser/nwuser64.so \
141             $pkgdir/opt/nwn/nwuser64.so
142     fi
144     ###########################################################################
145     #
146     # nwmouse:
147     #
148     #     Hardware Mouse Cursors Support for NWN
149     #
150     ###########################################################################
152     # Patch file so it can find user.h
153     /bin/sed -i 's|linux/user.h|sys/user.h|1' $srcdir/nwmouse/nwmouse_cookie.c
155     # Compile nwmouse
156     ./nwmouse_install.pl
158     # Install nwmouse binaries
159     install -D -m 755 $srcdir/nwmouse/nwmouse.so \
160         $pkgdir/opt/nwn/nwmouse.so
162     # Install libdis binaries
163     install -D -m 755 $srcdir/nwmouse/libdis/libdisasm.so \
164         $pkgdir/opt/nwn/nwmouse/libdis/libdisasm.so
166     ###########################################################################
167     #
168     # nwlogger:
169     #
170     #     Client-Side Chat Window Logging Support for NWN
171     #
172     ###########################################################################
174     # Patch file so it can find user.h
175     /bin/sed -i 's|linux/user.h|sys/user.h|1' $srcdir/nwlogger/nwlogger_cookie.c
177     # Compile nwlogger
178     ./nwlogger_install.pl
180     # Install nwlogger binaries
181     install -D -m 755 $srcdir/nwlogger/nwlogger.so \
182         $pkgdir/opt/nwn/nwlogger.so
184     # Install libdis binaries
185     install -D -m 755 $srcdir/nwlogger/libdis/libdisasm.so \
186         $pkgdir/opt/nwn/nwlogger/libdis/libdisasm.so
188     ###########################################################################
190     # Install Cursors
191     install -d $pkgdir/opt/nwn/nwmouse/cursors/
192     tar -zxvf $srcdir/cursors.tar.gz -C $pkgdir/opt/nwn/nwmouse/cursors/
194     # Install Custom License
195     install -D -m 644 $_dvdpath/EULA.txt \
196         $pkgdir/usr/share/licenses/$pkgname/EULA.txt
198     # Install Launcher (Client)
199     install -D -m 755 $srcdir/nwn.launcher \
200         $pkgdir/usr/bin/nwn
202     # Install Desktop File
203     install -D -m 644 $srcdir/nwn.desktop \
204         $pkgdir/usr/share/applications/nwn.desktop
206     # Install Icon File
207     install -D -m 644 $_dvdpath/nwn.ico \
208         $pkgdir/usr/share/pixmaps/nwn.ico
210     # Fix Whacky Permissions
211     chown -R root:root $pkgdir/
212     chmod -R o+r $pkgdir/