Skip to content

Commit

Permalink
Branches the test application off from kanaloa-dev into new package k…
Browse files Browse the repository at this point in the history
…analoa-dev-service. Moves the test app from kanaloa to kanaloa-dev-service.

People who are interested in developing with kanaloa may choose kanaloa-dev. They do not want a test service running.
People who are actually developing kanaloa itself probably do want the dev service, as the integration tests depend on it.
  • Loading branch information
schwink committed Aug 9, 2010
1 parent 836d7bb commit eeae50f
Show file tree
Hide file tree
Showing 21 changed files with 185 additions and 32 deletions.
2 changes: 1 addition & 1 deletion client/web/debian/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: kanaloa-client-web
Section: unknown
Section: web
Priority: extra
Maintainer: Steve <steve@schwink.net>
Build-Depends: debhelper (>= 7), devscripts
Expand Down
28 changes: 28 additions & 0 deletions server/dev-service/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
NAME = kanaloa-dev-service
VERSION = 0.01
DEST = $(DESTDIR)/usr/lib/erlang/lib/$(NAME)-$(VERSION)
DEST_EBIN = $(DEST)/ebin
DEST_BIN = $(DESTDIR)/usr/bin
DEST_NGINX=$(DESTDIR)/etc/nginx/sites-available

build: ebin/
(cd src;$(MAKE) all)

clean:
(cd src;$(MAKE) clean)

ebin/:
@mkdir -p ebin

install:
@mkdir -p $(DEST_EBIN) || true
cp ebin/* $(DEST_EBIN)
@mkdir -p $(DEST_BIN) || true
cp bin/kanaloa-test-app $(DEST_BIN)/
@mkdir -p $(DEST_NGINX) || true
cp config/nginx/kanaloa-dev $(DEST_NGINX)/

package:
# Increment the version number
dch --newversion $(VERSION)-1-`date +"%Y%m%d%H%M%S"` "Local build"
dpkg-buildpackage -rfakeroot -b -uc -tc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
#set -x

die () {
echo >&2 "usage: kanaloa_test_app -n sname -p portNum [-d]"
echo >&2 "usage: kanaloa-test-app -n sname -p portNum [-d]"
exit 1
}

Expand Down Expand Up @@ -35,11 +35,11 @@ done
[[ $SNAME != "" ]] || die
[[ $PORTNUM != "" ]] || die

# Set up the HOME environment variable, which erl expects
export HOME=/tmp/
# Set up the HOME environment variable, which erl expects.
# The cookie file will be put here.
export HOME=/var/log/kanaloa-dev/

# CHANGE THIS TO YOUR CODE DIRECTORY
RUNDIR=/home/dev/code/kanaloa/server/kanaloa/
RUNDIR=$HOME
cd $RUNDIR
exec erl \
-pa $RUNDIR/tbin/ \
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions server/dev-service/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kanaloa-dev-service (0.01-1) unstable; urgency=low

* Initial release

-- Steve <steve@schwink.net> Sat, 27 Mar 2010 02:24:03 -0700
1 change: 1 addition & 0 deletions server/dev-service/debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7
13 changes: 13 additions & 0 deletions server/dev-service/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Source: kanaloa-dev-service
Section: web
Priority: extra
Maintainer: Steve <steve@schwink.net>
Build-Depends: debhelper, devscripts
Standards-Version: 3.8.1
Homepage:

Package: kanaloa-dev-service
Architecture: any
Depends: ${misc:Depends}, nginx, kanaloa, kanaloa-client-web
Suggests:
Description: Sets up a sample application, useful for testing kanaloa. The kanaloa integration tests depend on this service.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: A test service for the kanaloa library.
# Short-Description: A sample application using the the kanaloa library.
### END INIT INFO

set -u
Expand All @@ -23,7 +23,7 @@ start_erl () {
start-stop-daemon --start \
--pidfile $PIDFILE \
--chuid $USR \
--exec $DAEMON -- -daemon /tmp/ /var/log/$NAME/ "/usr/bin/kanaloa_test_app -n $DESC -p 8001"
--exec $DAEMON -- -daemon /tmp/ /var/log/$NAME/ "/usr/bin/kanaloa-test-app -n $DESC -p 8001"
}

set -e
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/sh
# postinst script for kanaloa-dev
# postinst script for kanaloa-dev-service
#
# see: dh_installdeb(1)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/sh
# postrm script for kanaloa-dev
# postrm script for kanaloa-dev-service
#
# see: dh_installdeb(1)

Expand Down
85 changes: 85 additions & 0 deletions server/dev-service/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/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

configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.

touch configure-stamp


build: build-stamp
build-stamp: configure-stamp
dh_testdir

# Add here commands to compile the package.
$(MAKE)

touch $@

clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp

# Add here commands to clean up after the build process.
$(MAKE) clean

dh_clean

install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs

# Add here commands to install the package into debian/kanaloa-dev-service.
$(MAKE) DESTDIR=$(CURDIR)/debian/kanaloa-dev-service install


# Build architecture-independent files here.
binary-indep: install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: install
dh_testdir
dh_testroot
# dh_installchangelogs
# dh_installdocs
# dh_installexamples
# dh_install
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_python
dh_installinit --name=kanaloa-dev
# dh_installcron
# dh_installinfo
# dh_installman
# dh_link
# dh_strip
# dh_compress
dh_fixperms
# dh_perl
# dh_makeshlibs
dh_installdeb
# dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
34 changes: 34 additions & 0 deletions server/dev-service/src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
include ../../kanaloa/support/include.mk

APPLICATION=kanaloa
DOC_OPTS={dir,\"../doc\"}
TEST_PLT=$(TEST_DIR)/dialyzer_plt

all: $(EBIN_FILES)

debug:
$(MAKE) DEBUG=-DDEBUG

clean:
rm -rf ../ebin
rm -rf ../doc

edoc:
$(ERL) -noshell -pa ../ebin \
-eval "edoc:application($(APPLICATION), \".\", [$(DOC_OPTS)])" \
-s init stop

test: $(EBIN_FILES)
mkdir -p $(TEST_DIR);
@../support/run_tests.escript $(EBIN_DIR) $(TBIN_DIR) | tee $(TEST_DIR)/test.log

$(TEST_PLT):
mkdir -p $(TEST_DIR)
cp $(DIALYZER_PLT) $(TEST_PLT)
dialyzer --plt $(TEST_PLT) --add_to_plt -r ../deps/*/ebin

clean_plt:
rm $(TEST_PLT)

dialyzer: $(TEST_PLT)
dialyzer --src --plt $(TEST_PLT) -DNOTEST -DDIALYZER -c ../src | tee $(TEST_DIR)/dialyzer.log
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 2 additions & 9 deletions server/dev/Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
NAME = kanaloa-dev
VERSION = 0.01
NGINX_SITES_AVAILABLE=$(DESTDIR)/etc/nginx/sites-available
DEST_BIN = $(DESTDIR)/usr/bin

build:
/bin/true

clean:
/bin/true

force:

install:
@mkdir -p $(NGINX_SITES_AVAILABLE) || true
cp config/nginx/kanaloa $(NGINX_SITES_AVAILABLE)/ || true
@mkdir -p $(DEST_BIN) || true
cp bin/kanaloa_test_app $(DEST_BIN)
/bin/true

package: force
package:
# Increment the version number
dch --newversion $(VERSION)-1-`date +"%Y%m%d%H%M%S"` "Local build"
dpkg-buildpackage -rfakeroot -b -uc -tc
6 changes: 3 additions & 3 deletions server/dev/debian/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: kanaloa-dev
Section: unknown
Section: web
Priority: extra
Maintainer: Steve <steve@schwink.net>
Build-Depends: debhelper, devscripts
Expand All @@ -8,6 +8,6 @@ Homepage:

Package: kanaloa-dev
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, build-essential, debhelper, devscripts, emacs23-nox, erlang-dev, erlang-mode, erlang-nox, erlang-manpages, erlang-tools, fakeroot, jsdoc-toolkit, nginx, python-setuptools, kanaloa, kanaloa-client-web
Suggests:
Depends: build-essential, debhelper, devscripts, erlang-dev, erlang-nox, erlang-manpages, erlang-tools, fakeroot, jsdoc-toolkit, nginx, python-setuptools, kanaloa, kanaloa-client-web
Suggests: emacs23-nox, erlang-mode
Description: Metapackage for setting up a kanaloa development machine.
2 changes: 1 addition & 1 deletion server/dev/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ binary-arch: install
# dh_installpam
# dh_installmime
# dh_python
dh_installinit
# dh_installinit
# dh_installcron
# dh_installinfo
# dh_installman
Expand Down
6 changes: 3 additions & 3 deletions server/kanaloa/debian/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: kanaloa
Section: unknown
Section: web
Priority: extra
Maintainer: Steve <steve@schwink.net>
Build-Depends: debhelper (>= 7), devscripts
Expand All @@ -8,6 +8,6 @@ Homepage:

Package: kanaloa
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, erlang-nox, mochiweb, uuid
Suggests:
Depends: ${misc:Depends}, erlang-nox, mochiweb, uuid
Suggests: kanaloa-dev, kanaloa-dev-service
Description: The Kanaloa web streaming framework.
5 changes: 0 additions & 5 deletions server/kanaloa/start.sh

This file was deleted.

1 change: 0 additions & 1 deletion server/kanaloa/test/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
include ../support/include.mk

all: $(TBIN_FILES)
cp *.app ../tbin/

clean:
rm -rf ../tbin
Expand Down

0 comments on commit eeae50f

Please sign in to comment.