1 include /usr
/share
/dpkg
/pkg-info.mk
2 include /usr
/share
/dpkg
/architecture.mk
5 PACKAGE
=proxmox-offline-mirror
6 BUILDDIR ?
= $(PACKAGE
)-$(DEB_VERSION_UPSTREAM
)
10 DEB
=$(PACKAGE
)_
$(DEB_VERSION_UPSTREAM_REVISION
)_
$(DEB_HOST_ARCH
).deb
11 HELPER_DEB
=$(PACKAGE
)-helper_
$(DEB_VERSION_UPSTREAM_REVISION
)_
$(DEB_HOST_ARCH
).deb
12 DBG_DEB
=$(PACKAGE
)-dbgsym_
$(DEB_VERSION_UPSTREAM_REVISION
)_
$(DEB_HOST_ARCH
).deb
13 HELPER_DBG_DEB
=$(PACKAGE
)-helper-dbgsym_
$(DEB_VERSION_UPSTREAM_REVISION
)_
$(DEB_HOST_ARCH
).deb
14 DOC_DEB
=$(PACKAGE
)-docs_
$(DEB_VERSION_UPSTREAM_REVISION
)_all.deb
15 DSC
=rust-
$(PACKAGE
)_
$(DEB_VERSION_UPSTREAM_REVISION
).dsc
17 DEBS
= $(DEB
) $(HELPER_DEB
) $(DBG_DEB
) $(HELPER_DBG_DEB
) $(DOC_DEB
)
19 ifeq ($(BUILD_MODE
), release
)
20 CARGO_BUILD_ARGS
+= --release
21 COMPILEDIR
:= target
/release
23 COMPILEDIR
:= target
/debug
27 proxmox-offline-mirror \
28 proxmox-offline-mirror-helper
31 $(addprefix $(COMPILEDIR
)/,$(USR_BIN
))
33 all: cargo-build
$(SUBDIRS
)
37 cargo build
$(CARGO_BUILD_ARGS
)
40 $(SUBDIRS
): cargo-build
43 $(COMPILED_BINS
): cargo-build
45 install: $(COMPILED_BINS
)
46 $(MAKE
) -C docs
install DESTDIR
=..
/debian
/proxmox-offline-mirror-docs
47 install -dm755
$(DESTDIR
)$(BINDIR
)
48 $(foreach i
,$(USR_BIN
), \
49 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ;)
51 update-dcontrol
: #$(BUILDDIR)
53 --config debian
/debcargo.toml \
55 --no-overlay-write-back \
56 --directory
$(BUILDDIR
) \
58 $(shell dpkg-parsechangelog
-l debian
/changelog
-SVersion | sed
-e
's/-.*//')
59 cat
$(BUILDDIR
)/debian
/control debian
/control.extra
> debian
/control
60 wrap-and-sort
-t
-k
-f debian
/control
65 rm -rf
$@
$@.tmp
; mkdir
$@.tmp
66 cp
-a src docs debian Cargo.toml Makefile defines.mk
$@.tmp
/
71 $(HELPER_DEB
) $(DBG_DEB
) $(HELPER_DBG_DEB
) $(DOC_DEB
): $(DEB
)
73 cd
$(BUILDDIR
); dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
74 lintian
$(DEB
) $(DOC_DEB
) $(HELPER_DEB
)
78 rm -rf
$(BUILDDIR
) $(DSC
)
82 cd
$(BUILDDIR
); dpkg-buildpackage
-S
-us
-uc
-d
-nc
89 dpkg
-i
$(DEB
) $(DBG_DEB
) $(DOC_DEB
)
92 upload
: UPLOAD_DIST ?
= $(DEB_DISTRIBUTION
)
94 tar cf
- $(DEBS
) | ssh
-X repoman@repo.proxmox.com
-- upload
--product pve
,pmg
,pbs
,pbs-client
--dist $(UPLOAD_DIST
) --arch
$(DEB_HOST_ARCH
)
102 rm -f
*.deb
*.build
*.buildinfo
*.changes
*.dsc rust-
$(PACKAGE
)*.
tar*
103 rm -rf
$(PACKAGE
)-[0-9]*/
104 find .
-name
'*~' -exec
rm {} ';'