root/main/trunk/package-kits/linux/deb/gsdl/Makefile @ 29474

Revision 29474, 2.8 KB (checked in by jts21, 5 years ago)

Got deb packages working

Line 
1systemlib   := /usr/lib
2java        := $(systemlib)/jvm/default-java
3systembin   := /usr/bin
4gssrv       := /srv/gsdl
5tomcatlib   := /usr/share/tomcat7/lib
6tomcatconf  := /etc/tomcat7/Catalina/localhost
7gstools     := /opt/greenstone
8DESTDIR     ?= /
9
10all: build
11
12deb:
13    # generate .install files
14    rm -f debian/*.install
15    echo $(gssrv) >> debian/greenstone.install
16    echo $(tomcatlib) >> debian/greenstone.install
17    echo $(systemlib) >> debian/greenstone.install
18    echo $(tomcatconf) >> debian/greenstone.install
19    echo $(gstools) >> debian/greenstone-tools.install
20    echo $(systembin) >> debian/greenstone-tools.install
21    dpkg-buildpackage -rfakeroot
22
23svn:
24    @echo "Getting latest source"
25    svn co http://svn.greenstone.org/main/trunk/greenstone3 svn
26
27src: svn
28    $(eval svnver := $(shell cd svn && svnversion -c | grep -o '[[:digit:]:]*'))
29    $(eval srcver := $(shell if test -d src; then cd src && svnversion -c | grep -o '[[:digit:]:]*'; else echo "nope"; fi))
30    if test $(svnver) != $(srcver); then \
31    $(MAKE) clean ; \
32    echo "Making copy of source" ; \
33    cp -rT svn src ; \
34    fi
35
36clean:
37    @echo "Cleaning src directory"
38    rm -rf src
39    rm -f prepare build
40
41cleanall: clean
42    @echo "Cleaning svn directory"
43    rm -rf svn
44
45prepare: src
46    cp -L *.properties *.patch src/
47    cd src ; \
48    export JAVA_HOME=$(java) ; \
49    yes | ant prepare
50    patch -d src/ -p0 -N -i gs2build.patch || :
51    cd src/gs2build/build-src ; \
52    autoconf
53    rm -rf src/packages/*.zip
54    rm -rf src/packages/axis/docs
55    rm -rf src/gs2build/build-src/packages
56    touch prepare
57
58build: prepare
59    cd src ; \
60    JAVA_HOME=$(java) ant install
61    mv src/lib/jni/*.jar src/web/WEB-INF/lib/
62    # patch for gs2build tempdir
63    patch -d src/ -p0 -N -i perl-util.patch || :
64    # delete windows/mac stuff
65    find src/ -type d \( -iname "win32" -o -iname "windows" -o -iname "winutil" -o -iname "darwin" \) -exec rm -rf {} \; 2> /dev/null || :
66    find src/ \( -iname "*.dll" -o -iname "*.exe" \) -exec rm -rf {} \; || :
67    touch build
68
69install: install-main install-tools
70
71install-main: build
72    install -d $(DESTDIR)/$(gssrv) $(DESTDIR)/$(systemlib) $(DESTDIR)/$(tomcatlib)
73    install -dm775 $(DESTDIR)/$(tomcatlib)
74    install -Dm755 src/lib/jni/*.so $(DESTDIR)/$(systemlib)
75    rsync -a --info=STATS --exclude sites/localsite/collect/ --exclude .svn src/web/ $(DESTDIR)/$(gssrv)/
76    install -Dm644 greenstone3.xml $(DESTDIR)/$(tomcatconf)/greenstone3.xml
77    mv $(DESTDIR)/$(gssrv)/WEB-INF/lib/derby.jar $(DESTDIR)/$(tomcatlib)
78
79install-tools: build
80    install -d $(DESTDIR)/$(gstools)
81    rsync -a --info=STATS --exclude build-src --exclude common-src --exclude collect/demo --exclude .svn src/gs2build $(DESTDIR)/$(gstools)/
82    rsync -a --info=STATS --exclude build-src --exclude common-src --exclude collect/demo --exclude .svn src/bin $(DESTDIR)/$(gstools)/
83    install -Dm755 greenstone $(DESTDIR)/$(systembin)/greenstone
84
85.PHONY: svn clean cleanall install install-main install-tools
Note: See TracBrowser for help on using the browser.