bump version to 1.1-7
[vncterm.git] / Makefile
1 RELEASE=3.2
2
3 PACKAGE=vncterm
4 # Note: also change version in debian/control and debian/changelog
5 VERSION=1.1
6 PACKAGERELEASE=7
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/comodo-for-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 server solutions gmbh's comodo ca limited id"
51
52 # this is for version 1.2
53 #       ln -s ../newtigerpatches tigervnc/patches
54 #       cd tigervnc/java;cmake -G "Unix Makefiles"; make
55 #       jarsigner -keystore ${KEYSTORE} -signedjar VncViewer.jar  tigervnc/java/VncViewer.jar proxmox
56
57 tigervnc.org: ${TIGERVNCSRC}
58         rm -rf tigervnc.org
59         tar xf ${TIGERVNCSRC}
60
61 download:
62         rm -rf tigervnc.org
63         svn co https://tigervnc.svn.sourceforge.net/svnroot/tigervnc/tags/1_1_0 tigervnc.org 
64         tar cf ${TIGERVNCSRC} tigervnc.org
65
66 .PHONY: install
67 install: vncterm vncterm.1 VncViewer.jar
68         mkdir -p ${DESTDIR}/usr/share/doc/${PACKAGE}
69         mkdir -p ${DESTDIR}/usr/share/man/man1
70         mkdir -p ${DESTDIR}/usr/bin
71         install -s -m 0755 vncterm ${DESTDIR}/usr/bin
72         mkdir -p ${DESTDIR}/usr/share/vncterm/
73         install -m 0644 VncViewer.jar ${DESTDIR}/usr/share/vncterm/
74
75 .PHONY: dinstall
76 dinstall: ${DEB}
77         dpkg -i ${DEB}
78
79 vncterm.1: vncterm.pod
80         rm -f $@
81         pod2man -n $< -s 1 -r ${VERSION} <$< >$@
82
83 .PHONY: deb
84 ${DEB} deb:
85         make clean
86         rm -rf dest
87         mkdir dest
88         make DESTDIR=`pwd`/dest install
89         install -d -m 0755 dest/DEBIAN
90         install -m 0644 debian/control dest/DEBIAN
91         echo "Architecture: ${ARCH}" >>dest/DEBIAN/control
92         install -m 0644 debian/conffiles dest/DEBIAN
93         install -m 0644 copyright dest/usr/share/doc/${PACKAGE}
94         install -m 0644 vncterm.1 dest/usr/share/man/man1
95         install -m 0644 debian/changelog.Debian dest/usr/share/doc/${PACKAGE}
96         gzip --best dest/usr/share/man/*/*
97         gzip --best dest/usr/share/doc/${PACKAGE}/changelog.Debian
98         dpkg-deb --build dest
99         mv dest.deb ${DEB}
100         rm -rf dest
101         lintian ${DEB}  
102
103 .PHONY: upload
104 upload: ${DEB}
105         umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw 
106         mkdir -p /pve/${RELEASE}/extra
107         rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
108         rm -f /pve/${RELEASE}/extra/Packages*
109         cp ${DEB} /pve/${RELEASE}/extra
110         cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
111         umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
112
113 .PHONY: clean
114 clean:
115         rm -rf vncterm vncterm.1 vncterm_*.deb tigervnc *~ ${VNCDIR} vncterm-*.tar.gz
116
117 .PHONY: distclean
118 distclean: clean
119         rm -rf tigervnc.org
120
121 .PHONY: dist
122 ${SNAP} dist: distclean
123         rm -rf ../${SNAP}
124         cd ..; tar cvzf ${SNAP} --exclude .svn ${PACKAGE}
125         mv ../${SNAP} ${SNAP}
126
127 .PHONY: uploaddist
128 uploaddist: ${SNAP}
129         scp ${SNAP} pve.proxmox.com:/home/ftp/sources/