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