-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
150 lines (127 loc) · 6 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# Nothing for you here! This is simply for me, so that I'll can do some
# general CVS stuff easily.
DATE := $(shell date +"%b %e %Y")
TMPDIR := $(shell tempfile)
# ---------------------------------
BIND9_VERSION := $(shell cat bind9/.version | sed 's@\ .*@@')
BIND9_INSTDIR := bind9-snmp-$(BIND9_VERSION)
BACULA_VERSION := $(shell cat bacula/.version | sed 's@\ .*@@')
BACULA_INSTDIR := bacula-snmp-$(BACULA_VERSION)
SYSTEM_VERSION := $(shell cat system/.version | sed 's@\ .*@@')
SYSTEM_INSTDIR := system-snmp-$(SYSTEM_VERSION)
PACKAGE_VERSION := $(shell cat package/.version | sed 's@\ .*@@')
PACKAGE_INSTDIR := package-snmp-$(PACKAGE_VERSION)
ZFS_VERSION := $(shell cat zfs/.version | sed 's@\ .*@@')
ZFS_INSTDIR := zfs-snmp-$(PACKAGE_VERSION)
# ---------------------------------
$(BIND9_INSTDIR):
@(if [ -f $(TMPDIR) ]; then \
rm -f $(TMPDIR); \
fi; \
mkdir -p $(TMPDIR)/$(BIND9_INSTDIR); \
echo "Instdir: "$(TMPDIR)/$(BIND9_INSTDIR))
$(BACULA_INSTDIR):
@(if [ -f $(TMPDIR) ]; then \
rm -f $(TMPDIR); \
fi; \
mkdir -p $(TMPDIR)/$(BACULA_INSTDIR); \
echo "Instdir: "$(TMPDIR)/$(BACULA_INSTDIR))
$(SYSTEM_INSTDIR):
@(if [ -f $(TMPDIR) ]; then \
rm -f $(TMPDIR); \
fi; \
mkdir -p $(TMPDIR)/$(SYSTEM_INSTDIR); \
echo "Instdir: "$(TMPDIR)/$(SYSTEM_INSTDIR))
$(PACKAGE_INSTDIR):
@(if [ -f $(TMPDIR) ]; then \
rm -f $(TMPDIR); \
fi; \
mkdir -p $(TMPDIR)/$(PACKAGE_INSTDIR); \
echo "Instdir: "$(TMPDIR)/$(PACKAGE_INSTDIR))
$(ZFS_INSTDIR):
@(if [ -f $(TMPDIR) ]; then \
rm -f $(TMPDIR); \
fi; \
mkdir -p $(TMPDIR)/$(ZFS_INSTDIR); \
echo "Instdir: "$(TMPDIR)/$(ZFS_INSTDIR))
# ---------------------------------
bind9_tarball: $(BIND9_INSTDIR)
@(cp BAYOUR-COM-MIB.txt BayourCOM_SNMP.pm $(TMPDIR)/$(BIND9_INSTDIR)/; \
cp bind9/bind9-snmp-stats.pl $(TMPDIR)/$(BIND9_INSTDIR)/; \
cp bind9/bind9-stats*.xml $(TMPDIR)/$(BIND9_INSTDIR)/; \
cp bind9/cacti_host_template_bind9_snmp_machine.xml $(TMPDIR)/$(BIND9_INSTDIR)/; \
cp bind9/{README,UPGRADE}.txt bind9/snmp*.stub $(TMPDIR)/$(BIND9_INSTDIR)/; \
cd $(TMPDIR)/; \
tar czf bind9-snmp_$(BIND9_VERSION).tgz `find $(BIND9_INSTDIR) -type f`; \
tar cjf bind9-snmp_$(BIND9_VERSION).tar.bz2 `find $(BIND9_INSTDIR) -type f`; \
zip bind9-snmp_$(BIND9_VERSION).zip `find $(BIND9_INSTDIR) -type f` > /dev/null)
bind9_changes:
@(echo "Date: $(DATE)"; \
cat bind9/CHANGES | sed "s@TO BE ANNOUNCED@Release \($(DATE)\)@" > bind9/CHANGES.new; \
mv bind9/CHANGES.new bind9/CHANGES; \
cvs commit -m "New release - $(BIND9_VERSION)" bind9/CHANGES)
# ---------------------------------
bacula_tarball: $(BACULA_INSTDIR)
@(cp BAYOUR-COM-MIB.txt BayourCOM_SNMP.pm $(TMPDIR)/$(BACULA_INSTDIR)/; \
cp bacula/bacula-snmp-stats.pl $(TMPDIR)/$(BACULA_INSTDIR)/; \
cp bacula/bacula-stats*.xml $(TMPDIR)/$(BACULA_INSTDIR)/; \
cp bacula/cacti_data_query_snmp_local_bacula_statistics_*.xml $(TMPDIR)/$(BACULA_INSTDIR)/; \
cp bacula/snmp*.stub $(TMPDIR)/$(BACULA_INSTDIR)/; \
cd $(TMPDIR); \
tar czf bacula-snmp_$(BACULA_VERSION).tgz `find $(BACULA_INSTDIR) -type f`; \
tar cjf bacula-snmp_$(BACULA_VERSION).tar.bz2 `find $(BACULA_INSTDIR) -type f`; \
zip bacula-snmp_$(BACULA_VERSION).zip `find $(BACULA_INSTDIR) -type f` > /dev/null)
bacula_changes:
@(echo "Date: $(DATE)"; \
cat bacula/CHANGES | sed "s@TO BE ANNOUNCED@Release \($(DATE)\)@" > bacula/CHANGES.new; \
mv bacula/CHANGES.new bacula/CHANGES; \
cvs commit -m "New release - $(BACULA_VERSION)" bacula/CHANGES)
# ---------------------------------
system_tarball: $(SYSTEM_INSTDIR)
@(cp BAYOUR-COM-MIB.txt BayourCOM_SNMP.pm $(TMPDIR)/$(SYSTEM_INSTDIR)/; \
cp system/system-snmp-stats.pl $(TMPDIR)/$(SYSTEM_INSTDIR)/; \
cp system/snmp*.stub $(TMPDIR)/$(SYSTEM_INSTDIR)/; \
cd $(TMPDIR); \
tar czf system-snmp_$(SYSTEM_VERSION).tgz `find $(SYSTEM_INSTDIR) -type f`; \
tar cjf system-snmp_$(SYSTEM_VERSION).tar.bz2 `find $(SYSTEM_INSTDIR) -type f`; \
zip system-snmp_$(SYSTEM_VERSION).zip `find $(SYSTEM_INSTDIR) -type f` > /dev/null)
system_changes:
@(echo "Date: $(DATE)"; \
cat system/CHANGES | sed "s@TO BE ANNOUNCED@Release \($(DATE)\)@" > system/CHANGES.new; \
mv system/CHANGES.new system/CHANGES; \
cvs commit -m "New release - $(SYSTEM_VERSION)" system/CHANGES)
# ---------------------------------
package_tarball: $(PACKAGE_INSTDIR)
@(cp BAYOUR-COM-MIB.txt BayourCOM_SNMP.pm $(TMPDIR)/$(PACKAGE_INSTDIR)/; \
cp package/package-snmp-stats.pl $(TMPDIR)/$(PACKAGE_INSTDIR)/; \
cp package/snmp*.stub $(TMPDIR)/$(PACKAGE_INSTDIR)/; \
cd $(TMPDIR); \
tar czf package-snmp_$(PACKAGE_VERSION).tgz `find $(PACKAGE_INSTDIR) -type f`; \
tar cjf package-snmp_$(PACKAGE_VERSION).tar.bz2 `find $(PACKAGE_INSTDIR) -type f`; \
zip package-snmp_$(PACKAGE_VERSION).zip `find $(PACKAGE_INSTDIR) -type f` > /dev/null)
package_changes:
@(echo "Date: $(DATE)"; \
cat package/CHANGES | sed "s@TO BE ANNOUNCED@Release \($(DATE)\)@" > package/CHANGES.new; \
mv package/CHANGES.new package/CHANGES; \
cvs commit -m "New release - $(PACKAGE_VERSION)" package/CHANGES)
# ---------------------------------
zfs_tarball: $(ZFS_INSTDIR)
@(cp BAYOUR-COM-MIB.txt BayourCOM_SNMP.pm $(TMPDIR)/$(ZFS_INSTDIR)/; \
cp zfs/zfs-snmp-stats.pl $(TMPDIR)/$(ZFS_INSTDIR)/; \
cp zfs/snmp*.stub $(TMPDIR)/$(ZFS_INSTDIR)/; \
cd $(TMPDIR); \
tar czf zfs-snmp_$(ZFS_VERSION).tgz `find $(ZFS_INSTDIR) -type f`; \
tar cjf zfs-snmp_$(ZFS_VERSION).tar.bz2 `find $(ZFS_INSTDIR) -type f`; \
zip zfs-snmp_$(ZFS_VERSION).zip `find $(ZFS_INSTDIR) -type f` > /dev/null)
zfs_changes:
@(echo "Date: $(DATE)"; \
cat zfs/CHANGES | sed "s@TO BE ANNOUNCED@Release \($(DATE)\)@" > zfs/CHANGES.new; \
mv zfs/CHANGES.new zfs/CHANGES; \
cvs commit -m "New release - $(ZFS_VERSION)" zfs/CHANGES)
# ---------------------------------
check_mib:
# Bug in the tool - Ignore: 'warning: index element.*should be not-accessible in SMIv2 MIB'
smilint BAYOUR-COM-MIB.txt
clean:
@(find -name '*~' -o -name '.*~' -o -name '.#*' -o -name '#*' | \
xargs --no-run-if-empty rm)