remove java applet
[vncterm.git] / Makefile
1 PACKAGE=vncterm
2 # Note: also change version in debian/control and debian/changelog
3 VERSION=1.4
4 PACKAGERELEASE=1
5 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
6 CDATE:=$(shell date +%F)
7
8 VNCVER=0.9.11
9 VNCREL=LibVNCServer-${VNCVER}
10 VNCDIR=libvncserver-${VNCREL}
11 VNCSRC=${VNCREL}.tar.gz
12 VNCLIB=${VNCDIR}/libvncserver/.libs/libvncserver.a
13
14 DEB=${PACKAGE}_${VERSION}-${PACKAGERELEASE}_${ARCH}.deb
15 SNAP=${PACKAGE}-${VERSION}-${CDATE}.tar.gz
16
17 all: vncterm
18
19 glyphs.h: genfont
20         ./genfont > glyphs.h.tmp
21         mv glyphs.h.tmp glyphs.h
22
23 genfont: genfont.c
24         gcc -g -O2 -o $@ genfont.c -Wall -D_GNU_SOURCE -lz
25
26 .PHONY: vnc
27 ${VNCLIB} vnc: ${VNCSRC}
28         rm -rf ${VNCDIR}
29         tar xf ${VNCSRC}
30         ln -s ../vncpatches ${VNCDIR}/patches
31         cd ${VNCDIR}; quilt push -a
32         cd ${VNCDIR}; ./autogen.sh --without-ssl --without-websockets --without-tightvnc-filetransfer;
33         cd ${VNCDIR}; make
34
35 vncterm: vncterm.c glyphs.h ${VNCLIB}
36         gcc -O2 -g -o $@ vncterm.c -Wall -Wno-deprecated-declarations -D_GNU_SOURCE -I ${VNCDIR} ${VNCLIB} -lnsl -lpthread -lz -ljpeg -lutil -lgnutls -lpng
37
38
39 .PHONY: install
40 install: vncterm vncterm.1
41         mkdir -p ${DESTDIR}/usr/share/doc/${PACKAGE}
42         mkdir -p ${DESTDIR}/usr/share/man/man1
43         mkdir -p ${DESTDIR}/usr/bin
44         install -s -m 0755 vncterm ${DESTDIR}/usr/bin
45
46 .PHONY: dinstall
47 dinstall: ${DEB}
48         dpkg -i ${DEB}
49
50 vncterm.1: vncterm.pod
51         rm -f $@
52         pod2man -n $< -s 1 -r ${VERSION} <$< >$@
53
54 .PHONY: deb
55 deb: $(DEB)
56 ${DEB}:
57         make clean
58         rm -rf dest
59         mkdir dest
60         make DESTDIR=`pwd`/dest install
61         install -d -m 0755 dest/DEBIAN
62         install -m 0644 debian/control dest/DEBIAN
63         echo "Architecture: ${ARCH}" >>dest/DEBIAN/control
64         install -m 0644 debian/conffiles dest/DEBIAN
65         install -m 0644 copyright dest/usr/share/doc/${PACKAGE}
66         install -m 0644 vncterm.1 dest/usr/share/man/man1
67         install -m 0644 debian/changelog.Debian dest/usr/share/doc/${PACKAGE}
68         gzip -n --best dest/usr/share/man/*/*
69         gzip -n --best dest/usr/share/doc/${PACKAGE}/changelog.Debian
70         fakeroot dpkg-deb --build dest
71         mv dest.deb ${DEB}
72         rm -rf dest
73         lintian ${DEB}  
74
75 .PHONY: upload
76 upload: ${DEB}
77         tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pmg,pve --dist stretch
78
79 .PHONY: clean
80 clean:
81         rm -rf vncterm vncterm.1 vncterm_*.deb genfont *~ ${VNCDIR} vncterm-*.tar.gz glyph.h.tmp
82
83 .PHONY: distclean
84 distclean: clean
85
86 .PHONY: dist
87 ${SNAP} dist: distclean
88         rm -rf ../${SNAP}
89         cd ..; tar cvzf ${SNAP} --exclude .svn ${PACKAGE}
90         mv ../${SNAP} ${SNAP}
91
92 .PHONY: uploaddist
93 uploaddist: ${SNAP}
94         scp ${SNAP} pve.proxmox.com:/home/ftp/sources/