forked from frankmorgner/OpenSCToken
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap
executable file
·55 lines (50 loc) · 2.27 KB
/
bootstrap
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
#!/bin/bash
BUILDPATH=${PWD}/build
PREFIX=/
export MACOSX_DEPLOYMENT_TARGET="10.12"
RESOURCES=/Applications/OpenSCTokenApp.app/Contents/PlugIns/OpenSCToken.appex/Contents/Resources
set -ex
if -z "$OPENSSL_CFLAGS" -a -z "$OPENSSL_LIBS"; then
if ! test -e $BUILDPATH/openssl/$PREFIX/lib/pkgconfig; then
# Build OpenSSL manually, because Apple's binaries are deprecated
if ! test -e openssl; then
git clone --depth=1 https://github.com/openssl/openssl.git -b OpenSSL_1_0_2-stable
fi
cd openssl
KERNEL_BITS=64 ./config --prefix=$PREFIX
make update
make depend
make
make INSTALL_PREFIX=$BUILDPATH/openssl install_sw
cd ..
fi
export OPENSSL_CFLAGS="`env PKG_CONFIG_PATH=$BUILDPATH/openssl/$PREFIX/lib/pkgconfig PKG_CONFIG_SYSROOT_DIR=$BUILDPATH/openssl pkg-config --static --cflags libcrypto`"
export OPENSSL_LIBS="` env PKG_CONFIG_PATH=$BUILDPATH/openssl/$PREFIX/lib/pkgconfig PKG_CONFIG_SYSROOT_DIR=$BUILDPATH/openssl pkg-config --static --libs libcrypto`"
fi
if -z "$OPENPACE_CFLAGS" -a -z "$OPENPACE_LIBS"; then
if ! test -e $BUILDPATH/openpace/$PREFIX/lib/pkgconfig; then
if ! test -e openpace; then
git clone --depth=1 https://github.com/frankmorgner/openpace.git
fi
cd openpace
if ! test -e configure; then
autoreconf -vis
fi
./configure --disable-shared --prefix=$PREFIX --sysconfdir=$RESOURCES --enable-cvcdir=$RESOURCES --enable-x509dir=$RESOURCES CRYPTO_CFLAGS="$OPENSSL_CFLAGS" CRYPTO_LIBS="$OPENSSL_LIBS" HELP2MAN=/usr/bin/true
touch src/cvc-create.1 src/cvc-print.1
make DESTDIR=$BUILDPATH/openpace install
cd ..
fi
export OPENPACE_CFLAGS="`env PKG_CONFIG_PATH=$BUILDPATH/openssl/$PREFIX/lib/pkgconfig:$BUILDPATH/openpace/$PREFIX/lib/pkgconfig PKG_CONFIG_SYSROOT_DIR=$BUILDPATH/openpace pkg-config --static --cflags libeac` $OPENSSL_CFLAGS"
export OPENPACE_LIBS="` env PKG_CONFIG_PATH=$BUILDPATH/openssl/$PREFIX/lib/pkgconfig:$BUILDPATH/openpace/$PREFIX/lib/pkgconfig PKG_CONFIG_SYSROOT_DIR=$BUILDPATH/openpace pkg-config --static --libs libeac` $OPENSSL_LIBS"
fi
if ! test -e OpenSC; then
git clone --depth=1 https://github.com/OpenSC/OpenSC.git
fi
cd OpenSC
if ! test -e configure; then
autoreconf -vis
fi
./configure --disable-shared --prefix=$PREFIX --sysconfdir=$RESOURCES --disable-pcsc --enable-cryptotokenkit --disable-notify
make
cd ..