imported from svn 'vncterm/pve2'
[vncterm.git] / Makefile
1 RELEASE=2.0
2
3 PACKAGE=vncterm
4 VERSION=1.0
5 PACKAGERELEASE=1
6 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
7 CDATE:=$(shell date +%F)
8
9 VNCVER=0.9.7
10 VNCDIR=LibVNCServer-${VNCVER}
11 VNCSRC=${VNCDIR}.tar.gz
12 VNCLIB=${VNCDIR}/libvncserver/.libs/libvncserver.a
13
14 TIGERVNCSRC=tigervnc-1.1.0.tgz
15
16 DEB=${PACKAGE}_${VERSION}-${PACKAGERELEASE}_${ARCH}.deb
17 SNAP=${PACKAGE}-${VERSION}-${CDATE}.tar.gz
18
19 KEYSTORE=/home/dietmar/pve2-proxdev/proxmox-dev/proxmox-java.keystore
20
21 all: vncterm
22
23 glyphs.h: genfont
24         ./genfont > glyphs.h
25
26 genfont: genfont.c
27         gcc -g -O2 -o $@ genfont.c -Wall -D_GNU_SOURCE -lz
28
29 .PHONY: vnc
30 ${VNCLIB} vnc: ${VNCSRC}
31         rm -rf ${VNCDIR}
32         tar xf ${VNCSRC}
33         ln -s ../vncpatches ${VNCDIR}/patches
34         cd ${VNCDIR}; quilt push -a
35         cd ${VNCDIR}; ./configure; 
36         cd ${VNCDIR}; make
37
38 vncterm: vncterm.c glyphs.h ${VNCLIB}
39         gcc -O2 -g -o $@ vncterm.c -Wall -D_GNU_SOURCE -I ${VNCDIR} ${VNCLIB} -lnsl -lpthread -lz -ljpeg -lutil -lgnutls
40
41 jar: tigervnc.org
42         rm -rf tigervnc VncViewer.jar
43         rsync -av --exclude .svn --exclude .svnignore  tigervnc.org/ tigervnc
44         ln -s ../tigerpatches tigervnc/patches
45         cd tigervnc; quilt push -a
46         cd tigervnc/java/src/com/tigervnc/vncviewer; make clean; make
47         jarsigner -keystore ${KEYSTORE} -signedjar VncViewer.jar  tigervnc/java/src/com/tigervnc/vncviewer/VncViewer.jar proxmox
48
49 tigervnc.org: ${TIGERVNCSRC}
50         rm -rf tigervnc.org
51         tar xf ${TIGERVNCSRC}
52
53 downlaod:
54         rm -rf tigervnc.org
55         svn co https://tigervnc.svn.sourceforge.net/svnroot/tigervnc/tags/1_1_0 tigervnc.org 
56         tar cf ${TIGERVNCSRC} tigervnc.org
57
58 .PHONY: install
59 install: vncterm vncterm.1 VncViewer.jar
60         mkdir -p ${DESTDIR}/usr/share/doc/${PACKAGE}
61         mkdir -p ${DESTDIR}/usr/share/man/man1
62         mkdir -p ${DESTDIR}/usr/bin
63         install -s -m 0755 vncterm ${DESTDIR}/usr/bin
64         mkdir -p ${DESTDIR}/usr/share/vncterm/
65         install -m 0644 VncViewer.jar ${DESTDIR}/usr/share/vncterm/
66
67 .PHONY: dinstall
68 dinstall: ${DEB}
69         dpkg -i ${DEB}
70
71 vncterm.1: vncterm.pod
72         rm -f $@
73         pod2man -n $< -s 1 -r ${VERSION} <$< >$@
74
75 .PHONY: deb
76 ${DEB} deb:
77         make clean
78         rm -rf dest
79         mkdir dest
80         make DESTDIR=`pwd`/dest install
81         install -d -m 0755 dest/DEBIAN
82         install -m 0644 debian/control dest/DEBIAN
83         echo "Architecture: ${ARCH}" >>dest/DEBIAN/control
84         install -m 0644 debian/conffiles dest/DEBIAN
85         install -m 0644 copyright dest/usr/share/doc/${PACKAGE}
86         install -m 0644 vncterm.1 dest/usr/share/man/man1
87         install -m 0644 debian/changelog.Debian dest/usr/share/doc/${PACKAGE}
88         gzip --best dest/usr/share/man/*/*
89         gzip --best dest/usr/share/doc/${PACKAGE}/changelog.Debian
90         dpkg-deb --build dest
91         mv dest.deb ${DEB}
92         rm -rf dest
93         lintian ${DEB}  
94
95 .PHONY: upload
96 upload: ${DEB}
97         umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw 
98         mkdir -p /pve/${RELEASE}/extra
99         rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
100         rm -f /pve/${RELEASE}/extra/Packages*
101         cp ${DEB} /pve/${RELEASE}/extra
102         cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
103         umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
104
105 .PHONY: clean
106 clean:
107         rm -rf vncterm vncterm.1 vncterm_*.deb tigervnc *~ ${VNCDIR} vncterm-*.tar.gz
108
109 .PHONY: distclean
110 distclean: clean
111         rm -rf tigervnc.org
112
113 .PHONY: dist
114 ${SNAP} dist: distclean
115         rm -rf ../${SNAP}
116         cd ..; tar cvzf ${SNAP} --exclude .svn ${PACKAGE}
117         mv ../${SNAP} ${SNAP}
118
119 .PHONY: uploaddist
120 uploaddist: ${SNAP}
121         scp ${SNAP} pve.proxmox.com:/home/ftp/sources/