Index: main/trunk/package-kits/linux/deb/gli/debian/changelog
===================================================================
--- main/trunk/package-kits/linux/deb/gli/debian/changelog	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gli/debian/changelog	(revision 29471)
@@ -0,0 +1,5 @@
+gli (VERSION) UNRELEASED; urgency=medium
+
+  * Initial release. (Closes: #XXXXXX)
+
+ -- Greenstone Team <greenstone_team@cs.waikato.ac.nz>  Tue, 25 Nov 2014 14:38:47 +1300
Index: main/trunk/package-kits/linux/deb/gli/debian/compat
===================================================================
--- main/trunk/package-kits/linux/deb/gli/debian/compat	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gli/debian/compat	(revision 29471)
@@ -0,0 +1,1 @@
+9
Index: main/trunk/package-kits/linux/deb/gli/debian/control
===================================================================
--- main/trunk/package-kits/linux/deb/gli/debian/control	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gli/debian/control	(revision 29471)
@@ -0,0 +1,13 @@
+Source: gli
+Section: java
+Priority: optional
+Maintainer: Greenstone Team <greenstone_team@cs.waikato.ac.nz>
+Uploaders: Jeremy Symon <jtsymon@gmail.com>
+Build-Depends: debhelper (>= 9)
+
+Package: gli
+Architecture: all
+Homepage: http://greenstone.org
+Depends: greenstone-tools
+Description: Greenstone Librarian Interface
+ GUI frontend to greenstone-tools
Index: main/trunk/package-kits/linux/deb/gli/debian/copyright
===================================================================
--- main/trunk/package-kits/linux/deb/gli/debian/copyright	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gli/debian/copyright	(revision 29471)
@@ -0,0 +1,22 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Greenstone Digital Library
+Upstream-Contact: greenstone_team@cs.waikato.ac.nz
+Source: http://greenstone.org
+
+Files: *
+License: GPL-2
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+On Debian GNU/Linux and Ubuntu systems, the complete text of the GPL-2 License
+can be found in '/usr/share/common-licenses/GPL-2'
Index: main/trunk/package-kits/linux/deb/gsdl/Makefile
===================================================================
--- main/trunk/package-kits/linux/deb/gsdl/Makefile	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gsdl/Makefile	(revision 29471)
@@ -0,0 +1,82 @@
+systemlib	:= /usr/lib
+java		:= $(systemlib)/jvm/default-java
+systembin	:= /usr/bin
+gssrv		:= /srv/gsdl
+tomcatlib	:= /usr/share/java/tomcat7
+tomcatconf	:= /etc/tomcat7/Catalina/localhost
+gstools		:= /opt/greenstone
+
+all: cleanpkg main tools demo
+
+svn:
+	@echo "Getting latest source"
+	svn co http://svn.greenstone.org/main/trunk/greenstone3 svn
+
+src: svn
+	$(eval svnver := $(shell cd svn && svnversion -c | grep -o '[[:digit:]:]*'))
+	$(eval srcver := $(shell if test -d src; then cd src && svnversion -c | grep -o '[[:digit:]:]*'; else echo "nope"; fi))
+	if test $(svnver) != $(srcver); then \
+	echo "Making copy of source" ; \
+	rm -rf src ; \
+	cp -rT svn src ; \
+	fi
+
+cleanpkg:
+	@echo Cleaning pkg directory
+	rm -rf pkg
+
+clean: cleanpkg
+	@echo "Cleaning src directory"
+	rm -rf src
+
+cleanall: clean
+	@echo "Cleaning svn directory"
+	rm -rf svn
+
+prepare: src
+	cp -L *.properties *.patch src/
+	cd src ; \
+	export JAVA_HOME=$(java) ; \
+	yes | ant prepare
+	patch -d src/ -p0 -N -i gs2build.patch || :
+	cd src/gs2build/build-src ; \
+	autoconf
+	rm -rf src/packages/*.zip
+	rm -rf src/packages/axis/docs
+	rm -rf src/gs2build/build-src/packages
+
+build: prepare
+	cd src ; \
+	export JAVA_HOME=$(java) ; \
+	ant install
+	mv src/lib/jni/*.jar src/web/WEB-INF/lib/
+	# patch for gs2build tempdir
+	patch -d src/ -p0 -N -i perl-util.patch || :
+	# delete windows/mac stuff
+	find src/ -type d \( -iname "win32" -o -iname "windows" -o -iname "winutil" -o -iname "darwin" \) -exec rm -rf {} \; 2> /dev/null || :
+	find src/ \( -iname "*.dll" -o -iname "*.exe" \) -exec rm -rf {} \; || :
+
+main: build
+	$(eval pkgdir := pkg/main)
+	install -d $(pkgdir)/$(gssrv) $(pkgdir)/$(systemlib) $(pkgdir)/$(tomcatlib)
+	install -dm775 $(pkgdir)/$(tomcatlib)
+	install -Dm755 src/lib/jni/*.so $(pkgdir)/$(systemlib)
+	rsync -av --exclude sites/localsite/collect/ --exclude .svn src/web/ $(pkgdir)/$(gssrv)/
+	install -Dm644 greenstone3.xml $(pkgdir)/$(tomcatconf)/greenstone3.xml
+	mv $(pkgdir)/$(gssrv)/WEB-INF/lib/derby.jar $(pkgdir)/$(tomcatlib)
+
+tools: build 
+	$(eval pkgdir := pkg/tools)
+	install -d $(pkgdir)/$(gstools)
+	rsync -av --exclude build-src --exclude common-src --exclude collect/demo --exclude .svn src/gs2build $(pkgdir)/$(gstools)/
+	rsync -av --exclude build-src --exclude common-src --exclude collect/demo --exclude .svn src/bin $(pkgdir)/$(gstools)/
+	install -Dm755 greenstone $(pkgdir)/$(systembin)/greenstone
+
+demo: build
+	$(eval pkgdir := pkg/demo)
+	@echo "Building demo collections"
+	$(shell find sites/localsite/collect/ -mindepth 1 -maxdepth 1 -not -name ".*" -execdir bash -c 'col="$(basename $1)"; import.pl -removeold -site localsite "$$col"; buildcol.pl -removeold -site localsite "$$col"; mv "$$col/building" "$$col/index"' -- {} \;)
+	install -d $(pkgdir)/$(gssrv)/sites/localsite
+	rsync -av --exclude .svn src/web/sites/localsite/collect $(pkgdir)/$(gssrv)/sites/localsite/
+
+.PHONY: svn cleanpkg clean cleanall prepare build main tools demo
Index: main/trunk/package-kits/linux/deb/gsdl/build.properties
===================================================================
--- main/trunk/package-kits/linux/deb/gsdl/build.properties	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gsdl/build.properties	(revision 29471)
@@ -0,0 +1,1 @@
+link ../../build.properties
Index: main/trunk/package-kits/linux/deb/gsdl/debian/changelog
===================================================================
--- main/trunk/package-kits/linux/deb/gsdl/debian/changelog	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gsdl/debian/changelog	(revision 29471)
@@ -0,0 +1,5 @@
+greenstone (VERSION) UNRELEASED; urgency=medium
+
+  * Initial release. (Closes: #XXXXXX)
+
+ -- Greenstone Team <greenstone_team@cs.waikato.ac.nz>  Tue, 25 Nov 2014 14:38:47 +1300
Index: main/trunk/package-kits/linux/deb/gsdl/debian/compat
===================================================================
--- main/trunk/package-kits/linux/deb/gsdl/debian/compat	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gsdl/debian/compat	(revision 29471)
@@ -0,0 +1,1 @@
+9
Index: main/trunk/package-kits/linux/deb/gsdl/debian/control
===================================================================
--- main/trunk/package-kits/linux/deb/gsdl/debian/control	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gsdl/debian/control	(revision 29471)
@@ -0,0 +1,25 @@
+Source: greenstone
+Section: java
+Priority: optional
+Maintainer: Greenstone Team <greenstone_team@cs.waikato.ac.nz>
+Uploaders: Jeremy Symon <jtsymon@gmail.com>
+Build-Depends: debhelper (>= 9)
+
+Package: greenstone
+Architecture: all
+Homepage: http://greenstone.org
+Depends:
+Description: Greenstone Digital Library
+ Greenstone is a suite of software for building and distributing digital library collections.
+
+Package: greenstone-tools
+Architecture: all
+Homepage: http://greenstone.org
+Depends:
+Description: Greenstone Digital Library Tools
+
+Package: greenstone-demo
+Architecture: all
+Homepage: http://greenstone.org
+Depends:
+Description: Greenstone Digital Library Demo Collections
Index: main/trunk/package-kits/linux/deb/gsdl/debian/copyright
===================================================================
--- main/trunk/package-kits/linux/deb/gsdl/debian/copyright	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gsdl/debian/copyright	(revision 29471)
@@ -0,0 +1,22 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Greenstone Digital Library
+Upstream-Contact: greenstone_team@cs.waikato.ac.nz
+Source: http://greenstone.org
+
+Files: *
+License: GPL-2
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+On Debian GNU/Linux and Ubuntu systems, the complete text of the GPL-2 License
+can be found in '/usr/share/common-licenses/GPL-2'
Index: main/trunk/package-kits/linux/deb/gsdl/debian/rules
===================================================================
--- main/trunk/package-kits/linux/deb/gsdl/debian/rules	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gsdl/debian/rules	(revision 29471)
@@ -0,0 +1,3 @@
+ #!/usr/bin/make -f
+
+
Index: main/trunk/package-kits/linux/deb/gsdl/gli
===================================================================
--- main/trunk/package-kits/linux/deb/gsdl/gli	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gsdl/gli	(revision 29471)
@@ -0,0 +1,1 @@
+link ../../gli
Index: main/trunk/package-kits/linux/deb/gsdl/greenstone
===================================================================
--- main/trunk/package-kits/linux/deb/gsdl/greenstone	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gsdl/greenstone	(revision 29471)
@@ -0,0 +1,1 @@
+link ../../greenstone
Index: main/trunk/package-kits/linux/deb/gsdl/greenstone3.xml
===================================================================
--- main/trunk/package-kits/linux/deb/gsdl/greenstone3.xml	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gsdl/greenstone3.xml	(revision 29471)
@@ -0,0 +1,1 @@
+link ../../greenstone3.xml
Index: main/trunk/package-kits/linux/deb/gsdl/gs2build.patch
===================================================================
--- main/trunk/package-kits/linux/deb/gsdl/gs2build.patch	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gsdl/gs2build.patch	(revision 29471)
@@ -0,0 +1,1 @@
+link ../../gs2build.patch
Index: main/trunk/package-kits/linux/deb/gsdl/perl-util.patch
===================================================================
--- main/trunk/package-kits/linux/deb/gsdl/perl-util.patch	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gsdl/perl-util.patch	(revision 29471)
@@ -0,0 +1,1 @@
+link ../../perl-util.patch
Index: main/trunk/package-kits/linux/deb/gsdl/wvWare
===================================================================
--- main/trunk/package-kits/linux/deb/gsdl/wvWare	(revision 29471)
+++ main/trunk/package-kits/linux/deb/gsdl/wvWare	(revision 29471)
@@ -0,0 +1,1 @@
+link ../../wvWare
