forked from OpenModelica/OMLibraries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacports-build.sh
executable file
·38 lines (30 loc) · 1.02 KB
/
macports-build.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
#!/bin/sh
. ./build-common.sh
DEPENDS=`for f in $DEPENDS; do test ! -z "$f" || echo -n "port:$f "; done`
mkdir -p macports-build
cd macports-build
PORTFILE=../macports/lang/$DEBNAME/Portfile
if test -f "$PORTFILE" && grep -q "^version *$DEBREV"; then
echo Up-to-date: $FULLNAME
exit 0
fi
SOURCETARBALL=$FULLNAME.orig.tar.gz
if test ! -f $FULLNAME.orig.tar.gz; then
wget -nv "https://build.openmodelica.org/apt/pool/libraries/$SOURCETARBALL" || exit 1
fi
MD5=`openssl md5 $SOURCETARBALL | cut -d \ -f 2`
SHA1=`openssl sha1 $SOURCETARBALL | cut -d \ -f 2`
RMD160=`openssl rmd160 $SOURCETARBALL | cut -d \ -f 2`
mkdir -p `dirname "$PORTFILE"`
SOURCE_ESCAPED=`echo $NAME$EXT | tr " " "*"`
cat ../templates/macports/Portfile.omlib.in \
| sed "s,@URL@,$ORIGURL," \
| sed "s,@MD5@,$MD5," \
| sed "s,@SHA1@,$SHA1," \
| sed "s,@RMD160@,$RMD160," \
| sed "s,@LICENSE@,$LICENSE," \
| sed "s,@REV@,$DEBREV," \
| sed "s,@NAME@,$DEBNAME," \
| sed "s,@SOURCE@,$SOURCE_ESCAPED," \
| sed "s,@DEPENDS@,$DEPENDS," \
> $PORTFILE