File tree Expand file tree Collapse file tree 11 files changed +82
-37
lines changed
Expand file tree Collapse file tree 11 files changed +82
-37
lines changed Original file line number Diff line number Diff line change @@ -4,13 +4,25 @@ MODE ?= nuke
44RUN_FLAGS ?=
55
66SH_SOURCES := $(shell find scripts data -type f -name '* .sh' -print) bin/camsniff
7- DPKG_BUILD := dpkg-buildpackage -us -uc
7+ ifndef BUILD_SOURCE
8+ ifneq (,$(findstring /mnt/,$(ROOT_DIR ) ) )
9+ BUILD_SOURCE := 0
10+ else
11+ BUILD_SOURCE := 1
12+ endif
13+ endif
14+
15+ DPKG_BUILD_FLAGS := -us -uc
16+ ifeq ($(BUILD_SOURCE ) ,0)
17+ DPKG_BUILD_FLAGS += -b
18+ endif
19+ DPKG_BUILD := dpkg-buildpackage $(DPKG_BUILD_FLAGS )
820
921.PHONY : help build clean run lint dev shellcheck install-deps distclean build-coap
1022
1123help :
1224 @echo " Available targets:"
13- @echo " make build # dpkg-buildpackage -us -uc"
25+ @echo " make build # dpkg-buildpackage -us -uc (adds -b on /mnt; set BUILD_SOURCE=1 for source) "
1426 @echo " make clean # remove build artefacts and temporary state"
1527 @echo " make run MODE=war # invoke sudo ./scripts/camsniff.sh --mode war"
1628 @echo " make lint # shellcheck + bash -n across project scripts"
@@ -57,4 +69,4 @@ shellcheck:
5769 shellcheck -x -P scripts -P data -P . $(SH_SOURCES )
5870
5971dev : lint
60- $(DPKG_BUILD ) --dry-run
72+ $(DPKG_BUILD )
Original file line number Diff line number Diff line change 1010[ ![ Python] ( https://img.shields.io/badge/language-python-black?logo=python\& style=flat-square )] ( # )
1111[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square )] ( LICENSE )
1212
13- ** Current version:** ` 2.2.2 ` ·
13+ ** Current version:** ` 2.2.3 ` ·
1414
1515<img src =" docs/camsniff.png " alt =" CamSniff logo " width =" 320 " />
1616
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ set -e
3+
4+ cat << 'EOF '
15README.md
26VERSION
37LICENSE
48data/vendors/README.md
59docs/customisation.md
610docs/dev-helpers.md
711docs/camsniff.png
12+ EOF
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ set -e
3+
4+ cat << 'EOF '
15scripts/camsniff.sh usr/lib/camsniff/scripts
26scripts/requirements.txt usr/lib/camsniff/scripts
37scripts/core/* usr/lib/camsniff/scripts/core
@@ -25,5 +29,5 @@ docs/icons/camsniff-128.png usr/share/icons/hicolor/128x128/apps/
2529docs/icons/camsniff-64.png usr/share/icons/hicolor/64x64/apps/
2630docs/icons/camsniff-48.png usr/share/icons/hicolor/48x48/apps/
2731docs/icons/camsniff-32.png usr/share/icons/hicolor/32x32/apps/
28-
32+ EOF
2933
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ set -e
3+
4+ cat << 'EOF '
15# man-db 2.13.1 emits a false-positive "groff-message" when lintian runs
26# man --warnings --ditroff -Tutf8 on this page with stdout captured.
37# Remove once the upstream man-db/groff pipeline bug is fixed.
48camsniff: groff-message *command exited with status 1: /usr/libexec/man-db/zsoelim | /usr/libexec/man-db/manconv*
59
610# Desktop file uses sudo because CamSniff requires root privileges for packet capture and low-level scanning
7- camsniff: desktop-command-not-in-package sudo [usr/share/applications/camsniff.desktop]
11+ camsniff: desktop-command-not-in-package sudo [usr/share/applications/camsniff.desktop]
12+ EOF
Original file line number Diff line number Diff line change 1- docs/camsniff.1
1+ #! /bin/sh
2+ set -e
3+
4+ cat << 'EOF '
5+ docs/camsniff.1
6+ EOF
Original file line number Diff line number Diff line change 11misc:Depends=
2- misc:Pre-Depends=
2+ misc:Pre-Depends=
Original file line number Diff line number Diff line change 1- tmp
2- dev
3- .venv
4- venv
1+ #! /bin/sh
2+ set -e
3+
4+ rm -rf -- tmp dev .venv venv
Original file line number Diff line number Diff line change @@ -18,3 +18,17 @@ override_dh_auto_build:
1818
1919override_dh_auto_test :
2020 # No automated test suite during package build
21+
22+ override_dh_builddeb :
23+ set -e; \
24+ for pkg in $$ (dh_listpackages); do \
25+ build_dir=" debian/$$ pkg" ; \
26+ tmp_dir=$$(mktemp -d ) ; \
27+ cp -a " $$ build_dir/." " $$ tmp_dir/" ; \
28+ if [ -d " $$ tmp_dir/DEBIAN" ]; then \
29+ chmod 0755 " $$ tmp_dir/DEBIAN" ; \
30+ find " $$ tmp_dir/DEBIAN" -type f -exec chmod 0644 {} +; \
31+ fi ; \
32+ dpkg-deb --root-owner-group --build " $$ tmp_dir" ..; \
33+ rm -rf " $$ tmp_dir" ; \
34+ done
Original file line number Diff line number Diff line change @@ -803,6 +803,25 @@ run_ssdp_discovery() {
803803 rm -f " $ssdp_tmp "
804804}
805805
806+ normalize_report_format () {
807+ local raw=" $1 "
808+ raw=$( printf ' %s' " $raw " | tr ' [:upper:]' ' [:lower:]' )
809+ case " $raw " in
810+ md|markdown)
811+ echo " markdown"
812+ ;;
813+ html|htm)
814+ echo " html"
815+ ;;
816+ both|all)
817+ echo " both"
818+ ;;
819+ * )
820+ echo " "
821+ ;;
822+ esac
823+ }
824+
806825while [[ $# -gt 0 ]]; do
807826 case " $1 " in
808827 -m|--mode)
@@ -1144,25 +1163,6 @@ apply_optional_tool_overrides() {
11441163 fi
11451164}
11461165
1147- normalize_report_format () {
1148- local raw=" $1 "
1149- raw=$( printf ' %s' " $raw " | tr ' [:upper:]' ' [:lower:]' )
1150- case " $raw " in
1151- md|markdown)
1152- echo " markdown"
1153- ;;
1154- html|htm)
1155- echo " html"
1156- ;;
1157- both|all)
1158- echo " both"
1159- ;;
1160- * )
1161- echo " "
1162- ;;
1163- esac
1164- }
1165-
11661166generate_reports () {
11671167 local format=" $1 "
11681168 [[ -z $format ]] && return 0
@@ -1481,10 +1481,10 @@ render_smart_summary() {
14811481 local ip
14821482 for ip in " ${SMART_TARGETS[@]} " ; do
14831483 local score=${ip_pre_score[$ip]:- 0}
1484- local reasons =${ip_pre_reasons[$ip]:- }
1484+ local reason_summary =${ip_pre_reasons[$ip]:- }
14851485 printf " %s%-15s%s score=%s" " $CYAN " " $ip " " $RESET " " $score "
1486- if [[ -n $reasons ]]; then
1487- printf " (%s)" " $reasons "
1486+ if [[ -n $reason_summary ]]; then
1487+ printf " (%s)" " $reason_summary "
14881488 fi
14891489 echo " "
14901490 shown=$(( shown + 1 ))
You can’t perform that action at this time.
0 commit comments