buildsys: make job safety
[vncterm.git] / Makefile
1 RELEASE=4.0
2
3 PACKAGE=vncterm
4 # Note: also change version in debian/control and debian/changelog
5 VERSION=1.3
6 PACKAGERELEASE=1
7 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
8 CDATE:=$(shell date +%F)
9
10 VNCVER=0.9.11
11 VNCREL=LibVNCServer-${VNCVER}
12 VNCDIR=libvncserver-${VNCREL}
13 VNCSRC=${VNCREL}.tar.gz
14 VNCLIB=${VNCDIR}/libvncserver/.libs/libvncserver.a
15
16 TIGERVNCSRC=tigervnc-1.1.0.tgz
17 #TIGERVNCSRC=tigervnc-1.2.0.tgz
18
19 DEB=${PACKAGE}_${VERSION}-${PACKAGERELEASE}_${ARCH}.deb
20 SNAP=${PACKAGE}-${VERSION}-${CDATE}.tar.gz
21
22 KEYSTORE=/home/dietmar/pve2-proxdev/proxmox-dev/comodo-for-java.keystore
23
24 all: vncterm
25
26 glyphs.h: genfont
27         ./genfont > glyphs.h.tmp
28         mv glyphs.h.tmp glyphs.h
29
30 genfont: genfont.c
31         gcc -g -O2 -o $@ genfont.c -Wall -D_GNU_SOURCE -lz
32
33 .PHONY: vnc
34 ${VNCLIB} vnc: ${VNCSRC}
35         rm -rf ${VNCDIR}
36         tar xf ${VNCSRC}
37         ln -s ../vncpatches ${VNCDIR}/patches
38         cd ${VNCDIR}; quilt push -a
39         cd ${VNCDIR}; ./autogen.sh --without-ssl --without-websockets --without-tightvnc-filetransfer;
40         cd ${VNCDIR}; make
41
42 vncterm: vncterm.c glyphs.h ${VNCLIB}
43         gcc -O2 -g -o $@ vncterm.c -Wall -Wno-deprecated-declarations -D_GNU_SOURCE -I ${VNCDIR} ${VNCLIB} -lnsl -lpthread -lz -ljpeg -lutil -lgnutls -lpng
44
45 jar: tigervnc.org
46         if test ! -f /usr/share/icedtea-web/plugin.jar; then echo "please install package icedtea-netx-common"; exit 1; fi
47         rm -rf tigervnc VncViewer.jar
48         rsync -av --exclude .svn --exclude .svnignore  tigervnc.org/ tigervnc
49         ln -s ../tigerpatches tigervnc/patches
50         cd tigervnc; quilt push -a
51         cd tigervnc/java/src/com/tigervnc/vncviewer; make clean; make
52         jarsigner -keystore ${KEYSTORE} -signedjar VncViewer.jar  tigervnc/java/src/com/tigervnc/vncviewer/VncViewer.jar "dc475d72-124a-11e4-a53f-005056c00008"
53
54 # this is for version 1.2
55 #       ln -s ../newtigerpatches tigervnc/patches
56 #       cd tigervnc/java;cmake -G "Unix Makefiles"; make
57 #       jarsigner -keystore ${KEYSTORE} -signedjar VncViewer.jar  tigervnc/java/VncViewer.jar proxmox
58
59 tigervnc.org: ${TIGERVNCSRC}
60         rm -rf tigervnc.org
61         tar xf ${TIGERVNCSRC}
62
63 download:
64         rm -rf tigervnc.org
65         svn co https://tigervnc.svn.sourceforge.net/svnroot/tigervnc/tags/1_1_0 tigervnc.org 
66         tar cf ${TIGERVNCSRC} tigervnc.org
67
68 .PHONY: install
69 install: vncterm vncterm.1 VncViewer.jar
70         mkdir -p ${DESTDIR}/usr/share/doc/${PACKAGE}
71         mkdir -p ${DESTDIR}/usr/share/man/man1
72         mkdir -p ${DESTDIR}/usr/bin
73         install -s -m 0755 vncterm ${DESTDIR}/usr/bin
74         mkdir -p ${DESTDIR}/usr/share/vncterm/
75         install -m 0644 VncViewer.jar ${DESTDIR}/usr/share/vncterm/
76
77 .PHONY: dinstall
78 dinstall: ${DEB}
79         dpkg -i ${DEB}
80
81 vncterm.1: vncterm.pod
82         rm -f $@
83         pod2man -n $< -s 1 -r ${VERSION} <$< >$@
84
85 .PHONY: deb
86 deb: $(DEB)
87 ${DEB}:
88         make clean
89         rm -rf dest
90         mkdir dest
91         make DESTDIR=`pwd`/dest install
92         install -d -m 0755 dest/DEBIAN
93         install -m 0644 debian/control dest/DEBIAN
94         echo "Architecture: ${ARCH}" >>dest/DEBIAN/control
95         install -m 0644 debian/conffiles dest/DEBIAN
96         install -m 0644 copyright dest/usr/share/doc/${PACKAGE}
97         install -m 0644 vncterm.1 dest/usr/share/man/man1
98         install -m 0644 debian/changelog.Debian dest/usr/share/doc/${PACKAGE}
99         gzip --best dest/usr/share/man/*/*
100         gzip --best dest/usr/share/doc/${PACKAGE}/changelog.Debian
101         dpkg-deb --build dest
102         mv dest.deb ${DEB}
103         rm -rf dest
104         lintian ${DEB}  
105
106 .PHONY: upload
107 upload: ${DEB}
108         tar cf - ${DEB} | ssh repoman@repo.proxmox.com upload
109
110 .PHONY: clean
111 clean:
112         rm -rf vncterm vncterm.1 vncterm_*.deb tigervnc *~ ${VNCDIR} vncterm-*.tar.gz glyph.h.tmp
113
114 .PHONY: distclean
115 distclean: clean
116         rm -rf tigervnc.org
117
118 .PHONY: dist
119 ${SNAP} dist: distclean
120         rm -rf ../${SNAP}
121         cd ..; tar cvzf ${SNAP} --exclude .svn ${PACKAGE}
122         mv ../${SNAP} ${SNAP}
123
124 .PHONY: uploaddist
125 uploaddist: ${SNAP}
126         scp ${SNAP} pve.proxmox.com:/home/ftp/sources/