1dd7f69f |
1 | #!/usr/bin/make -f |
2 | |
3 | CC = gcc |
4 | CFLAGS = -Wall -g |
5 | |
6 | bindir = /usr/sbin |
7 | mandir = /usr/share/man |
8 | sysconfdir = /etc |
9 | destdir = $(CURDIR)/debian/prometheus |
10 | docdir = /usr/share/doc |
11 | |
12 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
13 | CFLAGS += -O0 |
14 | else |
15 | CFLAGS += -O2 |
16 | endif |
17 | |
18 | build: build-stamp |
19 | |
20 | build-stamp: |
21 | dh_testdir |
22 | $(CC) -o $(CURDIR)/prometheus $(CURDIR)/prometheus.c |
23 | # $(CC) -o $(CURDIR)/prometheus-monthly-stats $(CURDIR)/optional-tools/monthly-stats.c |
24 | |
25 | touch $@ |
26 | |
27 | clean: clean-dir |
28 | |
29 | clean-dir: |
30 | dh_testdir |
31 | dh_testroot |
32 | rm -f build-stamp |
33 | make clean |
34 | dh_clean |
35 | |
36 | |
37 | install: build |
38 | dh_testdir |
39 | dh_testroot |
40 | dh_clean -k |
41 | dh_installdirs |
42 | install -m 755 -o root -g root $(CURDIR)/prometheus $(destdir)$(bindir) |
43 | # install -m 755 -o root -g root $(CURDIR)prometheus-monthly-stats $(destdir)$(bindir) |
44 | install -m 644 -o root -g root $(CURDIR)/prometheus.1 $(destdir)$(mandir)/man1 |
45 | install -m 644 -o root -g root $(CURDIR)/prometheus.conf.5 $(destdir)$(mandir)/man5 |
46 | install -m 755 -o root -g root $(CURDIR)/conf/prometheus.init $(destdir)$(sysconfdir)/init.d/prometheus |
47 | install -m 644 -o root -g root $(CURDIR)/conf/prometheus.default $(destdir)$(sysconfdir)/default/prometheus |
48 | install -m 755 -o root -g root $(CURDIR)/conf/prometheus.cron $(destdir)$(sysconfdir)/cron.d/prometheus |
49 | install -m 600 -o root -g root $(CURDIR)/conf/prometheus.hosts $(destdir)$(sysconfdir)/prometheus/hosts |
50 | install -m 600 -o root -g root $(CURDIR)/conf/prometheus.conf $(destdir)$(sysconfdir)/prometheus/prometheus.conf |
51 | install -m 700 -o root -g root $(CURDIR)/check-kernel-qos $(destdir)$(sysconfdir)/prometheus |
52 | install -m 644 -o root -g root $(CURDIR)/README $(destdir)$(docdir)/prometheus |
53 | install -m 644 -o root -g root $(CURDIR)/CHANGELOG $(destdir)$(docdir)/prometheus |
54 | |
55 | # Build architecture-dependent files here. |
56 | binary-arch: build install |
57 | dh_testdir |
58 | dh_testroot |
59 | dh_installchangelogs CHANGELOG |
60 | # dh_installdocs |
61 | # dh_installexamples |
62 | # dh_install |
63 | # dh_installmenu |
64 | # dh_installdebconf |
65 | # dh_installlogrotate |
66 | # dh_installemacsen |
67 | # dh_installpam |
68 | # dh_installmime |
69 | # dh_python |
70 | # dh_installinit |
71 | # dh_installcron |
72 | # dh_installinfo |
73 | # dh_installman |
74 | dh_link |
75 | dh_strip |
76 | dh_compress |
77 | dh_fixperms |
78 | # dh_perl |
79 | # dh_makeshlibs |
80 | dh_installdeb |
81 | # dh_shlibdeps |
82 | dh_gencontrol |
83 | dh_md5sums |
84 | dh_builddeb |
85 | |
86 | binary: binary-arch |
87 | .PHONY: build clean binary-arch binary install |