2016-06-06 17:24:53 +03:00
PACKAGE = vncterm
# Note: also change version in debian/control and debian/changelog
2017-07-19 10:39:44 +03:00
VERSION = 1.5
PACKAGERELEASE = 2
2016-06-06 17:24:53 +03:00
ARCH := $( shell dpkg-architecture -qDEB_BUILD_ARCH)
2017-07-19 10:39:44 +03:00
GITVERSION := $( shell cat .git/refs/heads/master)
2016-06-06 17:24:53 +03:00
CDATE := $( shell date +%F)
2017-07-19 10:39:44 +03:00
VNCVER = 0.9.11
VNCREL = LibVNCServer-${ VNCVER }
VNCDIR = libvncserver-${ VNCREL }
VNCSRC = ${ VNCREL } .tar.gz
2016-06-06 17:24:53 +03:00
VNCLIB = ${ VNCDIR } /libvncserver/.libs/libvncserver.a
DEB = ${ PACKAGE } _${ VERSION } -${ PACKAGERELEASE } _${ ARCH } .deb
SNAP = ${ PACKAGE } -${ VERSION } -${ CDATE } .tar.gz
all : vncterm
2017-07-19 10:39:44 +03:00
font.data : genfont 2
./genfont2 -o font.data.tmp -i /usr/share/unifont/unifont.hex
mv font.data.tmp font.data
2016-06-06 17:24:53 +03:00
2017-07-19 10:39:44 +03:00
genfont2 : genfont 2.c
gcc -g -O2 -o $@ genfont2.c -Wall -Wextra -D_GNU_SOURCE -lz
2016-06-06 17:24:53 +03:00
.PHONY : vnc
2017-07-19 10:39:44 +03:00
vnc : ${VNCLIB }
${VNCLIB} : ${VNCSRC }
2016-06-06 17:24:53 +03:00
rm -rf ${ VNCDIR }
tar xf ${ VNCSRC }
ln -s ../vncpatches ${ VNCDIR } /patches
cd ${ VNCDIR } ; quilt push -a
2017-07-19 10:39:44 +03:00
cd ${ VNCDIR } ; ./autogen.sh --without-ssl --without-websockets --without-tightvnc-filetransfer;
cd ${ VNCDIR } ; $( MAKE)
vncterm : vncterm .c ${VNCLIB } wchardata .c
gcc -O2 -g -o $@ vncterm.c wchardata.c -Wall -Wno-deprecated-declarations -D_GNU_SOURCE -I ${ VNCDIR } ${ VNCLIB } -lnsl -lpthread -lz -ljpeg -lutil -lgnutls -lpng
wchardata.c :
cp /usr/share/unifont/$@ $@
2016-06-06 17:24:53 +03:00
.PHONY : install
2017-07-19 10:39:44 +03:00
install : vncterm vncterm .1 font .data
2016-06-06 17:24:53 +03:00
mkdir -p ${ DESTDIR } /usr/share/doc/${ PACKAGE }
2017-07-19 10:39:44 +03:00
install -m 0644 copyright ${ DESTDIR } /usr/share/doc/${ PACKAGE }
mkdir -p ${ DESTDIR } /usr/share/${ PACKAGE }
install -m 0644 font.data ${ DESTDIR } /usr/share/${ PACKAGE }
2016-06-06 17:24:53 +03:00
mkdir -p ${ DESTDIR } /usr/share/man/man1
2017-07-19 10:39:44 +03:00
install -m 0644 vncterm.1 ${ DESTDIR } /usr/share/man/man1
2016-06-06 17:24:53 +03:00
mkdir -p ${ DESTDIR } /usr/bin
install -s -m 0755 vncterm ${ DESTDIR } /usr/bin
.PHONY : dinstall
dinstall : ${DEB }
dpkg -i ${ DEB }
vncterm.1 : vncterm .pod
rm -f $@
pod2man -n $< -s 1 -r ${ VERSION } <$< >$@
.PHONY : deb
2017-07-19 10:39:44 +03:00
deb : $( DEB )
${DEB} :
$( MAKE) clean
rsync -a . --exclude build build
echo " Architecture: ${ ARCH } " >> build/debian/control
echo " git clone git://git.proxmox.com/git/vncterm.git\\ngit checkout ${ GIVERSION } " > build/debian/SOURCE
cd build; dpkg-buildpackage -rfakeroot -b -us -uc
2016-06-06 17:24:53 +03:00
lintian ${ DEB }
.PHONY : upload
upload : ${DEB }
2017-07-19 10:39:44 +03:00
tar cf - ${ DEB } | ssh -X repoman@repo.proxmox.com -- upload --product pmg,pve --dist stretch
2016-06-06 17:24:53 +03:00
.PHONY : clean
clean :
2017-07-19 10:39:44 +03:00
rm -rf vncterm vncterm.1 vncterm_*.deb genfont genfont2 *~ ${ VNCDIR } vncterm-*.tar.gz glyph.h.tmp build *.changes wchardata.c font.data.tmp font.data *.buildinfo
2016-06-06 17:24:53 +03:00
.PHONY : distclean
distclean : clean
.PHONY : dist
${SNAP} dist : distclean
rm -rf ../${ SNAP }
cd ..; tar cvzf ${ SNAP } --exclude .svn ${ PACKAGE }
mv ../${ SNAP } ${ SNAP }
.PHONY : uploaddist
uploaddist : ${SNAP }
scp ${ SNAP } pve.proxmox.com:/home/ftp/sources/