7 URL
=http
://www.openssl.org
/source
/$DIR.
tar.gz
15 replace_symlinks_with_copies
() {
17 SYMLINKS
="$(git ls-tree -r $BRANCH: | sed -n 's/^120000.\{47\}//p')" &&
18 if test -z "$SYMLINKS"
20 die
"No symlinks found? You need to update your /git/."
22 (export GIT_INDEX_FILE
=.git
/tmp
&&
23 git read-tree
$BRANCH &&
25 total
=$
(echo "$SYMLINKS" |
wc -l) &&
26 UPDATES
="$(echo "$SYMLINKS" |
29 printf "\rProcessing symlink
($i/$total)" >&2 &&
31 BASEDIR="${path%/*}/" &&
32 TARGET="$
(git cat-file blob
$BRANCH:$path)" &&
33 while test "$TARGET" != "${TARGET#../}"
35 BASEDIR="$
(echo "$BASEDIR" |
36 sed 's|[^/]*/$||')" &&
37 TARGET="${TARGET#../}"
39 git ls-files --stage "$BASEDIR$TARGET" |
42 echo "$UPDATES" | git update-index
--index-info &&
43 TREE
=$
(git write-tree
) &&
44 COMMIT
=$
(echo "Replace symlinks with copies" |
45 git commit-tree
$TREE -p $BRANCH) &&
46 git update-ref refs
/heads
/$BRANCH $COMMIT)
52 test $
(ls ..
/patches
/*.
patch |
wc -l) = \
53 $
(($
(git rev-list HEAD |
wc -l)-2)) && return
54 git am ..
/patches
/*.
patch
60 die
"Could not download OpenSSL"
65 /git
/contrib
/fast-import
/import-tars.perl ..
/$FILE
67 } || die
"Could not check out openssl"
69 test $
(cat $DIR/apps
/md4.c
2> /dev
/null |
wc -l) -gt 2 ||
(
71 replace_symlinks_with_copies import-tars
&&
72 git checkout import-tars
&&
73 test $
(wc -l < apps
/md4.c
) -gt 2
74 ) || die
"Could not replace symlinks with copies"
76 test grep INSTALLTOP
=/mingw
$DIR/Makefile
> /dev
/null
2>&1 ||
(
79 ) || die
"Could not apply the patches"
81 test -f $DIR/openssl.dll ||
(
83 cmd
/c ms
\\mingw32.bat
&&
85 list
=$
(echo *.dll openssl.exe
) &&
86 cp $list /mingw
/bin
&& (
89 git commit
-s -m "Install OpenSSL $VERSION"
92 cp -r openssl
/mingw
/include
&&
96 git commit
-s -m "Install OpenSSL $VERSION header files"
98 ) || die
"Could not install $FILE"