419ee662bd979f1ca87870a882a4222437814eb8
[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=4
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         if test ! -f /usr/share/icedtea-web/plugin.jar; then echo "please install package icedtea-netx-common"; exit 1; fi
45         rm -rf tigervnc VncViewer.jar
46         rsync -av --exclude .svn --exclude .svnignore  tigervnc.org/ tigervnc
47         ln -s ../tigerpatches tigervnc/patches
48         cd tigervnc; quilt push -a
49         cd tigervnc/java/src/com/tigervnc/vncviewer; make clean; make
50         jarsigner -keystore ${KEYSTORE} -signedjar VncViewer.jar  tigervnc/java/src/com/tigervnc/vncviewer/VncViewer.jar proxmox
51 # this is for version 1.2
52 #       ln -s ../newtigerpatches tigervnc/patches
53 #       cd tigervnc/java;cmake -G "Unix Makefiles"; make
54 #       jarsigner -keystore ${KEYSTORE} -signedjar VncViewer.jar  tigervnc/java/VncViewer.jar proxmox
55
56 tigervnc.org: ${TIGERVNCSRC}
57         rm -rf tigervnc.org
58         tar xf ${TIGERVNCSRC}
59
60 download:
61         rm -rf tigervnc.org
62         svn co https://tigervnc.svn.sourceforge.net/svnroot/tigervnc/tags/1_1_0 tigervnc.org 
63         tar cf ${TIGERVNCSRC} tigervnc.org
64
65 .PHONY: install
66 install: vncterm vncterm.1 VncViewer.jar
67         mkdir -p ${DESTDIR}/usr/share/doc/${PACKAGE}
68         mkdir -p ${DESTDIR}/usr/share/man/man1
69         mkdir -p ${DESTDIR}/usr/bin
70         install -s -m 0755 vncterm ${DESTDIR}/usr/bin
71         mkdir -p ${DESTDIR}/usr/share/vncterm/
72         install -m 0644 VncViewer.jar ${DESTDIR}/usr/share/vncterm/
73
74 .PHONY: dinstall
75 dinstall: ${DEB}
76         dpkg -i ${DEB}
77
78 vncterm.1: vncterm.pod
79         rm -f $@
80         pod2man -n $< -s 1 -r ${VERSION} <$< >$@
81
82 .PHONY: deb
83 ${DEB} deb:
84         make clean
85         rm -rf dest
86         mkdir dest
87         make DESTDIR=`pwd`/dest install
88         install -d -m 0755 dest/DEBIAN
89         install -m 0644 debian/control dest/DEBIAN
90         echo "Architecture: ${ARCH}" >>dest/DEBIAN/control
91         install -m 0644 debian/conffiles dest/DEBIAN
92         install -m 0644 copyright dest/usr/share/doc/${PACKAGE}
93         install -m 0644 vncterm.1 dest/usr/share/man/man1
94         install -m 0644 debian/changelog.Debian dest/usr/share/doc/${PACKAGE}
95         gzip --best dest/usr/share/man/*/*
96         gzip --best dest/usr/share/doc/${PACKAGE}/changelog.Debian
97         dpkg-deb --build dest
98         mv dest.deb ${DEB}
99         rm -rf dest
100         lintian ${DEB}  
101
102 .PHONY: upload
103 upload: ${DEB}
104         umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw 
105         mkdir -p /pve/${RELEASE}/extra
106         rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
107         rm -f /pve/${RELEASE}/extra/Packages*
108         cp ${DEB} /pve/${RELEASE}/extra
109         cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
110         umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
111
112 .PHONY: clean
113 clean:
114         rm -rf vncterm vncterm.1 vncterm_*.deb tigervnc *~ ${VNCDIR} vncterm-*.tar.gz
115
116 .PHONY: distclean
117 distclean: clean
118         rm -rf tigervnc.org
119
120 .PHONY: dist
121 ${SNAP} dist: distclean
122         rm -rf ../${SNAP}
123         cd ..; tar cvzf ${SNAP} --exclude .svn ${PACKAGE}
124         mv ../${SNAP} ${SNAP}
125
126 .PHONY: uploaddist
127 uploaddist: ${SNAP}
128         scp ${SNAP} pve.proxmox.com:/home/ftp/sources/