forked from mdevctl/mdevctl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
55 lines (48 loc) · 1.82 KB
/
Makefile.in
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
@@generated_notice@@
PREFIX?=/usr
UDEVDIR=$(shell pkg-config --variable=udevdir udev)
SBINDIR=$(PREFIX)/sbin
CONFDIR=/etc/mdevctl.d
SCRIPTDIR=$(PREFIX)/lib/mdevctl/scripts.d
CALLOUTS_DIR=$(SCRIPTDIR)/callouts
NOTIFIERS_DIR=$(SCRIPTDIR)/notifiers
DATADIR=$(PREFIX)/share
MANDIR=$(DATADIR)/man
BASH_COMPLETION_DIR=$(DATADIR)/bash-completion/completions
all:
@echo "Run 'make install' to install the program"
# since we generate a Makefile, we have to use --no-verify to stop cargo from
# complaining that we modified the source directory during build.
archive:
cargo package --allow-dirty --no-verify
cargo vendor
tar -caf target/package/mdevctl-@@mdevctl_version@@-vendor.crate vendor/
mdevctl.spec: mdevctl.spec.in
cargo build
srpm: mdevctl.spec archive
rpmbuild -bs --define "_sourcedir $(PWD)/target/package" \
--define "_specdir $(PWD)" \
--define "_builddir $(PWD)" \
--define "_srcrpmdir $(PWD)" \
--define "_rpmdir $(PWD)" $<
rpm: mdevctl.spec archive
rpmbuild -bb --define "_sourcedir $(PWD)/target/package" \
--define "_specdir $(PWD)" \
--define "_builddir $(PWD)" \
--define "_srcrpmdir $(PWD)" \
--define "_rpmdir $(PWD)" $<
install:
mkdir -p $(DESTDIR)$(CONFDIR)
mkdir -p $(DESTDIR)$(UDEVDIR)/rules.d/
install -m 644 60-mdevctl.rules $(DESTDIR)$(UDEVDIR)/rules.d/
mkdir -p $(DESTDIR)$(SBINDIR)
install -m 755 @@mdevctl@@ $(DESTDIR)$(SBINDIR)/
ln -sf mdevctl $(DESTDIR)$(SBINDIR)/lsmdev
mkdir -p $(DESTDIR)$(MANDIR)/man8
install -m 644 @@outdir@@/mdevctl.8 $(DESTDIR)$(MANDIR)/man8/
ln -sf mdevctl.8 $(DESTDIR)$(MANDIR)/man8/lsmdev.8
mkdir -p $(DESTDIR)$(BASH_COMPLETION_DIR)/
install -m 644 -T @@outdir@@/mdevctl.bash $(DESTDIR)$(BASH_COMPLETION_DIR)/mdevctl
install -m 644 -T @@outdir@@/lsmdev.bash $(DESTDIR)$(BASH_COMPLETION_DIR)/lsmdev
mkdir -p $(DESTDIR)$(CALLOUTS_DIR)
mkdir -p $(DESTDIR)$(NOTIFIERS_DIR)