aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2024-05-29 21:27:50 +0000
committerLibravatar GitHub <noreply@github.com>2024-05-29 21:27:50 +0000
commitabc6996cc5993fc3e6cc8835d0c2eddb8aa9c14d (patch)
treed3417697b69c1af51b39c2152a2dd65274380aad
parentprofiles: libreoffice: support signing documents with GPG (#6353) (diff)
parentbuild: allow overriding common tools (diff)
downloadfirejail-abc6996cc5993fc3e6cc8835d0c2eddb8aa9c14d.tar.gz
firejail-abc6996cc5993fc3e6cc8835d0c2eddb8aa9c14d.tar.zst
firejail-abc6996cc5993fc3e6cc8835d0c2eddb8aa9c14d.zip
Merge pull request #6354 from kmk3/build-tool-vars
build: allow overriding common tools
-rw-r--r--Makefile149
-rw-r--r--config.mk.in3
-rwxr-xr-xconfigure144
-rw-r--r--configure.ac3
-rw-r--r--src/bash_completion/Makefile7
-rw-r--r--src/man/Makefile10
-rw-r--r--src/prog.mk5
-rw-r--r--src/so.mk5
-rw-r--r--src/zsh_completion/Makefile7
-rw-r--r--test/Makefile22
10 files changed, 265 insertions, 90 deletions
diff --git a/Makefile b/Makefile
index 12d0d57a5..575c3882b 100644
--- a/Makefile
+++ b/Makefile
@@ -2,12 +2,19 @@
2ROOT = . 2ROOT = .
3-include config.mk 3-include config.mk
4 4
5# Default programs 5# Default programs (in configure.ac).
6CC ?= cc 6CC ?= cc
7CODESPELL ?= codespell 7CODESPELL ?= codespell
8CPPCHECK ?= cppcheck 8CPPCHECK ?= cppcheck
9GAWK ?= gawk 9GAWK ?= gawk
10GZIP ?= gzip
10SCAN_BUILD ?= scan-build 11SCAN_BUILD ?= scan-build
12STRIP ?= strip
13TAR ?= tar
14
15# Default programs (not in configure.ac).
16INSTALL ?= install
17RM ?= rm -f
11 18
12ifneq ($(HAVE_MAN),no) 19ifneq ($(HAVE_MAN),no)
13MAN_TARGET = man 20MAN_TARGET = man
@@ -71,7 +78,7 @@ $(MYDIRS):
71 78
72.PHONY: strip 79.PHONY: strip
73strip: all 80strip: all
74 strip $(ALL_ITEMS) 81 $(STRIP) $(ALL_ITEMS)
75 82
76.PHONY: filters 83.PHONY: filters
77filters: $(SECCOMP_FILTERS) 84filters: $(SECCOMP_FILTERS)
@@ -183,115 +190,115 @@ clean:
183 done 190 done
184 $(MAKE) -C src/man clean 191 $(MAKE) -C src/man clean
185 $(MAKE) -C test clean 192 $(MAKE) -C test clean
186 rm -f $(SECCOMP_FILTERS) 193 $(RM) $(SECCOMP_FILTERS)
187 rm -f $(SYNTAX_FILES) 194 $(RM) $(SYNTAX_FILES)
188 rm -fr ./$(TARNAME)-$(VERSION) ./$(TARNAME)-$(VERSION).tar.xz 195 $(RM) -r ./$(TARNAME)-$(VERSION) ./$(TARNAME)-$(VERSION).tar.xz
189 rm -f ./$(TARNAME)*.deb 196 $(RM) ./$(TARNAME)*.deb
190 rm -f ./$(TARNAME)*.rpm 197 $(RM) ./$(TARNAME)*.rpm
191 198
192.PHONY: distclean 199.PHONY: distclean
193distclean: clean 200distclean: clean
194 rm -fr autom4te.cache config.log config.mk config.sh config.status 201 $(RM) -r autom4te.cache config.log config.mk config.sh config.status
195 202
196.PHONY: install 203.PHONY: install
197install: all config.mk 204install: all config.mk
198 # firejail executable 205 # firejail executable
199 install -m 0755 -d $(DESTDIR)$(bindir) 206 $(INSTALL) -m 0755 -d $(DESTDIR)$(bindir)
200 install -m 0755 src/firejail/firejail $(DESTDIR)$(bindir) 207 $(INSTALL) -m 0755 src/firejail/firejail $(DESTDIR)$(bindir)
201ifeq ($(HAVE_SUID),-DHAVE_SUID) 208ifeq ($(HAVE_SUID),-DHAVE_SUID)
202 chmod u+s $(DESTDIR)$(bindir)/firejail 209 chmod u+s $(DESTDIR)$(bindir)/firejail
203endif 210endif
204 # firemon executable 211 # firemon executable
205 install -m 0755 src/firemon/firemon $(DESTDIR)$(bindir) 212 $(INSTALL) -m 0755 src/firemon/firemon $(DESTDIR)$(bindir)
206 # firecfg executable 213 # firecfg executable
207 install -m 0755 src/firecfg/firecfg $(DESTDIR)$(bindir) 214 $(INSTALL) -m 0755 src/firecfg/firecfg $(DESTDIR)$(bindir)
208 # jailcheck executable 215 # jailcheck executable
209 install -m 0755 src/jailcheck/jailcheck $(DESTDIR)$(bindir) 216 $(INSTALL) -m 0755 src/jailcheck/jailcheck $(DESTDIR)$(bindir)
210 # libraries and plugins 217 # libraries and plugins
211 install -m 0755 -d $(DESTDIR)$(libdir)/firejail 218 $(INSTALL) -m 0755 -d $(DESTDIR)$(libdir)/firejail
212 install -m 0755 -t $(DESTDIR)$(libdir)/firejail src/firecfg/firejail-welcome.sh 219 $(INSTALL) -m 0755 -t $(DESTDIR)$(libdir)/firejail src/firecfg/firejail-welcome.sh
213 install -m 0644 -t $(DESTDIR)$(libdir)/firejail $(MYLIBS) $(SECCOMP_FILTERS) 220 $(INSTALL) -m 0644 -t $(DESTDIR)$(libdir)/firejail $(MYLIBS) $(SECCOMP_FILTERS)
214 install -m 0755 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS) 221 $(INSTALL) -m 0755 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS)
215 install -m 0755 -t $(DESTDIR)$(libdir)/firejail src/profstats/profstats 222 $(INSTALL) -m 0755 -t $(DESTDIR)$(libdir)/firejail src/profstats/profstats
216 install -m 0755 -t $(DESTDIR)$(libdir)/firejail src/etc-cleanup/etc-cleanup 223 $(INSTALL) -m 0755 -t $(DESTDIR)$(libdir)/firejail src/etc-cleanup/etc-cleanup
217 # plugins w/o read permission (non-dumpable) 224 # plugins w/o read permission (non-dumpable)
218 install -m 0711 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS_NON_DUMPABLE) 225 $(INSTALL) -m 0711 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS_NON_DUMPABLE)
219 install -m 0711 -t $(DESTDIR)$(libdir)/firejail src/fshaper/fshaper.sh 226 $(INSTALL) -m 0711 -t $(DESTDIR)$(libdir)/firejail src/fshaper/fshaper.sh
220 install -m 0644 -t $(DESTDIR)$(libdir)/firejail src/fnettrace/static-ip-map 227 $(INSTALL) -m 0644 -t $(DESTDIR)$(libdir)/firejail src/fnettrace/static-ip-map
221ifeq ($(HAVE_CONTRIB_INSTALL),yes) 228ifeq ($(HAVE_CONTRIB_INSTALL),yes)
222 # contrib scripts 229 # contrib scripts
223 install -m 0755 -t $(DESTDIR)$(libdir)/firejail contrib/*.py contrib/*.sh 230 $(INSTALL) -m 0755 -t $(DESTDIR)$(libdir)/firejail contrib/*.py contrib/*.sh
224 # vim syntax 231 # vim syntax
225 install -m 0755 -d $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect 232 $(INSTALL) -m 0755 -d $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect
226 install -m 0755 -d $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax 233 $(INSTALL) -m 0755 -d $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax
227 install -m 0644 contrib/vim/ftdetect/firejail.vim $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect 234 $(INSTALL) -m 0644 contrib/vim/ftdetect/firejail.vim $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect
228 install -m 0644 contrib/syntax/files/firejail.vim $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax 235 $(INSTALL) -m 0644 contrib/syntax/files/firejail.vim $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax
229 # gtksourceview language-specs 236 # gtksourceview language-specs
230 install -m 0755 -d $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs 237 $(INSTALL) -m 0755 -d $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs
231 install -m 0644 contrib/syntax/files/firejail-profile.lang $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs 238 $(INSTALL) -m 0644 contrib/syntax/files/firejail-profile.lang $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs
232endif 239endif
233 # documents 240 # documents
234 install -m 0755 -d $(DESTDIR)$(docdir) 241 $(INSTALL) -m 0755 -d $(DESTDIR)$(docdir)
235 install -m 0644 -t $(DESTDIR)$(docdir) COPYING README RELNOTES etc/templates/* 242 $(INSTALL) -m 0644 -t $(DESTDIR)$(docdir) COPYING README RELNOTES etc/templates/*
236 # profiles and settings 243 # profiles and settings
237 install -m 0755 -d $(DESTDIR)$(sysconfdir)/firejail 244 $(INSTALL) -m 0755 -d $(DESTDIR)$(sysconfdir)/firejail
238 install -m 0755 -d $(DESTDIR)$(sysconfdir)/firejail/firecfg.d 245 $(INSTALL) -m 0755 -d $(DESTDIR)$(sysconfdir)/firejail/firecfg.d
239 install -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail src/firecfg/firecfg.config 246 $(INSTALL) -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail src/firecfg/firecfg.config
240 install -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail etc/profile-a-l/*.profile etc/profile-m-z/*.profile etc/inc/*.inc etc/net/*.net etc/firejail.config 247 $(INSTALL) -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail etc/profile-a-l/*.profile etc/profile-m-z/*.profile etc/inc/*.inc etc/net/*.net etc/firejail.config
241 sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/firejail/login.users ]; then install -c -m 0644 etc/login.users $(DESTDIR)/$(sysconfdir)/firejail/.; fi;" 248 sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/firejail/login.users ]; then $(INSTALL) -c -m 0644 etc/login.users $(DESTDIR)/$(sysconfdir)/firejail/.; fi;"
242ifeq ($(HAVE_IDS),-DHAVE_IDS) 249ifeq ($(HAVE_IDS),-DHAVE_IDS)
243 install -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail etc/ids.config 250 $(INSTALL) -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail etc/ids.config
244endif 251endif
245ifeq ($(BUSYBOX_WORKAROUND),yes) 252ifeq ($(BUSYBOX_WORKAROUND),yes)
246 ./mketc.sh $(DESTDIR)$(sysconfdir)/firejail/disable-common.inc 253 ./mketc.sh $(DESTDIR)$(sysconfdir)/firejail/disable-common.inc
247endif 254endif
248ifeq ($(HAVE_APPARMOR),-DHAVE_APPARMOR) 255ifeq ($(HAVE_APPARMOR),-DHAVE_APPARMOR)
249 # install apparmor profile 256 # install apparmor profile
250 sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d; fi;" 257 sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d ]; then $(INSTALL) -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d; fi;"
251 install -m 0644 etc/apparmor/firejail-default $(DESTDIR)$(sysconfdir)/apparmor.d 258 $(INSTALL) -m 0644 etc/apparmor/firejail-default $(DESTDIR)$(sysconfdir)/apparmor.d
252 # install apparmor profile customization file 259 # install apparmor profile customization file
253 sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/local ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/local; fi;" 260 sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/local ]; then $(INSTALL) -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/local; fi;"
254 sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/apparmor.d/local/firejail-default ]; then install -c -m 0644 etc/apparmor/firejail-local $(DESTDIR)/$(sysconfdir)/apparmor.d/local/firejail-default; fi;" 261 sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/apparmor.d/local/firejail-default ]; then $(INSTALL) -c -m 0644 etc/apparmor/firejail-local $(DESTDIR)/$(sysconfdir)/apparmor.d/local/firejail-default; fi;"
255 # install apparmor base abstraction drop-in 262 # install apparmor base abstraction drop-in
256 sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions; fi;" 263 sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions ]; then $(INSTALL) -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions; fi;"
257 sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions/base.d ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions/base.d; fi;" 264 sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions/base.d ]; then $(INSTALL) -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions/base.d; fi;"
258 install -m 0644 etc/apparmor/firejail-base $(DESTDIR)$(sysconfdir)/apparmor.d/abstractions/base.d 265 $(INSTALL) -m 0644 etc/apparmor/firejail-base $(DESTDIR)$(sysconfdir)/apparmor.d/abstractions/base.d
259endif 266endif
260ifneq ($(HAVE_MAN),no) 267ifneq ($(HAVE_MAN),no)
261 # man pages 268 # man pages
262 install -m 0755 -d $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 269 $(INSTALL) -m 0755 -d $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5
263 install -m 0644 $(MANPAGES1_GZ) $(DESTDIR)$(mandir)/man1/ 270 $(INSTALL) -m 0644 $(MANPAGES1_GZ) $(DESTDIR)$(mandir)/man1/
264 install -m 0644 $(MANPAGES5_GZ) $(DESTDIR)$(mandir)/man5/ 271 $(INSTALL) -m 0644 $(MANPAGES5_GZ) $(DESTDIR)$(mandir)/man5/
265endif 272endif
266 # bash completion 273 # bash completion
267 install -m 0755 -d $(DESTDIR)$(datarootdir)/bash-completion/completions 274 $(INSTALL) -m 0755 -d $(DESTDIR)$(datarootdir)/bash-completion/completions
268 install -m 0644 src/bash_completion/firejail.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail 275 $(INSTALL) -m 0644 src/bash_completion/firejail.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail
269 install -m 0644 src/bash_completion/firemon.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon 276 $(INSTALL) -m 0644 src/bash_completion/firemon.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon
270 install -m 0644 src/bash_completion/firecfg.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg 277 $(INSTALL) -m 0644 src/bash_completion/firecfg.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg
271 # zsh completion 278 # zsh completion
272 install -m 0755 -d $(DESTDIR)$(datarootdir)/zsh/site-functions 279 $(INSTALL) -m 0755 -d $(DESTDIR)$(datarootdir)/zsh/site-functions
273 install -m 0644 src/zsh_completion/_firejail $(DESTDIR)$(datarootdir)/zsh/site-functions/ 280 $(INSTALL) -m 0644 src/zsh_completion/_firejail $(DESTDIR)$(datarootdir)/zsh/site-functions/
274 281
275.PHONY: install-strip 282.PHONY: install-strip
276install-strip: strip install 283install-strip: strip install
277 284
278.PHONY: uninstall 285.PHONY: uninstall
279uninstall: config.mk 286uninstall: config.mk
280 rm -f $(DESTDIR)$(bindir)/firejail 287 $(RM) $(DESTDIR)$(bindir)/firejail
281 rm -f $(DESTDIR)$(bindir)/firemon 288 $(RM) $(DESTDIR)$(bindir)/firemon
282 rm -f $(DESTDIR)$(bindir)/firecfg 289 $(RM) $(DESTDIR)$(bindir)/firecfg
283 rm -f $(DESTDIR)$(bindir)/jailcheck 290 $(RM) $(DESTDIR)$(bindir)/jailcheck
284 rm -fr $(DESTDIR)$(libdir)/firejail 291 $(RM) -r $(DESTDIR)$(libdir)/firejail
285 rm -fr $(DESTDIR)$(datarootdir)/doc/firejail 292 $(RM) -r $(DESTDIR)$(datarootdir)/doc/firejail
286 rm -f $(addprefix $(DESTDIR)$(mandir)/man1/,$(notdir $(MANPAGES1_GZ))) 293 $(RM) $(addprefix $(DESTDIR)$(mandir)/man1/,$(notdir $(MANPAGES1_GZ)))
287 rm -f $(addprefix $(DESTDIR)$(mandir)/man5/,$(notdir $(MANPAGES5_GZ))) 294 $(RM) $(addprefix $(DESTDIR)$(mandir)/man5/,$(notdir $(MANPAGES5_GZ)))
288 rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail 295 $(RM) $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail
289 rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon 296 $(RM) $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon
290 rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg 297 $(RM) $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg
291 rm -f $(DESTDIR)$(datarootdir)/zsh/site-functions/_firejail 298 $(RM) $(DESTDIR)$(datarootdir)/zsh/site-functions/_firejail
292 rm -f $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect/firejail.vim 299 $(RM) $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect/firejail.vim
293 rm -f $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax/firejail.vim 300 $(RM) $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax/firejail.vim
294 rm -f $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs/firejail-profile.lang 301 $(RM) $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs/firejail-profile.lang
295 @echo "If you want to install a different version of firejail, you might also need to run 'rm -fr $(DESTDIR)$(sysconfdir)/firejail', see #2038." 302 @echo "If you want to install a different version of firejail, you might also need to run 'rm -fr $(DESTDIR)$(sysconfdir)/firejail', see #2038."
296 303
297# Note: Keep this list in sync with `paths` in .github/workflows/build.yml. 304# Note: Keep this list in sync with `paths` in .github/workflows/build.yml.
@@ -336,9 +343,9 @@ dist: clean config.mk
336 mkdir -p $(TARNAME)-$(VERSION)/test 343 mkdir -p $(TARNAME)-$(VERSION)/test
337 cp -a $(DISTFILES) $(TARNAME)-$(VERSION) 344 cp -a $(DISTFILES) $(TARNAME)-$(VERSION)
338 cp -a $(DISTFILES_TEST) $(TARNAME)-$(VERSION)/test 345 cp -a $(DISTFILES_TEST) $(TARNAME)-$(VERSION)/test
339 rm -rf $(TARNAME)-$(VERSION)/src/tools 346 $(RM) -r $(TARNAME)-$(VERSION)/src/tools
340 tar -cJvf $(TARNAME)-$(VERSION).tar.xz $(TARNAME)-$(VERSION) 347 $(TAR) -cJvf $(TARNAME)-$(VERSION).tar.xz $(TARNAME)-$(VERSION)
341 rm -fr $(TARNAME)-$(VERSION) 348 $(RM) -r $(TARNAME)-$(VERSION)
342 349
343.PHONY: asc 350.PHONY: asc
344asc: config.sh 351asc: config.sh
diff --git a/config.mk.in b/config.mk.in
index a7f66fbb5..812573a14 100644
--- a/config.mk.in
+++ b/config.mk.in
@@ -78,7 +78,10 @@ CC=@CC@
78CODESPELL=@CODESPELL@ 78CODESPELL=@CODESPELL@
79CPPCHECK=@CPPCHECK@ 79CPPCHECK=@CPPCHECK@
80GAWK=@GAWK@ 80GAWK=@GAWK@
81GZIP=@GZIP@
81SCAN_BUILD=@SCAN_BUILD@ 82SCAN_BUILD=@SCAN_BUILD@
83STRIP=@STRIP@
84TAR=@TAR@
82 85
83CFLAGS=@CFLAGS@ 86CFLAGS=@CFLAGS@
84CPPFLAGS=@CPPFLAGS@ 87CPPFLAGS=@CPPFLAGS@
diff --git a/configure b/configure
index 348c02cbb..00c1a89bf 100755
--- a/configure
+++ b/configure
@@ -682,7 +682,10 @@ PKG_CONFIG
682HAVE_APPARMOR 682HAVE_APPARMOR
683HAVE_IDS 683HAVE_IDS
684DEPS_CFLAGS 684DEPS_CFLAGS
685TAR
686STRIP
685SCAN_BUILD 687SCAN_BUILD
688GZIP
686GAWK 689GAWK
687CPPCHECK 690CPPCHECK
688CODESPELL 691CODESPELL
@@ -3414,6 +3417,53 @@ fi
3414 test -n "$GAWK" && break 3417 test -n "$GAWK" && break
3415done 3418done
3416 3419
3420for ac_prog in gzip
3421do
3422 # Extract the first word of "$ac_prog", so it can be a program name with args.
3423set dummy $ac_prog; ac_word=$2
3424{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3425printf %s "checking for $ac_word... " >&6; }
3426if test ${ac_cv_prog_GZIP+y}
3427then :
3428 printf %s "(cached) " >&6
3429else $as_nop
3430 if test -n "$GZIP"; then
3431 ac_cv_prog_GZIP="$GZIP" # Let the user override the test.
3432else
3433as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3434for as_dir in $PATH
3435do
3436 IFS=$as_save_IFS
3437 case $as_dir in #(((
3438 '') as_dir=./ ;;
3439 */) ;;
3440 *) as_dir=$as_dir/ ;;
3441 esac
3442 for ac_exec_ext in '' $ac_executable_extensions; do
3443 if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
3444 ac_cv_prog_GZIP="$ac_prog"
3445 printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
3446 break 2
3447 fi
3448done
3449 done
3450IFS=$as_save_IFS
3451
3452fi
3453fi
3454GZIP=$ac_cv_prog_GZIP
3455if test -n "$GZIP"; then
3456 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5
3457printf "%s\n" "$GZIP" >&6; }
3458else
3459 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3460printf "%s\n" "no" >&6; }
3461fi
3462
3463
3464 test -n "$GZIP" && break
3465done
3466
3417for ac_prog in scan-build 3467for ac_prog in scan-build
3418do 3468do
3419 # Extract the first word of "$ac_prog", so it can be a program name with args. 3469 # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -3461,6 +3511,100 @@ fi
3461 test -n "$SCAN_BUILD" && break 3511 test -n "$SCAN_BUILD" && break
3462done 3512done
3463 3513
3514for ac_prog in strip
3515do
3516 # Extract the first word of "$ac_prog", so it can be a program name with args.
3517set dummy $ac_prog; ac_word=$2
3518{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3519printf %s "checking for $ac_word... " >&6; }
3520if test ${ac_cv_prog_STRIP+y}
3521then :
3522 printf %s "(cached) " >&6
3523else $as_nop
3524 if test -n "$STRIP"; then
3525 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
3526else
3527as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3528for as_dir in $PATH
3529do
3530 IFS=$as_save_IFS
3531 case $as_dir in #(((
3532 '') as_dir=./ ;;
3533 */) ;;
3534 *) as_dir=$as_dir/ ;;
3535 esac
3536 for ac_exec_ext in '' $ac_executable_extensions; do
3537 if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
3538 ac_cv_prog_STRIP="$ac_prog"
3539 printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
3540 break 2
3541 fi
3542done
3543 done
3544IFS=$as_save_IFS
3545
3546fi
3547fi
3548STRIP=$ac_cv_prog_STRIP
3549if test -n "$STRIP"; then
3550 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
3551printf "%s\n" "$STRIP" >&6; }
3552else
3553 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3554printf "%s\n" "no" >&6; }
3555fi
3556
3557
3558 test -n "$STRIP" && break
3559done
3560
3561for ac_prog in tar
3562do
3563 # Extract the first word of "$ac_prog", so it can be a program name with args.
3564set dummy $ac_prog; ac_word=$2
3565{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3566printf %s "checking for $ac_word... " >&6; }
3567if test ${ac_cv_prog_TAR+y}
3568then :
3569 printf %s "(cached) " >&6
3570else $as_nop
3571 if test -n "$TAR"; then
3572 ac_cv_prog_TAR="$TAR" # Let the user override the test.
3573else
3574as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3575for as_dir in $PATH
3576do
3577 IFS=$as_save_IFS
3578 case $as_dir in #(((
3579 '') as_dir=./ ;;
3580 */) ;;
3581 *) as_dir=$as_dir/ ;;
3582 esac
3583 for ac_exec_ext in '' $ac_executable_extensions; do
3584 if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
3585 ac_cv_prog_TAR="$ac_prog"
3586 printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
3587 break 2
3588 fi
3589done
3590 done
3591IFS=$as_save_IFS
3592
3593fi
3594fi
3595TAR=$ac_cv_prog_TAR
3596if test -n "$TAR"; then
3597 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5
3598printf "%s\n" "$TAR" >&6; }
3599else
3600 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3601printf "%s\n" "no" >&6; }
3602fi
3603
3604
3605 test -n "$TAR" && break
3606done
3607
3464 3608
3465DEPS_CFLAGS="" 3609DEPS_CFLAGS=""
3466 3610
diff --git a/configure.ac b/configure.ac
index 73bd334f8..3701b7b4c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,10 @@ AC_PROG_CC
22AC_CHECK_PROGS([CODESPELL], [codespell]) 22AC_CHECK_PROGS([CODESPELL], [codespell])
23AC_CHECK_PROGS([CPPCHECK], [cppcheck]) 23AC_CHECK_PROGS([CPPCHECK], [cppcheck])
24AC_CHECK_PROGS([GAWK], [gawk]) 24AC_CHECK_PROGS([GAWK], [gawk])
25AC_CHECK_PROGS([GZIP], [gzip])
25AC_CHECK_PROGS([SCAN_BUILD], [scan-build]) 26AC_CHECK_PROGS([SCAN_BUILD], [scan-build])
27AC_CHECK_PROGS([STRIP], [strip])
28AC_CHECK_PROGS([TAR], [tar])
26 29
27DEPS_CFLAGS="" 30DEPS_CFLAGS=""
28AC_SUBST([DEPS_CFLAGS]) 31AC_SUBST([DEPS_CFLAGS])
diff --git a/src/bash_completion/Makefile b/src/bash_completion/Makefile
index c7ef6afc6..c06323f64 100644
--- a/src/bash_completion/Makefile
+++ b/src/bash_completion/Makefile
@@ -2,14 +2,17 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5GAWK ?= gawk
6RM ?= rm -f
7
5.PHONY: all 8.PHONY: all
6all: firejail.bash_completion 9all: firejail.bash_completion
7 10
8firejail.bash_completion: firejail.bash_completion.in $(ROOT)/config.mk 11firejail.bash_completion: firejail.bash_completion.in $(ROOT)/config.mk
9 $(GAWK) -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp 12 $(GAWK) -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp
10 sed "s|_SYSCONFDIR_|$(sysconfdir)|" < $@.tmp > $@ 13 sed "s|_SYSCONFDIR_|$(sysconfdir)|" < $@.tmp > $@
11 rm $@.tmp 14 $(RM) $@.tmp
12 15
13.PHONY: clean 16.PHONY: clean
14clean: 17clean:
15 rm -fr firejail.bash_completion 18 $(RM) -r firejail.bash_completion
diff --git a/src/man/Makefile b/src/man/Makefile
index 1c1fd49a5..767920e2b 100644
--- a/src/man/Makefile
+++ b/src/man/Makefile
@@ -2,6 +2,10 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5GAWK ?= gawk
6GZIP ?= gzip
7RM ?= rm -f
8
5MOD_DIR := $(ROOT)/src/man 9MOD_DIR := $(ROOT)/src/man
6MANPAGES_IN := $(sort $(wildcard $(MOD_DIR)/*.in)) 10MANPAGES_IN := $(sort $(wildcard $(MOD_DIR)/*.in))
7MANPAGES_GZ := $(MANPAGES_IN:.in=.gz) 11MANPAGES_GZ := $(MANPAGES_IN:.in=.gz)
@@ -19,8 +23,8 @@ $(MOD_DIR)/%: $(MOD_DIR)/%.in $(ROOT)/config.mk
19# foo.1.gz: foo.1 23# foo.1.gz: foo.1
20$(MOD_DIR)/%.gz: $(MOD_DIR)/% 24$(MOD_DIR)/%.gz: $(MOD_DIR)/%
21 @printf 'Generating %s from %s\n' $@ $< 25 @printf 'Generating %s from %s\n' $@ $<
22 @rm -f $@ 26 @$(RM) $@
23 @gzip -n9 $< 27 @$(GZIP) -n9 $<
24 28
25.PHONY: clean 29.PHONY: clean
26clean:; rm -f *.1 *.5 *.gz 30clean:; $(RM) *.1 *.5 *.gz
diff --git a/src/prog.mk b/src/prog.mk
index a639e87fc..3e89a6ba8 100644
--- a/src/prog.mk
+++ b/src/prog.mk
@@ -5,6 +5,9 @@
5# The includer should probably define PROG and TARGET and may also want to 5# The includer should probably define PROG and TARGET and may also want to
6# define EXTRA_OBJS and extend CLEANFILES. 6# define EXTRA_OBJS and extend CLEANFILES.
7 7
8CC ?= cc
9RM ?= rm -f
10
8HDRS := 11HDRS :=
9SRCS := $(sort $(wildcard $(MOD_DIR)/*.c)) 12SRCS := $(sort $(wildcard $(MOD_DIR)/*.c))
10OBJS := $(SRCS:.c=.o) 13OBJS := $(SRCS:.c=.o)
@@ -25,4 +28,4 @@ $(PROG): $(OBJS) $(EXTRA_OBJS) $(ROOT)/config.mk
25 $(CC) $(PROG_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRA_OBJS) $(LIBS) 28 $(CC) $(PROG_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRA_OBJS) $(LIBS)
26 29
27.PHONY: clean 30.PHONY: clean
28clean:; rm -fr $(PROG) $(CLEANFILES) 31clean:; $(RM) -r $(PROG) $(CLEANFILES)
diff --git a/src/so.mk b/src/so.mk
index ac76ffc30..63a0da7ce 100644
--- a/src/so.mk
+++ b/src/so.mk
@@ -5,6 +5,9 @@
5# The includer should probably define SO and TARGET and may also want to define 5# The includer should probably define SO and TARGET and may also want to define
6# EXTRA_OBJS and extend CLEANFILES. 6# EXTRA_OBJS and extend CLEANFILES.
7 7
8CC ?= cc
9RM ?= rm -f
10
8HDRS := 11HDRS :=
9SRCS := $(sort $(wildcard $(MOD_DIR)/*.c)) 12SRCS := $(sort $(wildcard $(MOD_DIR)/*.c))
10OBJS := $(SRCS:.c=.o) 13OBJS := $(SRCS:.c=.o)
@@ -25,4 +28,4 @@ $(SO): $(OBJS) $(EXTRA_OBJS) $(ROOT)/config.mk
25 $(CC) $(SO_LDFLAGS) -shared $(LDFLAGS) -o $@ $(OBJS) $(EXTRA_OBJS) -ldl 28 $(CC) $(SO_LDFLAGS) -shared $(LDFLAGS) -o $@ $(OBJS) $(EXTRA_OBJS) -ldl
26 29
27.PHONY: clean 30.PHONY: clean
28clean:; rm -fr $(SO) $(CLEANFILES) 31clean:; $(RM) -r $(SO) $(CLEANFILES)
diff --git a/src/zsh_completion/Makefile b/src/zsh_completion/Makefile
index e964d39ec..cbc476a73 100644
--- a/src/zsh_completion/Makefile
+++ b/src/zsh_completion/Makefile
@@ -2,14 +2,17 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5GAWK ?= gawk
6RM ?= rm -f
7
5.PHONY: all 8.PHONY: all
6all: _firejail 9all: _firejail
7 10
8_firejail: _firejail.in $(ROOT)/config.mk 11_firejail: _firejail.in $(ROOT)/config.mk
9 $(GAWK) -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp 12 $(GAWK) -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp
10 sed "s|_SYSCONFDIR_|$(sysconfdir)|" < $@.tmp > $@ 13 sed "s|_SYSCONFDIR_|$(sysconfdir)|" < $@.tmp > $@
11 rm $@.tmp 14 $(RM) $@.tmp
12 15
13.PHONY: clean 16.PHONY: clean
14clean: 17clean:
15 rm -fr _firejail 18 $(RM) -r _firejail
diff --git a/test/Makefile b/test/Makefile
index 52fada86c..89855d082 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -2,6 +2,8 @@
2ROOT = .. 2ROOT = ..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5RM ?= rm -f
6
5TESTS=$(patsubst %/,%,$(wildcard */)) 7TESTS=$(patsubst %/,%,$(wildcard */))
6 8
7.PHONY: $(TESTS) 9.PHONY: $(TESTS)
@@ -11,14 +13,14 @@ $(TESTS):
11 13
12.PHONY: clean 14.PHONY: clean
13clean: 15clean:
14 for test in $(TESTS); do rm -f "$$test/$$test.log"; done 16 for test in $(TESTS); do $(RM) "$$test/$$test.log"; done
15 rm -fr environment/-testdir 17 $(RM) -r environment/-testdir
16 rm -f environment/index.html* 18 $(RM) environment/index.html*
17 rm -f environment/logfile* 19 $(RM) environment/logfile*
18 rm -f environment/wget-log* 20 $(RM) environment/wget-log*
19 rm -f sysutils/firejail_t* 21 $(RM) sysutils/firejail_t*
20 rm -f utils/firejail-test-file* 22 $(RM) utils/firejail-test-file*
21 rm -f utils/index.html* 23 $(RM) utils/index.html*
22 rm -f utils/lstesting 24 $(RM) utils/lstesting
23 rm -f utils/wget-log 25 $(RM) utils/wget-log
24 cd compile && (./compile.sh --clean || true) 26 cd compile && (./compile.sh --clean || true)