Commit graph

23 commits

Author SHA1 Message Date
Ivan Nardi
b2357c29c3
Build system: Standardize and improve clean/distclean targets (#3039)
This commit improves the nDPI build system by standardizing cleanup
targets, improving portability, and ensuring complete removal of
generated files during `make distclean`.

Changes:

1. Standardize clean targets (replace /bin/rm with portable $(RM))

2. Add distclean-local targets for complete cleanup

3. Add missing clean/distclean targets

4. Remove obsolete commented-out curl detection code

5. fuzz/Makefile.am: Fix out-of-tree build compatibility by replacing hardcoded
   relative paths (../example/fuzz_*.o) with proper $(top_builddir) variables.
   Add distclean-local target.
2025-11-24 18:42:03 +01:00
Toni
f2ef6e1d18
Debian/Ubuntu packaging: use --enable-no-sign to build *.deb packages w/o signing those (#2616)
* can be used for local and CI builds

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2024-11-18 09:17:14 +01:00
Petr
c35a5ca087
shell: reformatted, fixed inspections, typos (#2506)
Reformatted shell scripts according to [ShellCheck](https://github.com/koalaman/shellcheck/).

I. Most common changes:
1. https://github.com/koalaman/shellcheck/wiki/SC2086
	`$var` → `"$var"`
	Note: this isn't always necessary and I've been careful not to substitute where it wasn't necessary in meaning.
2. https://github.com/koalaman/shellcheck/wiki/SC2006
	`` `command` `` → `$(command)`
3. https://github.com/koalaman/shellcheck/wiki/SC2004
	`$(( $a + $b ))` → `$(( a + b ))`
4. https://github.com/koalaman/shellcheck/wiki/SC2164
	`cd "$dir"` → `cd "$dir" || exit 1`
5. https://github.com/koalaman/shellcheck/wiki/SC2166
	`[ check1 -o check2 ]` → `[ check1 ] || [ check2 ]`
6. https://github.com/koalaman/shellcheck/wiki/SC2002
	`cat "${file}" | wc -c` → `< "${file}" wc -c`
	Note: this looks a bit uglier but works faster.

II. Some special changes:
1. In file `utils/common.sh`:
	https://github.com/koalaman/shellcheck/wiki/SC2112
	This script is interpreted by `sh`, not by `bash`, but uses the keyword `function`.
	So I replaced `#!/usr/bin/env sh` to `#!/usr/bin/env bash`.
2. After that I thought of replacing all shebangs to `#!/usr/bin/env bash` for consistency and cross-platform compatibility, especially since most of the files already use bash.
3. But in cases when it was `#!/bin/sh -e` or `#!/bin/bash -eu` another problem appears:
	https://github.com/koalaman/shellcheck/wiki/SC2096
	So I decided to make all shebangs look uniform:
	```
	#!/usr/bin/env bash
	set -e (or set -eu) (if needed)
	```
4. In file `tests/ossfuzz.sh`:
	https://github.com/koalaman/shellcheck/wiki/SC2162
	`read i` → `read -r i`
	Note: I think that there is no need in special treatment for backslashes, but I could be wrong.
5. In file `tests/do.sh.in`:
	https://github.com/koalaman/shellcheck/wiki/SC2035
	`ls *.*cap*` → `ls -- *.*cap*`
6. In file `utils/verify_dist_tarball.sh`:
	https://github.com/koalaman/shellcheck/wiki/SC2268
	`[ "x${TARBALL}" = x ]` → `[ -z "${TARBALL}" ]`
7. In file `utils/check_symbols.sh`:
	https://github.com/koalaman/shellcheck/wiki/SC2221
	`'[ndpi_utils.o]'|'[ndpi_memory.o]'|'[roaring.o]')` → `'[ndpi_utils.o]'|'[ndpi_memory.o]')`
8. In file `autogen.sh`:
	https://github.com/koalaman/shellcheck/wiki/SC2145
	`echo "./configure $@"` → `echo "./configure $*"`
	https://github.com/koalaman/shellcheck/wiki/SC2068
	`./configure $@` → `./configure "$@"`

III. `LIST6_MERGED` and `LIST_MERGED6`
	There were typos with this variables in files `utils/aws_ip_addresses_download.sh`, `utils/aws_ip_addresses_download.sh` and `utils/microsoft_ip_addresses_download.sh` where variable `LIST6_MERGED` was defined, but `LIST_MERGED6` was removed by `rm`.
	I changed all `LIST_MERGED6` to `LIST6_MERGED`.

Not all changes are absolutely necessary, but some may save you from future bugs.
2024-07-18 17:32:49 +02:00
Luca Deri
fb58f838e5 Added public_suffix_list.dat in packages 2024-01-29 11:43:23 +01:00
Luca Deri
6831187d62 Debian 12 fixes 2023-07-21 12:24:34 -04:00
Sam James
c2b7d77784
build: respect environment options more (#1392)
* build: update m4/ax_pthread.m4 from serial 23 -> serial 31

Update ax_pthread.m4 to the latest version from the autoconf-archive
project.

Signed-off-by: Sam James <sam@gentoo.org>

* build: properly detect AR, CC, RANLIB

It's necessary to be able to override choice of AR/CC/RANLIB and other toolchain
variables/tools for cross-compilation, testing with other toolchains, and
to ensure the compiler chosen by the user is actually used for the build.

Previously, GNU_PREFIX was kind-of used for this but this isn't a standard
variable (at all) and it wasn't applied consistently anyway.

We now use the standard autoconf mechanisms for finding these tools.

(RANLIB is already covered by LT_INIT.)

Signed-off-by: Sam James <sam@gentoo.org>

* build: use $(MAKE)

This ensures that parallel make works correctly, as otherwise, a fresh
make job will be started without the jobserver fd, and hence
not know about its parent, forcing -j1.

* build: respect CPPFLAGS, LDFLAGS

- CPPFLAGS is for the C preprocessor (usually for setting defines)
- LDFLAGS should be placed before objects for certain flags to work
  (e.g. -Wl,--as-needed)

Signed-off-by: Sam James <sam@gentoo.org>

Co-authored-by: Luca Deri <lucaderi@users.noreply.github.com>
2022-01-18 14:30:14 +01:00
Toni
e84da386c7
Added nDPI pkg-config file to Debian / Ubuntu ndpi-dev packaging. (#1318)
* Added nDPI pkg-config file to Debian / Ubuntu ndpi-dev packaging.

 * fixed missing gcrypt library dependency in libndpi.pc

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2021-10-03 21:29:56 +02:00
Luca Deri
6db20b3ba9 Updated dependency 2021-02-19 17:59:40 +01:00
Luca Deri
bdf95a5c22 Package fix 2021-02-18 22:08:15 +00:00
Luca Deri
bce54079d8 Initial geoip support 2021-02-18 22:35:25 +01:00
Alfredo Cardigliano
e45f0a4b64 Install ndpi under /usr 2020-11-17 09:19:07 +01:00
Luca Deri
fc58e564f0 Restored Ubuntu/Debian packaging 2020-11-03 16:08:57 +01:00
Toni
8e84abfa0e
Fix/packaging (#1047)
* Fix OpenWrt build.

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>

* Fixed Debian/Ubuntu packaging.

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>

* Added DPKG package build to a CI job.

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2020-11-03 11:36:40 +01:00
Alfredo Cardigliano
1c4ce8b0f4 Move libraries from /usr/local to /usr 2020-10-29 12:43:33 +01:00
Alfredo Cardigliano
181ec4992b Deb fix (shared lib links) 2018-12-10 16:54:01 +01:00
Alfredo Cardigliano
b2c00b3b24 Added script to get the package version 2018-12-07 15:50:23 +01:00
Luca Deri
d63e000a45 Fixed package signing 2018-11-30 00:57:34 +01:00
Alfredo Cardigliano
1537669178 rpm package 2018-11-19 18:02:06 +01:00
Alfredo Cardigliano
b0cfe0b9cc settins arch for -dev package as it contains static libs 2018-11-19 15:27:24 +01:00
Alfredo Cardigliano
30305cf4fa deb dependency fix 2018-11-19 15:13:38 +01:00
Alfredo Cardigliano
219951760f ubuntu ndpi/ndpi-dev package (testing) 2018-11-19 11:16:28 +01:00
Josh Soref
5a2f556ff7 spelling: compatibility 2017-03-12 21:20:18 +00:00
Luca Deri
2e5ceac844 Initial import from SVN 2015-04-19 07:25:59 +02:00