forked from openSUSE/openSUSE-release-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (34 loc) · 2.05 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
SUBDIRS = factory-package-news abichecker
include Makefile.common
pkgdata_BINS = $(shell find * -maxdepth 0 -executable -type f)
pkgdata_SCRIPTS=$(wildcard *.py *.pl *.sh)
pkgdata_SCRIPTS+=bs_mirrorfull findfileconflicts publish_distro
pkgdata_DATA+=bs_copy metrics osclib pkglistgen $(wildcard *.pm *.testcase)
VERSION = "build-$(shell date +%F)"
all:
install:
install -d -m 755 $(DESTDIR)$(bindir) $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(unitdir) $(DESTDIR)$(oscplugindir) $(DESTDIR)$(sysconfdir)/$(package_name) $(DESTDIR)$(grafana_provisioning_dir)/dashboards $(DESTDIR)$(grafana_provisioning_dir)/datasources
for i in $(pkgdata_SCRIPTS); do install -m 755 $$i $(DESTDIR)$(pkgdatadir); done
chmod 644 $(DESTDIR)$(pkgdatadir)/osc-*.py
for i in $(pkgdata_DATA); do cp -a $$i $(DESTDIR)$(pkgdatadir); done
for i in osc-*.py osclib; do ln -s $(pkgdatadir)/$$i $(DESTDIR)$(oscplugindir)/$$i; done
for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
install -m 644 systemd/* $(DESTDIR)$(unitdir)
sed -i "s/VERSION = .*/VERSION = '$(VERSION)'/" \
$(DESTDIR)$(pkgdatadir)/osclib/common.py
for i in $(pkgdata_BINS); do ln -s $(pkgdatadir)/$$i $(DESTDIR)$(bindir)/osrt-$${i%.*}; done
ln -s $(pkgdatadir)/metrics/access/aggregate.php $(DESTDIR)$(bindir)/osrt-metrics-access-aggregate
ln -s $(pkgdatadir)/metrics/access/ingest.php $(DESTDIR)$(bindir)/osrt-metrics-access-ingest
cp -R config/* $(DESTDIR)$(sysconfdir)/$(package_name)
for dir in dashboards datasources ; do ln -s $(pkgdatadir)/metrics/grafana/provisioning/$$dir.yaml \
$(DESTDIR)$(grafana_provisioning_dir)/$$dir/$(package_name).yaml ; done
sed -i "s|OSRT_DATA_DIR|$(pkgdatadir)|" \
$(DESTDIR)$(pkgdatadir)/metrics/grafana/provisioning/dashboards.yaml \
$(DESTDIR)$(unitdir)/osrt-metrics-telegraf.service
package:
touch dist/package/$(package_name).changes
tar -cJf dist/package/$(package_name)-0.tar.xz --exclude=.git* --exclude=dist/package/*.tar.xz --transform 's,^\.,$(package_name)-0,' .
package-clean:
rm -f dist/package/$(package_name).changes
rm -f dist/package/$(package_name).tar.xz
.PHONY: all install