File: rules

package info (click to toggle)
shorewall 5.2.8-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 46,136 kB
  • sloc: xml: 78,818; perl: 26,961; sh: 6,033; makefile: 131
file content (174 lines) | stat: -rwxr-xr-x 7,077 bytes parent folder | download
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

SHOREWALLRC = $(CURDIR)/debian/shorewallrc

SRCDIR_SRWL       = $(CURDIR)/shorewall
SRCDIR_SRWL6      = $(CURDIR)/shorewall6
SRCDIR_SRWL6LITE  = $(CURDIR)/shorewall6-lite
SRCDIR_SRWLCORE   = $(CURDIR)/shorewall-core
SRCDIR_SRWLDOC    = $(CURDIR)/shorewall-docs-xml
SRCDIR_SRWLINIT   = $(CURDIR)/shorewall-init
SRCDIR_SRWLLITE   = $(CURDIR)/shorewall-lite
DESTDIR_SRWL      = $(CURDIR)/debian/shorewall
DESTDIR_SRWL6     = $(CURDIR)/debian/shorewall6
DESTDIR_SRWL6LITE = $(CURDIR)/debian/shorewall6-lite
DESTDIR_SRWLCORE  = $(CURDIR)/debian/shorewall-core
DESTDIR_SRWLDOC   = $(CURDIR)/debian/shorewall-doc
DESTDIR_SRWLINIT  = $(CURDIR)/debian/shorewall-init
DESTDIR_SRWLLITE  = $(CURDIR)/debian/shorewall-lite

BINARY_PACKAGES := $(shell dh_listpackages)

%:
	dh $@

ifneq ($(filter shorewall-doc,$(BINARY_PACKAGES)),)
override_dh_auto_build:
	sh debian/build-htmldocs
endif

ifneq ($(filter shorewall-doc,$(BINARY_PACKAGES)),)
override_dh_auto_clean:
	rm -fr shorewall-docs-xml/html
	rm -fr shorewall-docs-xml/manpages/*.html
endif

override_dh_install: install_shorewall       \
                     install_shorewall6      \
                     install_shorewall6_lite \
                     install_shorewall_core  \
                     install_shorewall_doc   \
                     install_shorewall_init  \
                     install_shorewall_lite

install_shorewall:
	DESTDIR=$(DESTDIR_SRWL) $(SRCDIR_SRWL)/install.sh $(SHOREWALLRC)
	rmdir $(DESTDIR_SRWL)/sbin
	rmdir $(DESTDIR_SRWL)/usr/share/shorewall/deprecated

install_shorewall6:
	DESTDIR=$(DESTDIR_SRWL6) $(SRCDIR_SRWL6)/install.sh $(SHOREWALLRC)
	rmdir $(DESTDIR_SRWL6)/usr/share/shorewall/Shorewall
	rmdir $(DESTDIR_SRWL6)/usr/share/shorewall
	rmdir $(DESTDIR_SRWL6)/usr/share/shorewall6/deprecated/

install_shorewall6_lite:
	DESTDIR=$(DESTDIR_SRWL6LITE) $(SRCDIR_SRWL6LITE)/install.sh $(SHOREWALLRC)

install_shorewall_core:
	DESTDIR=$(DESTDIR_SRWLCORE) $(SRCDIR_SRWLCORE)/install.sh $(SHOREWALLRC)
	find $(DESTDIR_SRWLCORE) -type d -empty -delete

install_shorewall_doc:
ifneq ($(filter shorewall-doc,$(BINARY_PACKAGES)),)
	install -m0755 -d $(DESTDIR_SRWLDOC)/usr/share/doc/shorewall-doc/html
	install -m0755 -d $(DESTDIR_SRWLDOC)/usr/share/doc/shorewall-doc/html/images
	install -m0755 -d $(DESTDIR_SRWLDOC)/usr/share/doc/shorewall-doc/manpages
	install $(SRCDIR_SRWLDOC)/html/*     $(DESTDIR_SRWLDOC)/usr/share/doc/shorewall-doc/html
	install $(SRCDIR_SRWLDOC)/images/*   $(DESTDIR_SRWLDOC)/usr/share/doc/shorewall-doc/html/images
	install $(SRCDIR_SRWLDOC)/manpages/* $(DESTDIR_SRWLDOC)/usr/share/doc/shorewall-doc/manpages
endif

install_shorewall_init:
	DESTDIR=$(DESTDIR_SRWLINIT) $(SRCDIR_SRWLINIT)/install.sh $(SHOREWALLRC)

install_shorewall_lite:
	DESTDIR=$(DESTDIR_SRWLLITE) $(SRCDIR_SRWLLITE)/install.sh $(SHOREWALLRC)

override_dh_installinit:
	dh_installinit -pshorewall       --only-scripts --no-enable --no-start
	dh_installinit -pshorewall6      --only-scripts --no-enable --no-start
	dh_installinit -pshorewall6-lite --only-scripts --no-enable --no-start
	dh_installinit -pshorewall-init  --only-scripts --no-enable --no-start
	dh_installinit -pshorewall-lite  --only-scripts --no-enable --no-start

override_dh_installsystemd:
	dh_installsystemd -pshorewall       --no-stop-on-upgrade --no-enable --no-start
	dh_installsystemd -pshorewall6      --no-stop-on-upgrade --no-enable --no-start
	dh_installsystemd -pshorewall6-lite --no-stop-on-upgrade --no-enable --no-start
	dh_installsystemd -pshorewall-init  --no-stop-on-upgrade --no-enable --no-start
	dh_installsystemd -pshorewall-lite  --no-stop-on-upgrade --no-enable --no-start

override_dh_fixperms: fixperms_shorewall       \
                      fixperms_shorewall6      \
                      fixperms_shorewall6_lite \
                      fixperms_shorewall_lite
	dh_fixperms -pshorewall                \
	            -Xetc/shorewall            \
	            -Xvar/lib/shorewall
	dh_fixperms -pshorewall6               \
	            -Xetc/shorewall6           \
	            -Xvar/lib/shorewall6
	dh_fixperms -pshorewall6-lite          \
	            -Xetc/shorewall6-lite      \
	            -Xvar/lib/shorewall6-lite
	dh_fixperms -pshorewall-core
ifneq ($(filter shorewall-doc,$(BINARY_PACKAGES)),)
	dh_fixperms -pshorewall-doc
endif
	dh_fixperms -pshorewall-init
	dh_fixperms -pshorewall-lite           \
	            -Xetc/shorewall-lite       \
	            -Xvar/lib/shorewall-lite

fixperms_shorewall:
	# Temporary zones are only available to root
	chmod 750 $(DESTDIR_SRWL)/var/lib/shorewall
	# By default, configuration is not world-readable
	chmod 640 $(DESTDIR_SRWL)/etc/shorewall/*
	# These should not be executable
	chmod 644 $(DESTDIR_SRWL)/etc/shorewall/shorewall.conf
	if [ -f $(DESTDIR_SRWL)/etc/shorewall/Makefile ] ; then chmod 644 $(DESTDIR_SRWL)/etc/shorewall/Makefile ; fi
	# Global configuration has to be fully readable
	chmod 644 $(DESTDIR_SRWL)/usr/share/shorewall/*
	chmod 755 $(DESTDIR_SRWL)/usr/share/shorewall/compiler.pl
	chmod 755 $(DESTDIR_SRWL)/usr/share/shorewall/getparams
	chmod 755 $(DESTDIR_SRWL)/usr/share/shorewall/Shorewall/
	chmod 755 $(DESTDIR_SRWL)/usr/share/shorewall/configfiles/

fixperms_shorewall6:
	# Temporary zones are only available to root
	chmod 750 $(DESTDIR_SRWL6)/var/lib/shorewall6
	# By default, configuration is not world-readable
	chmod 640 $(DESTDIR_SRWL6)/etc/shorewall6/*
	# These should not be executable
	chmod 644 $(DESTDIR_SRWL6)/etc/shorewall6/shorewall6.conf
	if [ -f $(DESTDIR_SRWL6)/etc/shorewall6/Makefile ] ; then chmod 644 $(DESTDIR_SRWL6)/etc/shorewall6/Makefile ; fi
	# Global configuration has to be fully readable
	chmod 644 $(DESTDIR_SRWL6)/usr/share/shorewall6/*
	chmod 755 $(DESTDIR_SRWL6)/usr/share/shorewall6/configfiles/

fixperms_shorewall6_lite:
	# Temporary zones are only available to root
	chmod 750 $(DESTDIR_SRWL6LITE)/var/lib/shorewall6-lite
	# These should not be executable
	chmod 644 $(DESTDIR_SRWL6LITE)/etc/shorewall6-lite/shorewall6-lite.conf
	# Global configuration has to be fully readable
	chmod 644 $(DESTDIR_SRWL6LITE)/usr/share/shorewall6-lite/*
	# Must be executable
	chmod 755 $(DESTDIR_SRWL6LITE)/usr/share/shorewall6-lite/shorecap

fixperms_shorewall_lite:
	# Temporary zones are only available to root
	chmod 750 $(DESTDIR_SRWLLITE)/var/lib/shorewall-lite
	# These should not be executable
	chmod 644 $(DESTDIR_SRWLLITE)/etc/shorewall-lite/shorewall-lite.conf
	# Global configuration has to be fully readable
	chmod 644 $(DESTDIR_SRWLLITE)/usr/share/shorewall-lite/*
	# Must be executable
	chmod 755 $(DESTDIR_SRWLLITE)/usr/share/shorewall-lite/shorecap

.PHONY: install_shorewall        \
        install_shorewall6       \
        install_shorewall6_lite  \
        install_shorewall_core   \
        install_shorewall_doc    \
        install_shorewall_init   \
        fixperms_shorewall       \
        fixperms_shorewall6      \
        fixperms_shorewall6_lite \
        fixperms_shorewall_lite