-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
63 lines (53 loc) · 1.61 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
include /usr/share/dpkg/pkg-info.mk
SRCPACKAGE=rust-pathpatterns
PACKAGE=lib$(SRCPACKAGE)-dev
ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
DEB=$(PACKAGE)_$(DEB_VERSION)_$(ARCH).deb
DSC=$(SRCPACKAGE)_$(DEB_VERSION)_$(ARCH).deb
.PHONY: all
all: check
.PHONY: check
check:
cargo test
.PHONY: dinstall
dinstall: deb
sudo -k dpkg -i build/librust-*.deb
build:
rm -rf build
rm debian/control
mkdir build
debcargo package \
--config "$(PWD)/debian/debcargo.toml" \
--changelog-ready \
--no-overlay-write-back \
--directory "$(PWD)/build/pathpatterns" \
"pathpatterns" \
"$$(dpkg-parsechangelog -l "debian/changelog" -SVersion | sed -e 's/-.*//')"
echo system >build/rust-toolchain
rm -f build/pathpatterns/Cargo.lock
find build/pathpatterns/debian -name '*.hint' -delete
cp build/pathpatterns/debian/control debian/control
.PHONY: deb
deb:
rm -rf build
$(MAKE) build/$(DEB)
build/$(DEB): build
(cd build/pathpatterns && CARGO=/usr/bin/cargo RUSTC=/usr/bin/rustc dpkg-buildpackage -b -uc -us)
lintian build/*.deb
.PHONY: dsc
dsc:
rm -rf build
$(MAKE) build/$(DSC)
build/$(DSC): build
(cd build/pathpatterns && CARGO=/usr/bin/cargo RUSTC=/usr/bin/rustc dpkg-buildpackage -S -uc -us)
lintian build/*.dsc
.PHONY: clean
clean:
rm -rf build *.deb *.dsc *.buildinfo *.changes *.orig.tar.gz
cargo clean
.PHONY: upload
upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
upload: build/$(DEB)
# check if working directory is clean
git diff --exit-code --stat && git diff --exit-code --stat --staged
tar -C build -cf - $(DEB) | ssh -X [email protected] upload --product devel --dist $(DEB_DISTRIBUTION)