1 rizwank 1.1 #!/bin/sh
2 # Generate test archives using cabarc.exe (Windows Cabinet SDK/bin)
3 # This is run just once, and generates the file cabinet_files.h,
4 # which is then checked into CVS forever.
5 # It is here just in case we want to add more test files later.
|
6 rizwank 1.2 # Copyright 2005 Dan Kegel, Rizwan Kassim; LGPL
|
7 rizwank 1.1
|
8 rizwank 1.2 # remove "wine" before command calls if you're running on Windows
9
10 set -ex
|
11 rizwank 1.1
12 # First, get cabinet SDK
13 # You might need to download it by hand from ttp://support.microsoft.com/?id=310618
14 test -f cabsdk.exe || wget -c http://download.microsoft.com/download/platformsdk/cab/2.0/w98nt42kmexp/en-us/cabsdk.exe
15
16 # unpack it (handily, it's a zip file)
17 mkdir cabsdk
18 cd cabsdk
19 unzip ../cabsdk.exe
20 cd ..
21 chmod 744 cabsdk/BIN/CABARC.EXE
22
23 # Simple archive, just one 42 byte file
24 echo 'So long, and thanks for all the fish.....' > simple.txt
25 wine cabsdk/BIN/CABARC.EXE N simple.cab simple.txt
26
27 # Blow away cabinet SDK
|
28 rizwank 1.3 rm -rf cabsdk
|
29 rizwank 1.1
30 # Pack source files and archives into hex arrays
|
31 rizwank 1.4 perl ../../../tools/chexify.pl simple.txt txt simple.cab > simplecab.h
|
32 rizwank 1.3
|
33 rizwank 1.4 rm -fr simple.cab
|