-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprebuild.sh
executable file
·56 lines (41 loc) · 1.08 KB
/
prebuild.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
urls="http://acsc.cs.utexas.edu/cpabe/libbswabe-0.9.tar.gz \
http://acsc.cs.utexas.edu/cpabe/cpabe-0.11.tar.gz \
https://crypto.stanford.edu/pbc/files/pbc-0.5.14.tar.gz"
deps="libbswabe-0.9.tar.gz \
cpabe-0.11.tar.gz \
pbc-0.5.14.tar.gz"
for dep in $deps
do
rm $dep
done
echo "Downloading"
for url in $urls
do
echo $url
wget $url & > /dev/null
done
wait
echo "Extracting"
for dep in $deps
do
echo $dep
tar -xzf $dep & > /dev/null
done
wait
# Apply patches
patch -R cpabe-0.11/common.c patches/[email protected]
patch -R cpabe-0.11/common.h patches/[email protected]
patch -R cpabe-0.11/policy_lang.y patches/cpabe-0.11@policy_lang.y.patch
patch -R libbswabe-0.9/Makefile.in patches/[email protected]
patch -R cpabe-0.11/policy_lang.c patches/cpabe-0.11@policy_lang.c.patch
# Configure and compile
cd pbc-0.5.14
./configure CFLAGS="-fPIC" CPPFLAGS="-fPIC"
make
cd ..
ROOT=$(pwd)
ls $ROOT/pbc-0.5.14/include
ls $ROOT/pbc-0.5.14/.libs/
cd libbswabe-0.9
./configure --with-pbc-include=$ROOT/pbc-0.5.14/include --with-pbc-lib=$ROOT/pbc-0.5.14/.libs/
make