Skip to content

Commit

Permalink
slimerjs: new
Browse files Browse the repository at this point in the history
  • Loading branch information
liushuyu committed Mar 9, 2018
1 parent 4cf4bf1 commit ecbcf25
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
37 changes: 37 additions & 0 deletions extra-js/slimerjs/autobuild/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
mkdir -p "$PKGDIR"/opt/slimerjs/chrome
mkdir -p "$PKGDIR"/usr/share/doc/slimerjs/
mkdir -p "$PKGDIR"/usr/bin/
DESTDIR="$PKGDIR"/opt/slimerjs/
DOCDIR="$PKGDIR"/usr/share/doc/slimerjs/

pushd src
abinfo "Copying files..."
install -Dm644 application.ini "$DESTDIR"
install -Dm755 slimerjs "$DESTDIR"
install -Dm755 slimerjs.py "$DESTDIR"
install -Dm644 LICENSE "$DOCDIR"
install -Dm644 README.md "$DOCDIR"
install -Dm755 slimerjs-node "$DESTDIR"
install -Dm644 phantom-protocol.js "$DESTDIR"
ln -sv /opt/slimerjs/slimerjs "$PKGDIR"/usr/bin/
ln -sv /opt/slimerjs/slimerjs-node "$PKGDIR"/usr/bin/

cp -arv chrome/icons "$DESTDIR"/chrome/
cp -arv vendors "$DESTDIR"/

abinfo "Creating XUL plugins..."

zip -r $DESTDIR/omni.ja chrome/ components/ defaults/ modules/ chrome.manifest --exclude @package_exclude.lst

sed -i "s|BuildID=.*|BuildID=$(date +%Y%m%d)|g" "$DESTDIR"/application.ini

popd

abinfo "Running sanity check (headless)..."
if ! timeout 5 $DESTDIR/slimerjs --headless --debug=1 examples/phantomjs/loadspeed.js example.com > test.log 2>&1; then
aberr "Sanity check failed. This build is not working."
exit 10
else
abinfo "Sanity check passed."
fi

7 changes: 7 additions & 0 deletions extra-js/slimerjs/autobuild/defines
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PKGNAME=slimerjs
PKGDES="A scriptable browser like PhantomJS, based on Firefox"
PKGDEP="firefox bash python-2"
PKGRECOM="nodejs"
BUILDDEP="zip"

ABHOST=noarch
3 changes: 3 additions & 0 deletions extra-js/slimerjs/spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VER="20180124"
GITSRC="https://github.com/laurentj/slimerjs.git"
GITCO="009e159ad2cd565a962665af690b6d0497e067f1"

0 comments on commit ecbcf25

Please sign in to comment.