forked from rsnapshot/rsnapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
139 lines (117 loc) · 4.95 KB
/
Makefile.am
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
# $Id: Makefile.am,v 1.91 2009/11/21 06:57:00 djk20 Exp $ #
# rsnapshot version
VERSION = 1.3.1.1
# Where RPM files are built on this system
RPM_BASE_DIR = /usr/src/redhat
# update of spec file, within this rsnapshot version
RPM_RELEASE = 1
doc: man html
@echo "Documentation $(man_MANS) and rsnapshot.html are now up to date."
@touch doc
man: $(man_MANS)
rsnapshot.1 : rsnapshot
@# perl 5.8 for this
pod2man -c '' -n 'rsnapshot' -r '' rsnapshot > rsnapshot.1
rsnapshot-diff.1 : rsnapshot-diff
@# perl 5.8 for this
pod2man -c '' -n 'rsnapshot-diff' -r '' rsnapshot-diff > rsnapshot-diff.1
html: rsnapshot.html
rsnapshot.html: rsnapshot
pod2html rsnapshot | grep -v 'link rev' > rsnapshot.html
rm -f pod2htmd.*
rm -f pod2htmi.*
upgrade:
@echo ""
${PERL} rsnapshot-program.pl -c ${sysconfdir}/rsnapshot.conf upgrade-config-file
@echo ""
clean:
rm -rf rsnapshot-$(VERSION)/
rm -rf autom4te.cache
rm -f rsnapshot-$(VERSION).tar.gz
rm -f rsnapshot-$(VERSION)-$(RPM_RELEASE).noarch.rpm
rm -f rsnapshot.conf.default
rm -f rsnapshot.conf.default.in.redhat
rm -f rsnapshot.html
rm -f pod2htmd.*
rm -f pod2htmi.*
rm -f Makefile config.log config.status configure.lineno rsnapshot rsnapshot-diff
-rm -f doc rpm-patch rpm tar
rm -f t/*.t
rm -f t/support/etc/*.conf
rm -f t/support/files/a/{1,2}
rm -rf t/support/snapshots/*.*
rpm-patch: redhat/SOURCES/rsnapshot.patch
@echo
@touch rpm-patch
redhat/SOURCES/rsnapshot.patch: rsnapshot.conf.default.in Makefile
@echo building rpm config file patch $@
cp -p rsnapshot.conf.default.in rsnapshot.conf.default.in.redhat
perl -pi -e 's/^\#\@CMD_CP\@/\@CMD_CP\@/' rsnapshot.conf.default.in.redhat
perl -pi -e 's/^\#\@CMD_DU\@/\@CMD_DU\@/' rsnapshot.conf.default.in.redhat
perl -pi -e 's/^\#logfile/logfile/' rsnapshot.conf.default.in.redhat
perl -pi -e 's/^\#lockfile/lockfile/' rsnapshot.conf.default.in.redhat
perl -pi -e 's%^\#cmd_rsnapshot_diff /usr/local/bin/rsnapshot-diff%cmd_rsnapshot_diff /usr/bin/rsnapshot-diff%' rsnapshot.conf.default.in.redhat
@# diff doesn't return 0
diff -u rsnapshot.conf.default.in rsnapshot.conf.default.in.redhat > redhat/SOURCES/rsnapshot.patch || /bin/true
rm -f rsnapshot.conf.default.in.redhat
rpm: rsnapshot-$(VERSION)-$(RPM_RELEASE).noarch.rpm
@touch rpm
rsnapshot-$(VERSION)-$(RPM_RELEASE).noarch.rpm: tar redhat/SOURCES/rsnapshot.patch redhat/SPECS/rsnapshot.spec
@echo building rpm file $@
@# build rpm file
cp rsnapshot-$(VERSION).tar.gz $(RPM_BASE_DIR)/SOURCES/
cp redhat/SOURCES/rsnapshot.patch $(RPM_BASE_DIR)/SOURCES/
cp redhat/SPECS/rsnapshot.spec $(RPM_BASE_DIR)/SPECS/
rpmbuild -ba $(RPM_BASE_DIR)/SPECS/rsnapshot.spec
cp -p $(RPM_BASE_DIR)/RPMS/noarch/rsnapshot-$(VERSION)-$(RPM_RELEASE).noarch.rpm .
-cp -p $(RPM_BASE_DIR)/SRPMS/rsnapshot-$(VERSION)-$(RPM_RELEASE).src.rpm .
@echo
tar: rsnapshot-$(VERSION).tar.gz
@touch tar
rsnapshot-$(VERSION).tar.gz: $(man_MANS) rpm-patch Makefile $(bin_SCRIPTS) $(sysconf_DATA)
@echo building tar file
@# recommended to run make tar as root for the chown
rm -f rsnapshot-$(VERSION).tar.gz
@# core files
mkdir rsnapshot-$(VERSION)
cp -p rsnapshot-preamble.pl rsnapshot-program.pl rsnapshot-diff.pl rsnapshot.conf.default.in \
$(man_MANS) AUTHORS COPYING INSTALL README TODO NEWS ChangeLog \
rsnapshot-$(VERSION)/
@# documentation files
cp -a docs rsnapshot-$(VERSION)/
@# autoconf files
cp -p Makefile.am Makefile.in aclocal.m4 configure configure.ac config.guess config.sub \
install-sh missing mkinstalldirs rsnapshot-$(VERSION)/
@# redhat
mkdir rsnapshot-$(VERSION)/redhat/
mkdir rsnapshot-$(VERSION)/redhat/SOURCES/
mkdir rsnapshot-$(VERSION)/redhat/SPECS/
cp -p redhat/README rsnapshot-$(VERSION)/redhat/
cp -p redhat/SOURCES/rsnapshot.patch rsnapshot-$(VERSION)/redhat/SOURCES/
cp -p redhat/SPECS/rsnapshot.spec rsnapshot-$(VERSION)/redhat/SPECS/
@# utils
mkdir rsnapshot-$(VERSION)/utils/
cp -p utils/{*.sh,*.pl,README} rsnapshot-$(VERSION)/utils/
cp -p utils/{rsnaptar,rsnapshot-copy} rsnapshot-$(VERSION)/utils/
mkdir rsnapshot-$(VERSION)/utils/rsnapshotdb
cp -p --parents utils/rsnapshotdb/*.* rsnapshot-$(VERSION)/
@# t - testing
mkdir -p rsnapshot-$(VERSION)/t/support/etc
mkdir rsnapshot-$(VERSION)/t/support/files
mkdir rsnapshot-$(VERSION)/t/support/snapshots
cp -a --parents t/*.t.in t/support/etc/*.in t/support/files rsnapshot-$(VERSION)/
@# remove CVS directories from t/support/files and docs.
-find rsnapshot-$(VERSION)/ -depth -name CVS -exec rm -rf {} \;
@# change ownership to root, and delete build dir
-chown -R root:root rsnapshot-$(VERSION)/
tar czf rsnapshot-$(VERSION).tar.gz rsnapshot-$(VERSION)/
rm -rf rsnapshot-$(VERSION)/
@echo
# If you lack GNU make, you could use "test_cases = t/*.t" as an approximation.
test_cases_in := $(wildcard t/*.t.in)
test_cases := $(test_cases_in:%.in=%)
test: rsnapshot $(test_cases)
@PERL@ -MTest::Harness -e 'runtests(glob "t/*.t")';
bin_SCRIPTS = rsnapshot rsnapshot-diff
man_MANS = rsnapshot.1 rsnapshot-diff.1
sysconf_DATA = rsnapshot.conf.default