Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37513510
en ru br
ALT Linux repos
S:2.3-alt3_25jpp11
5.0: 2.3-alt1_3jpp5

Group :: Development/Other
RPM: brazil

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/sh
NAME="brazil"
VERSION=2.3

echo "Downloading jar..."
# Upstream lives in the Sun Download Center, which normally requires a login
# and limits the number of times you can download the package, /however/, the
# download link from the project page at http://research.sun.com/brazil/ goes
# to a page that performs some magic that apparently obviates all of these
# restrictions entirely. Considering that this magic is performed by one of
# upstream's own pages, I think it's fair to use that mechanism to download it,
# which is the reason for the following bit of fruity script:
POST_URL=$(wget -q --user-agent="Mozilla/5.0 (U) Firefox/2.0.0.10" --keep-session-cookies --save-cookies=cookie \
http://www.experimentalstuff.com/Technologies/Brazil/download.html -O - | grep jsessionid | cut -d \" -f 4)
POST_SESSION=$(echo $POST_URL | cut -d = -f 3)
wget -q --user-agent="Mozilla/5.0 (U) Firefox/2.0.0.10" --load-cookies=cookie --keep-session-cookies --save-cookies=cookie \
--referer=http://www.experimentalstuff.com/Technologies/Brazil/download.html --post-data "url=$POST_URL&session=$POST_SESSION&licenseOK=accept" \
http://www.experimentalstuff.com/Technologies/Brazil/download.html -O - >/dev/null
URL=$(wget -q --user-agent="Mozilla/5.0 (U) Firefox/2.0.0.10" --load-cookies=cookie --keep-session-cookies --save-cookies=cookie \
--referer=http://www.experimentalstuff.com/Technologies/Brazil/download.html --post-data "noTemplate=true&product=$NAME-$VERSION.jar" \
http://www.experimentalstuff.com/Technologies/download.html -O - | grep location= | cut -d \" -f 2)
wget -q --no-cookies $URL -O $NAME-$VERSION.jar
rm cookie

echo "Unzipping jar..."
mkdir $NAME-$VERSION
unzip -q -d $NAME-$VERSION $NAME-$VERSION.jar 1>/dev/null 2>/dev/null
rm $NAME-$VERSION.jar

# jettison empty files and pre-built binaries and javadocs
rm $NAME-$VERSION/*.changed
rm -rf $NAME-$VERSION/com $NAME-$VERSION/contrib $NAME-$VERSION/sunlabs $NAME-$VERSION/tcl $NAME-$VERSION/tests \
$NAME-$VERSION/html $NAME-$VERSION/META-INF

# remove source from a different project with a different license
rm $NAME-$VERSION/samples/conman/misc/app_meetme.c

echo "Creating tarball '$NAME-$VERSION.tar.gz'..."
tar -czf $NAME-$VERSION.tar.gz $NAME-$VERSION
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin