2 include /usr
/share
/dpkg
/default.mk
5 export PERLMOD_PRODUCT
=PVE
7 ARCH
:=$(shell dpkg-architecture
-qDEB_BUILD_ARCH
)
8 export GITVERSION
:=$(shell git rev-parse HEAD
)
10 PERL_INSTALLVENDORARCH
!= perl
-MConfig
-e
'print $$Config{installvendorarch};'
11 PERL_INSTALLVENDORLIB
!= perl
-MConfig
-e
'print $$Config{installvendorlib};'
13 MAIN_DEB
=${PACKAGE}_
${DEB_VERSION}_
${ARCH}.deb
14 DBGSYM_DEB
=${PACKAGE}-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
15 DEBS
=$(MAIN_DEB
) $(DBGSYM_DEB
)
21 ifeq ($(BUILD_MODE
), release
)
22 CARGO_BUILD_ARGS
+= --release
28 all: PVE Proxmox
/Lib
/PVE.pm
29 ifneq ($(BUILD_MODE
), skip
)
30 cargo build
$(CARGO_BUILD_ARGS
)
31 mkdir
-p
test/Proxmox
/Lib
33 's@^sub libdirs.*$$@sub libdirs { return ("../target/$(TARGET_DIR)", "../../target/$(TARGET_DIR)"); }@' \
34 Proxmox
/Lib
/PVE.pm
>test/Proxmox
/Lib
/PVE.pm
37 PVE
: ..
/scripts
/genpackage.pl
38 perl ..
/scripts
/genpackage.pl PVE \
39 PVE
::RS
::APT
::Repositories \
41 PVE
::RS
::ResourceScheduling
::Static \
44 Proxmox
/Lib
/PVE.pm
: ..
/Proxmox
/Lib
/template.pm
46 $(call package_template
,PVE
,pve_rs
,..
/)
51 # always re-create this dir
52 # but also copy the local target/ and PVE/ dirs as a build-cache
57 rsync
-a debian Makefile Cargo.toml Cargo.lock src target PVE build
/
60 install: ..
/target
/release
/libpve_rs.so Proxmox
/Lib
/PVE.pm PVE
61 install -d
-m755
$(DESTDIR
)$(PERL_INSTALLVENDORARCH
)/auto
62 install -m644 ..
/target
/release
/libpve_rs.so
$(DESTDIR
)$(PERL_INSTALLVENDORARCH
)/auto
/libpve_rs.so
63 install -d
-m755
$(DESTDIR
)$(PERL_INSTALLVENDORLIB
)
64 install -d
-m755
$(DESTDIR
)$(PERL_INSTALLVENDORLIB
)/Proxmox
/Lib
65 install -m644 Proxmox
/Lib
/PVE.pm
$(DESTDIR
)$(PERL_INSTALLVENDORLIB
)/Proxmox
/Lib
/PVE.pm
66 find
$(PM_DIR
) \
! -type d
-print -exec
install -Dm644
'{}' $(DESTDIR
)$(PERL_INSTALLVENDORLIB
)'/{}' ';'
71 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
78 rm -rf
*.deb
*.dsc
*.
tar.gz
*.buildinfo
*.changes Cargo.lock build
79 find .
-name
'*~' -exec
rm {} ';'
87 # check if working directory is clean
88 git diff
--exit-code
--stat
&& git diff
--exit-code
--stat
--staged
89 tar cf
- ${DEBS} | ssh
-X repoman@repo.proxmox.com upload
--product pve
--dist bullseye