Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 70 lines (60 sloc) 1.395 kb
b943139 @SaltwaterC v0.2
authored
1 #!/bin/sh
2
e18e147 @SaltwaterC Getting ready for v0.3.
authored
3 ## CONFIG
7b763b7 @SaltwaterC Updated the file bundle to file 5.11.
authored
4 file_version="5.11"
e18e147 @SaltwaterC Getting ready for v0.3.
authored
5 ## /CONFIG
a1c2dda @SaltwaterC Updates the file version to 5.08. Adds support for application/zip wi…
authored
6
2137c0b @SaltwaterC Updated the build script to rebuild file if the installed version is …
authored
7 build_file=0
e18e147 @SaltwaterC Getting ready for v0.3.
authored
8 if [ ! -f bin/file ]
b943139 @SaltwaterC v0.2
authored
9 then
e18e147 @SaltwaterC Getting ready for v0.3.
authored
10 echo "file(1) is not installed: bin/file not found"
2137c0b @SaltwaterC Updated the build script to rebuild file if the installed version is …
authored
11 build_file=1
12 else
e18e147 @SaltwaterC Getting ready for v0.3.
authored
13 if [ ! -f lib/libmagic.so -a ! -f lib/libmagic.dylib ]
14 then
15 echo "file(1) is not installed: lib/libmagic.so or lib/libmagic.dylib not found"
16 build_file=1
17 fi
18 fi
19
20 if [ $build_file -eq 0 ]
21 then
22 installed_file_version=$(LD_LIBRARY_PATH=lib DYLD_LIBRARY_PATH=lib bin/file -v | grep -Eo "[0-9]\.[0-9]+")
c436591 @SaltwaterC Debug info.
authored
23 echo "file(1) $installed_file_version is installed, expecting $file_version"
2137c0b @SaltwaterC Updated the build script to rebuild file if the installed version is …
authored
24 if [ "$installed_file_version" != "$file_version" ]
25 then
26 make purge
27 build_file=1
28 fi
29 fi
30
93cedf7 @SaltwaterC Fixes the ordering.
authored
31 if [ ! -d src/file-$file_version ]
32 then
e18e147 @SaltwaterC Getting ready for v0.3.
authored
33 cd vendor
93cedf7 @SaltwaterC Fixes the ordering.
authored
34 tar -xf file-$file_version.tar.gz
35 mkdir ../src
36 mv file-$file_version ../src
37 cd ..
38 fi
39
2137c0b @SaltwaterC Updated the build script to rebuild file if the installed version is …
authored
40 if [ $build_file -eq 1 ]
41 then
e18e147 @SaltwaterC Getting ready for v0.3.
authored
42 build_file=0
a1c2dda @SaltwaterC Updates the file version to 5.08. Adds support for application/zip wi…
authored
43 cd src/file-$file_version
b943139 @SaltwaterC v0.2
authored
44 ./configure
45 make
46 cd ../../
a1c2dda @SaltwaterC Updates the file version to 5.08. Adds support for application/zip wi…
authored
47 cp src/file-$file_version/magic/magic.mgc share
e18e147 @SaltwaterC Getting ready for v0.3.
authored
48 cp src/file-$file_version/src/.libs/file bin/file
fa82463 @SaltwaterC Experimental build that does not use the file script wrapper from the…
authored
49
e18e147 @SaltwaterC Getting ready for v0.3.
authored
50 if [ -f src/file-$file_version/src/.libs/libmagic.so ]
2b335f0 @SaltwaterC Added the library installation code for OS X.
authored
51 then
e18e147 @SaltwaterC Getting ready for v0.3.
authored
52 cp src/file-$file_version/src/.libs/libmagic.so lib/libmagic.so
2b335f0 @SaltwaterC Added the library installation code for OS X.
authored
53 cd lib
54 ln -s libmagic.so libmagic.so.1
55 cd ..
56 fi
57
e18e147 @SaltwaterC Getting ready for v0.3.
authored
58 if [ -f src/file-$file_version/src/.libs/libmagic.dylib ]
2b335f0 @SaltwaterC Added the library installation code for OS X.
authored
59 then
e18e147 @SaltwaterC Getting ready for v0.3.
authored
60 cp src/file-$file_version/src/.libs/libmagic.dylib lib/libmagic.dylib
2b335f0 @SaltwaterC Added the library installation code for OS X.
authored
61 cd lib
62 ln -s libmagic.dylib libmagic.1.dylib
63 cd ..
64 fi
f8498e6 @SaltwaterC Trying to make the FreeBSD STFU about libmagic.so.1 missing when chec…
authored
65
e18e147 @SaltwaterC Getting ready for v0.3.
authored
66 make debug
b943139 @SaltwaterC v0.2
authored
67 fi
68
69 exit 0
Something went wrong with that request. Please try again.