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