forked from backuppc/backuppc
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrules
executable file
·153 lines (130 loc) · 4.79 KB
/
rules
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
151
152
153
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
touch configure-stamp
build-arch: build
build-indep: build
build: build-stamp
build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) debian/setuidwrapper.c -o index.cgi
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp index.cgi
# Add here commands to clean up after the build process.
rm -f init.d/*-backuppc*
rm -f backuppc.8*
# Cleanup ./makeDist output
rm -rf dist
# Cleanup buildroot
rm -rf buildroot
dh_clean
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
# Add here commands to install the package into debian/backuppc.
chmod 755 ./makeDist
./makeDist --releasedate "`date +'%d %b %Y'`" --version "4.2.1"
mkdir buildroot
tar -xzf dist/*tar.gz --directory buildroot/ --strip-components=1
# TODO --config-only yes or no?
( cd ./buildroot/; \
chmod 755 ./configure.pl; \
./configure.pl --batch --no-fhs --uid-ignore --hostname XXXXXX \
--bin-path perl=/usr/bin/perl \
--bin-path tar=/bin/tar \
--bin-path smbclient=/usr/bin/smbclient \
--bin-path nmblookup=/usr/bin/nmblookup \
--bin-path rsync=/usr/bin/rsync \
--bin-path ping=/bin/ping \
--bin-path df=/bin/df \
--bin-path ssh=/usr/bin/ssh \
--bin-path sendmail=/usr/sbin/sendmail \
--bin-path hostname=/bin/hostname \
--bin-path split=/usr/bin/split \
--bin-path par2=/usr/bin/par2 \
--bin-path cat=/bin/cat \
--bin-path gzip=/bin/gzip \
--bin-path bzip2=/bin/bzip2 \
--config-dir /etc/backuppc \
--cgi-dir /usr/share/backuppc/cgi-bin \
--data-dir /var/lib/backuppc \
--dest-dir $(CURDIR)/debian/backuppc/ \
--html-dir /usr/share/backuppc/image \
--html-dir-url /backuppc/image \
--install-dir /usr/share/backuppc; \
pod2man --utf8 --section=8 --center="BackupPC manual" doc/BackupPC.pod backuppc.8; \
perl -e "s/.IX Title.*/.SH NAME\nbackuppc \\- BackupPC manual/g" -p -i.tmp backuppc.8; \
)
# TODO Some/most of this is obsolete with the --config-only option!
mv -f debian/backuppc/usr/share/backuppc/cgi-bin/* debian/backuppc/usr/share/backuppc/lib/realindex.cgi
install --mode=755 -D index.cgi debian/backuppc/usr/lib/backuppc/cgi-bin/index.cgi
install --mode=644 -D conf/hosts debian/backuppc/etc/backuppc/hosts
install --mode=644 debian/localhost.pl debian/backuppc/etc/backuppc
install --mode=644 debian/apache.conf debian/backuppc/etc/backuppc
-rm -rf debian/backuppc/var/lib/backuppc/conf/
mkdir -p debian/backuppc/usr/share/backuppc/cgi-bin
(cd debian/backuppc/usr/share/backuppc/cgi-bin; ln -s ../image; ln -s /usr/lib/backuppc/cgi-bin/index.cgi )
patch --no-backup-if-mismatch -p0 < debian/config.pl.diff
mkdir -p debian/backuppc/usr/share/backuppc/conf/
install --mode=644 debian/backuppc/etc/backuppc/config.pl debian/backuppc/usr/share/backuppc/conf/
rm -rf debian/backuppc/etc/backuppc/config.pl debian/backuppc/etc/backuppc/config.pl.sample debian/backuppc/etc/backuppc/hosts.sample
mkdir debian/backuppc/var/lib/backuppc/conf
ln -s /etc/backuppc/config.pl debian/backuppc/var/lib/backuppc/conf/config.pl
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
# dh_installdebconf
dh_installdocs
dh_installexamples debian/examples/*
mv -f debian/backuppc/usr/share/backuppc/share/doc/* debian/backuppc/usr/share/doc/backuppc/
mv debian/backuppc/usr/share/doc/backuppc/BackupPC/* debian/backuppc/usr/share/doc/backuppc/
rmdir debian/backuppc/usr/share/doc/backuppc/BackupPC
mkdir debian/backuppc/usr/share/backuppc/share/doc/BackupPC
(cd debian/backuppc/usr/share/backuppc/share/doc/BackupPC; ln -s ../../../../doc/backuppc/BackupPC.html)
dh_installmenu
dh_installinit
dh_installcron
dh_installman buildroot/backuppc.8
dh_installinfo
# dh_undocumented
dh_installchangelogs ChangeLog
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdebconf
# dh_makeshlibs
dh_installdeb
dh_perl $(CURDIR)/debian/backuppc/usr/share/backuppc/lib/
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure