2019-05-22 20:42:09 +03:00
i n c l u d e / u s r / s h a r e / d p k g / p k g - i n f o . m k
i n c l u d e / u s r / s h a r e / d p k g / a r c h i t e c t u r e . m k
2011-08-23 09:52:28 +04:00
PACKAGE = vncterm
2023-05-29 18:49:38 +03:00
BUILDDIR ?= $( PACKAGE) -$( DEB_VERSION_UPSTREAM)
2017-05-24 12:37:48 +03:00
GITVERSION := $( shell cat .git/refs/heads/master)
2011-08-23 09:52:28 +04:00
2023-05-29 18:14:55 +03:00
VNCVER = 0.9.14
2023-05-29 18:18:56 +03:00
VNCREL = LibVNCServer-$( VNCVER)
VNCDIR = libvncserver-$( VNCREL)
VNCSRC = $( VNCREL) .tar.gz
VNCLIB = $( VNCDIR) /libvncserver.a
2011-08-23 09:52:28 +04:00
2023-05-29 18:49:53 +03:00
DSC = $( PACKAGE) _$( DEB_VERSION) .dsc
2023-05-29 18:19:31 +03:00
DEB = $( PACKAGE) _$( DEB_VERSION) _$( DEB_HOST_ARCH) .deb
DBG_DEB = $( PACKAGE) -dbgysm_$( DEB_VERSION) _$( DEB_HOST_ARCH) .deb
2011-08-23 09:52:28 +04:00
2018-05-30 14:58:13 +03:00
CPPFLAGS += -O2 -g -Wall -Wno-deprecated-declarations -D_GNU_SOURCE -I $( VNCDIR)
VNC_LIBS := -lnsl -lpthread -lz -ljpeg -lutil -lgnutls -lpng
2011-08-23 09:52:28 +04:00
all : vncterm
2017-05-24 12:37:50 +03:00
font.data : genfont 2
./genfont2 -o font.data.tmp -i /usr/share/unifont/unifont.hex
mv font.data.tmp font.data
genfont2 : genfont 2.c
gcc -g -O2 -o $@ genfont2.c -Wall -Wextra -D_GNU_SOURCE -lz
2011-08-23 09:52:28 +04:00
.PHONY : vnc
2023-05-29 18:18:56 +03:00
vnc : $( VNCLIB )
$(VNCLIB) : $( VNCSRC )
rm -rf $( VNCDIR)
tar xf $( VNCSRC)
ln -s ../vncpatches $( VNCDIR) /patches
cd $( VNCDIR) ; quilt push -a
cd $( VNCDIR) ; cmake -D WITH_GNUTLS = OFF -D WITH_OPENSSL = OFF -D WITH_WEBSOCKETS = OFF -D WITH_SYSTEMD = OFF -D WITH_TIGHTVNC_FILETRANSFER = OFF -D WITH_GCRYPT = OFF -D WITH_LZO = OFF -D BUILD_SHARED_LIBS = OFF .; cmake --build .
2011-08-23 09:52:28 +04:00
2018-05-30 14:58:13 +03:00
vncterm : vncterm .c wchardata .c $( VNCLIB )
$( CC) $( CPPFLAGS) $( CFLAGS) -o $@ $^ $( VNC_LIBS)
2011-08-23 09:52:28 +04:00
2017-05-24 12:37:51 +03:00
wchardata.c :
cp /usr/share/unifont/$@ $@
2011-08-23 09:52:28 +04:00
.PHONY : install
2017-05-24 12:37:51 +03:00
install : vncterm vncterm .1 font .data
2023-05-29 18:18:56 +03:00
mkdir -p $( DESTDIR) /usr/share/$( PACKAGE)
install -m 0644 font.data $( DESTDIR) /usr/share/$( PACKAGE)
mkdir -p $( DESTDIR) /usr/share/man/man1
install -m 0644 vncterm.1 $( DESTDIR) /usr/share/man/man1
mkdir -p $( DESTDIR) /usr/bin
install -m 0755 vncterm $( DESTDIR) /usr/bin
2011-08-23 09:52:28 +04:00
.PHONY : dinstall
2023-05-29 18:18:56 +03:00
dinstall : $( DEB )
dpkg -i $( DEB)
2011-08-23 09:52:28 +04:00
vncterm.1 : vncterm .pod
rm -f $@
2023-05-29 18:18:56 +03:00
pod2man -n $< -s 1 -r $( DEB_VERSION_UPSTREAM) <$< >$@
2011-08-23 09:52:28 +04:00
2023-05-29 18:49:38 +03:00
$(BUILDDIR) :
rm -rf $@ $@ .tmp
rsync -a . $@ .tmp
echo " git clone git://git.proxmox.com/git/vncterm.git\\ngit checkout $( GIVERSION) " > $@ .tmp/debian/SOURCE
mv $@ .tmp $@
2011-08-23 09:52:28 +04:00
.PHONY : deb
2017-02-07 17:42:24 +03:00
deb : $( DEB )
2023-05-29 18:49:38 +03:00
$(DEB) : $( BUILDDIR )
cd $( BUILDDIR) ; dpkg-buildpackage -rfakeroot -b -us -uc
2023-05-29 18:18:56 +03:00
lintian $( DEB)
2011-08-23 09:52:28 +04:00
2023-05-29 18:49:53 +03:00
.PHONY : dsc
dsc : $( DSC )
rm -rf $( BUILDDIR) $( DSC)
$( MAKE) $( DSC)
lintian $( DSC)
$(DSC) : $( BUILDDIR )
cd $( BUILDDIR) ; dpkg-buildpackage -S -us -uc
sbuild : $( DSC )
sbuild $<
2011-08-23 09:52:28 +04:00
.PHONY : upload
2023-05-29 18:18:56 +03:00
upload : $( DEB )
tar cf - $( DEB) $( DBG_DEB) | ssh -X repoman@repo.proxmox.com -- upload --product pve --dist bullseye
2011-08-23 09:52:28 +04:00
.PHONY : clean
clean :
2023-05-29 18:49:53 +03:00
rm -f *.dsc *.deb $( PACKAGE) *.tar* *.changes *.build *.buildinfo
rm -f vncterm vncterm.1 genfont genfont2 *~ *.tmp wchardata.c font.data
rm -rf $( VNCDIR) $( PACKAGE) -[ 0-9] */
2011-08-23 09:52:28 +04:00
.PHONY : distclean
distclean : clean