From aac0c64c10ae3230a73b0929e27a5515abddfe36 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 18 Feb 2012 18:49:40 +0100 Subject: [PATCH] initial checkin --- .gitignore | 2 ++ CONFIG | 2 ++ README.md | 26 ++++++++++++++++++++++++++ debian/changelog | 5 +++++ debian/compat | 1 + debian/control | 21 +++++++++++++++++++++ debian/copyright | 12 ++++++++++++ debian/install | 2 ++ debian/rules | 10 ++++++++++ download.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 124 insertions(+) create mode 100644 .gitignore create mode 100644 CONFIG create mode 100644 README.md create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/install create mode 100755 debian/rules create mode 100755 download.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f33dbbe --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +selenium-server-standalone-*.jar +selenium-server.jar diff --git a/CONFIG b/CONFIG new file mode 100644 index 0000000..a039d9b --- /dev/null +++ b/CONFIG @@ -0,0 +1,2 @@ +# configure version of selenium-server +version=2.18.0 diff --git a/README.md b/README.md new file mode 100644 index 0000000..ac14821 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# Purpose + +selenium-deb-pkg implements a simple way to build a Debian package of +the selenium-server. This is useful if you want to roll out +selenium-server on your infrastructure using Debian repositories. + +The build step will automatically download the selenium-server jar +file from Google code and put it into a binary Debian package. A +symlink /var/lib/selenium/selenium-server.jar will generated to point +to the actual selenium-server file, so you can use +/var/lib/selenium/selenium-server.jar in your startup/init script +without worrying about the selenium-server version. + +# How to build + +To build the Debian package just use the common way for Debian package +builds. If you don't know what this is about, you might just want to +run: + + % fakeroot debian/rules binary + +# Adjust selenium-server version + +Edit the configuration file CONFIG and point the 'version' variable to +the version of selenium-server you want to use. Do not forget to +adjust debian/changelog accordingly. diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..9e4ada0 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +selenium-server (2.18.0-1) unstable; urgency=low + + * Initial release. + + -- Michael Prokop Sat, 18 Feb 2012 17:49:56 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +8 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..0e65671 --- /dev/null +++ b/debian/control @@ -0,0 +1,21 @@ +Source: selenium-server +Section: web +Priority: extra +Maintainer: Michael Prokop +Build-Depends: debhelper (>= 8.0.0) +Standards-Version: 3.9.2 +Homepage: https://github.com/mika/selenium-deb-pkg +Vcs-Git: git://github.com/mika/selenium-deb-pkg.git +Vcs-Browser: https://github.com/mika/selenium-deb-pkg + +Package: selenium-server +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends}, java-runtime-headless | openjdk-6-jre-headless | sun-java6-jre +Description: automated web application testing system + Selenium automates browsers. Primarily it is for automating web + applications for testing purposes, but is certainly not limited + to just that. Boring web-based administration tasks can (and + should!) also be automated as well. + . + The Selenium Server is needed in order to run either Selenium RC + style scripts or Remote Selenium Webdriver ones. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..c8a19db --- /dev/null +++ b/debian/copyright @@ -0,0 +1,12 @@ +Format: http://dep.debian.net/deps/dep5/ + +Files: * +Copyright: 2012 Michael Prokop +License: other + These files are in the public domain. + . + Pedants who belive I cannot legally say that code I have written is in + the public domain may consider them instead to be licensed as follows: + . + Redistribution and use in source and binary forms, with or without + modification, are permitted under any circumstances. No warranty. diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..aec0bdf --- /dev/null +++ b/debian/install @@ -0,0 +1,2 @@ +selenium-server-standalone-*.jar var/lib/selenium +selenium-server.jar var/lib/selenium diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..183501f --- /dev/null +++ b/debian/rules @@ -0,0 +1,10 @@ +#!/usr/bin/make -f +%: + dh $@ + +override_dh_auto_build: + ./download.sh + +override_dh_auto_clean: + rm -f selenium-server.jar + rm -f selenium-server-standalone-*.jar diff --git a/download.sh b/download.sh new file mode 100755 index 0000000..5d8d9b7 --- /dev/null +++ b/download.sh @@ -0,0 +1,43 @@ +if ! . ./CONFIG ; then + echo "Error sourcing configuration file CONFIG" >&2 + exit 1 +fi + +# allow overriding via command line +if [ -n "$1" ] ; then + version="$1" +fi + +echo "Using selenium version $version (override via file CONFIG)" + +if [ -n "$version" ] ; then + jar="selenium-server-standalone-${version}.jar" +else + echo "Error: \$version is unset." >&2 + exit 1 +fi + +create_symlink() { + ln -sf "$jar" selenium-server.jar +} + +if [ -r "$jar" ] ; then + echo "File $jar exists already, nothing to do." + create_symlink + exit 0 +fi + +echo "Downloading $jar (might take a while...)" +if wget --no-verbose -O "$jar" "http://selenium.googlecode.com/files/${jar}" ; then + echo OK +else + echo "ERROR" >&2 + exit 1 +fi + +if ! test -s "$jar" ; then + echo "Empty $jar file." >&2 + exit 1 +fi + +create_symlink