build: use repoman for uploading
[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         make clean
88         rm -rf dest
89         mkdir dest
90         make DESTDIR=`pwd`/dest install
91         install -d -m 0755 dest/DEBIAN
92         install -m 0644 debian/control dest/DEBIAN
93         echo "Architecture: ${ARCH}" >>dest/DEBIAN/control
94         install -m 0644 debian/conffiles dest/DEBIAN
95         install -m 0644 copyright dest/usr/share/doc/${PACKAGE}
96         install -m 0644 vncterm.1 dest/usr/share/man/man1
97         install -m 0644 debian/changelog.Debian dest/usr/share/doc/${PACKAGE}
98         gzip --best dest/usr/share/man/*/*
99         gzip --best dest/usr/share/doc/${PACKAGE}/changelog.Debian
100         dpkg-deb --build dest
101         mv dest.deb ${DEB}
102         rm -rf dest
103         lintian ${DEB}  
104
105 .PHONY: upload
106 upload: ${DEB}
107         tar cf - ${DEB} | ssh repoman@repo.proxmox.com upload
108
109 .PHONY: clean
110 clean:
111         rm -rf vncterm vncterm.1 vncterm_*.deb tigervnc *~ ${VNCDIR} vncterm-*.tar.gz glyph.h.tmp
112
113 .PHONY: distclean
114 distclean: clean
115         rm -rf tigervnc.org
116
117 .PHONY: dist
118 ${SNAP} dist: distclean
119         rm -rf ../${SNAP}
120         cd ..; tar cvzf ${SNAP} --exclude .svn ${PACKAGE}
121         mv ../${SNAP} ${SNAP}
122
123 .PHONY: uploaddist
124 uploaddist: ${SNAP}
125         scp ${SNAP} pve.proxmox.com:/home/ftp/sources/