/
rules
executable file
·153 lines (131 loc) · 4.89 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
# -*- makefile -*-
#
# Sample debian/rules that uses debhelper.
#
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets by Bill Allombert 2001
# Uncomment this to turn on verbose mode.
DH_VERBOSE = 1
# This has to be exported to make some magic below work.
DH_OPTIONS = -v
DAEMON_USER = bareos
DAEMON_GROUP = bareos
DIRECTOR_DAEMON_USER = $(DAEMON_USER)
STORAGE_DAEMON_USER = $(DAEMON_USER)
FILE_DAEMON_USER = root
STORAGE_DAEMON_GROUP = $(DAEMON_GROUP)
BAREOS_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | sed 's/Version: //g')
define CONFIGURE_COMMON
-DDEBUG_PREFIX_MAP:BOOL=OFF \
-Dsbin-perm=755 \
-Dsbindir=/usr/sbin \
-Dbindir=/usr/bin \
-Dlibdir=/usr/lib/bareos \
-Dsysconfdir=/etc \
-Dconfdir=/etc/bareos \
-Darchivedir=/var/lib/bareos/storage \
-Dbackenddir=/usr/lib/bareos/backends \
-Dconfigtemplatedir=/usr/lib/bareos/defaultconfigs \
-Dscriptdir=/usr/lib/bareos/scripts \
-Dplugindir=/usr/lib/bareos/plugins \
-Dworkingdir=/var/lib/bareos \
-Dpiddir=/var/lib/bareos \
-Dbsrdir=/var/lib/bareos \
-Dlogdir=/var/log/bareos \
-Dsubsysdir=/var/lock \
-Dreadline=yes \
-Dbatch-insert=yes \
-Ddynamic-debian-package-list=yes\
-Ddynamic-cats-backends=yes \
-Ddynamic-storage-backends=yes \
-Dscsi-crypto=yes \
-Dlmdb=yes \
-Dndmp=yes \
-Dipv6=yes \
-Dacl=yes \
-Dxattr=yes \
-Dpostgresql=yes \
-Dmysql=yes \
-Dsqlite3=yes \
-Dopenssl=yes \
-Ddir-user=$(DIRECTOR_DAEMON_USER) \
-Ddir-group=$(DAEMON_GROUP) \
-Dsd-user=$(STORAGE_DAEMON_USER) \
-Dsd-group=$(STORAGE_DAEMON_GROUP) \
-Dfd-user=$(FILE_DAEMON_USER) \
-Dfd-group=$(DAEMON_GROUP) \
-Ddir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
-Dfd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
-Dsd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
-Dmon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
-Dmon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
-Dmon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
-Dbasename="XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX" \
-Dhostname="XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX" \
-Dincludes=yes \
-Drpath=no \
-Ddefault_db_backend="XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" \
-DVERSION_STRING=$(BAREOS_VERSION)
endef
# --docdir="\$(_docdir)/bareos" \
# --htmldir="\$(_docdir)/bareos/html" \
ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
CONFIGURE_COMMON += -Dacl=no -Dxattr=no -Dscsi-crypto=no -Dndmp=no
endif
ifeq ($(DEB_HOST_ARCH_OS),hurd)
CONFIGURE_COMMON += -Dscsi-crypto=no -Dndmp=no
endif
CONFIGURE_CLIENT_ONLY = $(CONFIGURE_COMMON) -Dclient-only=yes
CONFIGURE_FULL = $(CONFIGURE_COMMON) -Dpython=yes -Dtraymonitor=yes -DSHARE_INSTALL_PREFIX:PATH=/usr/share -Dwebuiconfdir=/etc/bareos-webui
override_dh_auto_configure:
@if [ "`lsb_release --short --id`" = "Ubuntu" ] && [ "`lsb_release --short --release`" = "8.04" ]; then \
echo "configure common configuration"; \
dh_auto_configure -- $(CONFIGURE_COMMON); \
else \
echo "configure full configuration"; \
dh_auto_configure -- $(CONFIGURE_FULL); \
fi
override_dh_fixperms:
# all files in /etc/bareos
dh_fixperms \
--exclude etc/bareos/ \
--exclude var/lib/bareos/ \
--exclude var/log/bareos/
override_dh_strip:
dh_strip --dbg-package=bareos-dbg
override_dh_install:
chrpath -d $(CURDIR)/debian/tmp/usr/lib/bareos/backends/libbareoscats-mysql* \
$(CURDIR)/debian/tmp/usr/lib/bareos/backends/libbareoscats-postgresql* \
$(CURDIR)/debian/tmp/usr/lib/bareos/backends/libbareoscats-sqlite3*
dh_install
override_dh_installinit:
dh_installinit --package=bareos-director --name=bareos-dir --no-start
dh_installinit --package=bareos-storage --name=bareos-sd --no-start
dh_installinit --package=bareos-filedaemon --name=bareos-fd
override_dh_makeshlibs:
dh_makeshlibs -n
override_dh_auto_test:
# Only run tests,
# if DEB_BUILD_OPTIONS does not contain nocheck,
# see https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-options
# No tabs allowed before ifeq.
ifneq (nocheck,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
cd obj-x86_64-linux-gnu && make clean && REGRESS_DEBUG=1 ctest -j 10 -V -D Continuous || echo "ctest failed"
else
@echo "ctest: skipped"
endif
override_dh_shlibdeps:
dh_shlibdeps -l$(shell pwd)/debian/tmp/usr/lib/bareos
%:
PARALLEL="--parallel"; \
if [ "`lsb_release --short --id`" = "Ubuntu" ] && [ "`lsb_release --short --release`" = "8.04" ]; then PARALLEL=""; fi; \
if dh --list | grep -q systemd; then WITH="--with"; SYSTEMD="systemd"; fi; \
dh $@ $$PARALLEL $$WITH $$SYSTEMD
gen-debian-copyright:
(cd debian; make copyright)