2024-02-29 20:47:01 +03:00
#include /usr/share/dpkg/default.mk
2011-08-23 16:11:04 +02:00
i n c l u d e d e f i n e s . m k
2024-02-09 12:04:07 +01:00
export PVERELEASE = $( shell echo $( DEB_VERSION_UPSTREAM) | cut -d. -f1-2)
2023-05-29 18:15:11 +02:00
export VERSION = $( DEB_VERSION_UPSTREAM_REVISION)
2017-06-09 09:55:24 +02:00
2023-05-29 15:32:58 +02:00
BUILDDIR = $( PACKAGE) -$( DEB_VERSION_UPSTREAM)
2011-08-23 16:11:04 +02:00
2023-05-29 15:33:38 +02:00
DSC = $( PACKAGE) _$( DEB_VERSION) .dsc
2023-05-29 15:32:58 +02:00
DEB = $( PACKAGE) _$( DEB_VERSION) _$( DEB_HOST_ARCH) .deb
2011-08-23 16:11:04 +02:00
2023-07-03 13:17:18 +02:00
DESTDIR =
2024-05-21 15:31:48 +02:00
SUBDIRS = aplinfo PVE bin www services configs network-hooks test templates
2023-07-03 13:17:18 +02:00
2023-05-29 14:11:36 +02:00
all : $( SUBDIRS )
set -e && for i in $( SUBDIRS) ; do $( MAKE) -C $$ i; done
2011-08-23 16:11:04 +02:00
2018-10-17 13:02:05 +02:00
.PHONY : check
2021-05-19 16:56:50 +02:00
check : bin test www
2023-05-29 14:11:36 +02:00
$( MAKE) -C bin check
$( MAKE) -C test check
$( MAKE) -C www check
2012-12-28 12:50:13 +01:00
2023-07-03 13:17:18 +02:00
GITVERSION := $( shell git rev-parse --short= 16 HEAD)
2023-05-29 15:32:58 +02:00
$(BUILDDIR) :
rm -rf $@ $@ .tmp
mkdir $@ .tmp
rsync -a * $@ .tmp
echo " git clone git://git.proxmox.com/git/pve-manager.git\\ngit checkout $( GITVERSION) " > $@ .tmp/debian/SOURCE
echo " REPOID_GENERATED= $( GITVERSION) " > $@ .tmp/debian/rules.env
mv $@ .tmp $@
2011-08-23 16:11:04 +02:00
2023-05-29 15:33:38 +02:00
.PHONY : deb dsc
2017-02-07 15:38:33 +01:00
deb : $( DEB )
2023-05-29 15:32:58 +02:00
$(DEB) : $( BUILDDIR )
cd $( BUILDDIR) ; dpkg-buildpackage -b -us -uc
2023-05-29 14:11:36 +02:00
lintian $( DEB)
2011-08-23 16:11:04 +02:00
2023-05-29 15:33:38 +02:00
dsc :
rm -rf $( BUILDDIR) $( DSC)
$( MAKE) $( DSC)
lintian $( DSC)
$(DSC) : $( BUILDDIR )
cd $( BUILDDIR) ; dpkg-buildpackage -S -us -uc -d
sbuild : $( DSC )
sbuild $<
2011-08-23 16:11:04 +02:00
.PHONY : upload
2023-05-29 18:23:40 +02:00
upload : UPLOAD_DIST ?= $( DEB_DISTRIBUTION )
upload : $( DEB )
tar cf - $( DEB) | ssh -X repoman@repo.proxmox.com upload --product pve --dist $( UPLOAD_DIST)
2011-08-23 16:11:04 +02:00
.PHONY : install
2018-06-20 12:47:02 +02:00
install : vzdump -hook -script .pl
2024-02-05 19:52:00 +03:00
install -d -m 0700 $( DESTDIR) /var/log/pveproxy
2023-05-29 14:11:36 +02:00
install -d $( DOCDIR) /examples
install -d $( DESTDIR) /var/lib/$( PACKAGE)
install -d $( DESTDIR) /var/lib/vz/images
install -d $( DESTDIR) /var/lib/vz/template/cache
install -d $( DESTDIR) /var/lib/vz/template/iso
install -m 0644 vzdump-hook-script.pl $( DOCDIR) /examples/vzdump-hook-script.pl
install -m 0644 spice-example-sh $( DOCDIR) /examples/spice-example-sh
set -e && for i in $( SUBDIRS) ; do $( MAKE) -C $$ i $@ ; done
2011-08-23 16:11:04 +02:00
.PHONY : distclean
distclean : clean
.PHONY : clean
clean :
2023-05-29 14:11:36 +02:00
set -e && for i in $( SUBDIRS) ; do $( MAKE) -C $$ i $@ ; done
2023-05-29 15:33:38 +02:00
rm -f $( PACKAGE) *.tar* country.dat *.deb *.dsc *.build *.buildinfo *.changes
2023-05-29 15:32:58 +02:00
rm -rf dest $( PACKAGE) -[ 0-9] */
2023-07-03 13:17:18 +02:00
.PHONY : dinstall
dinstall : $( DEB )
dpkg -i $( DEB)