diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..972bbfe651b922d9d33bcc9051a37ab33236252c --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,5 @@ +/files +/floodlight.debhelper.log +/floodlight.substvars +/floodlight + diff --git a/debian/README b/debian/README new file mode 100644 index 0000000000000000000000000000000000000000..8583ef341267838fcc1ac25c84ab1a88a603aa3c --- /dev/null +++ b/debian/README @@ -0,0 +1,6 @@ +The Debian Package floodlight +---------------------------- + +Comments regarding the Package + + -- Rich Lane <rlane@bigswitch.com> Thu, 10 May 2012 23:02:25 -0700 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000000000000000000000000000000000000..b3f5ace5775966ac692d3fb2c5de48e2c21963b5 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +floodlight (0.82) unstable; urgency=low + + * Initial Release. + + -- Rich Lane <rlane@bigswitch.com> Thu, 10 May 2012 23:02:25 -0700 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000000000000000000000000000000000000..45a4fb75db864000d01701c0f7a51864bd4daabf --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +8 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000000000000000000000000000000000000..a3bebb37e2808cba875956ff5d8cc1ea74d45387 --- /dev/null +++ b/debian/control @@ -0,0 +1,16 @@ +Source: floodlight +Section: net +Priority: extra +Maintainer: Rich Lane <rlane@bigswitch.com> +Build-Depends: debhelper (>= 8.0.0), javahelper (>= 0.40ubuntu1) +Standards-Version: 3.9.2 +Homepage: http://floodlight.openflowhub.org/ +Vcs-Git: git://github.com/floodlight/floodlight.git +Vcs-Browser: https://github.com/floodlight/floodlight + +Package: floodlight +Architecture: all +Depends: ${java:Depends}, ${misc:Depends} +Description: Java based OpenFlow controller + Floodlight is a Java based OpenFlow controller originally written by David + Erickson at Stanford University. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000000000000000000000000000000000000..e139e18b52babbe34fc4fcef6b260f1e501844c2 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,27 @@ +Format: http://dep.debian.net/deps/dep5 +Upstream-Name: floodlight +Source: https://github.com/floodlight/floodlight + +Files: * +Copyright: 2011 Big Switch Networks <rlane@bigswitch.com> +License: Apache-2.0 + +Files: debian/* +Copyright: 2012 Big Switch Networks <rlane@bigswitch.com> +License: Apache-2.0 + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian systems, the complete text of the Apache version 2.0 license + can be found in "/usr/share/common-licenses/Apache-2.0". diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000000000000000000000000000000000000..588b138a5aceaf1ecbaf91a1d08172598891cc11 --- /dev/null +++ b/debian/docs @@ -0,0 +1,2 @@ +NOTICE.txt +README.txt diff --git a/debian/floodlight.1 b/debian/floodlight.1 new file mode 100644 index 0000000000000000000000000000000000000000..80635073d7d13a860e182ac53853246ddeb9e188 --- /dev/null +++ b/debian/floodlight.1 @@ -0,0 +1,40 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH FLOODLIGHT 1 "May 14, 2012" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp <n> insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +floodlight \- An Apache licensed, Java based OpenFlow controller +.SH SYNOPSIS +.B floodlight +.RI [ options ] +.SH DESCRIPTION +This manual page documents briefly the +.B floodlight +command. +.PP +.\" TeX users may be more comfortable with the \fB<whatever>\fP and +.\" \fI<whatever>\fP escape sequences to invode bold face and italics, +.\" respectively. +\fBfloodlight\fP is an Apache licensed, Java based OpenFlow controller. +.SH OPTIONS +.TP +.B \-cf, \-\-configFile FILE +Floodlight configuration file. +.SH AUTHOR +floodlight was written by David Erickson and Big Switch Networks. +.PP +This manual page was written by Rich Lane <rlane@bigswitch.com>, +for the Debian project (and may be used by others). diff --git a/debian/floodlight.install b/debian/floodlight.install new file mode 100644 index 0000000000000000000000000000000000000000..900beb94f874761c9f97066c911096e554ef3bc9 --- /dev/null +++ b/debian/floodlight.install @@ -0,0 +1,2 @@ +target/floodlight.jar usr/share/java +debian/misc/floodlight usr/bin diff --git a/debian/floodlight.manpages b/debian/floodlight.manpages new file mode 100644 index 0000000000000000000000000000000000000000..bec775d2741b6ae5db26abc89c80c7f41cd13f97 --- /dev/null +++ b/debian/floodlight.manpages @@ -0,0 +1 @@ +debian/floodlight.1 diff --git a/debian/init.d b/debian/init.d new file mode 100644 index 0000000000000000000000000000000000000000..ecb447884107bb4a9fb40d5b0ff73b1c44f12329 --- /dev/null +++ b/debian/init.d @@ -0,0 +1,143 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: floodlight +# Required-Start: $network $local_fs $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: An Apache licensed, Java based OpenFlow controller +# Description: An Apache licensed, Java based OpenFlow controller +### END INIT INFO + +# Author: Rich Lane <rlane@bigswitch.com> + +# PATH should only include /usr/* if it runs after the mountnfs.sh script +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC=floodlight # Introduce a short description here +NAME=floodlight # Introduce the short server's name here +DAEMON=/usr/bin/floodlight # Introduce the server's location here +DAEMON_ARGS="" # Arguments to run the daemon with +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x $DAEMON ] || exit 0 + +# Read configuration variable file if it is present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + # Return + # 0 if daemon has been started + # 1 if daemon was already running + # 2 if daemon could not be started + start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON --test > /dev/null \ + || return 1 + start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON -b -m -- \ + $DAEMON_ARGS \ + || return 2 + # Wait for the server to start. + while ! nc -z localhost 6633; do sleep 1; done +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + # Many daemons don't delete their pidfiles when they exit. + rm -f $PIDFILE + return "$RETVAL" +} + +# +# Function that sends a SIGHUP to the daemon/service +# +do_reload() { + # + # If the daemon can reload its configuration without + # restarting (for example, when it is sent a SIGHUP), + # then implement that here. + # + start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE + return 0 +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + status) + status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? + ;; + #reload|force-reload) + # + # If do_reload() is not implemented then leave this commented out + # and leave 'force-reload' as an alias for 'restart'. + # + #log_daemon_msg "Reloading $DESC" "$NAME" + #do_reload + #log_end_msg $? + #;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/debian/misc/floodlight b/debian/misc/floodlight new file mode 100755 index 0000000000000000000000000000000000000000..6036594a4b32028ff7de01e423e354a38bdb9b88 --- /dev/null +++ b/debian/misc/floodlight @@ -0,0 +1,2 @@ +#!/bin/sh +exec java -jar /usr/share/java/floodlight.jar "$@" diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000000000000000000000000000000000000..f35bb0c395caa40b3538262f854a0c49fce71652 --- /dev/null +++ b/debian/rules @@ -0,0 +1,15 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export JAVA_HOME=/usr/lib/jvm/default-java + +%: + dh $@ --with javahelper diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000000000000000000000000000000000000..89ae9db8f88b823b6a7eabf55e203658739da122 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native)