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 # More complicated archive, with two files
28 cp ../../../README README
29 cp ../../../COPYING.LIB lgpl.txt
30 wine cabsdk/BIN/CABARC.EXE N complex.cab README lgpl.txt
31
32 rizwank 1.1 # Blow away cabinet SDK
|
33 rizwank 1.3 rm -rf cabsdk
|
34 rizwank 1.1
35 # Pack source files and archives into hex arrays
36 perl ../../../tools/chexify.pl simple.txt README lgpl.txt simple.cab complex.cab > data.h
|
37 rizwank 1.3
38 rm -fr README lgpl.txt simple.cab complex.cab
|