nDPI/packages/rpm/Makefile.in
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

38 lines
1.5 KiB
Makefile

#
# RPM Build Process
#
APPL=ndpi
PLATFORM=@PLATFORM@
GIT_REVISION=@GIT_REVISION@
PACKAGE_VERSION=@PACKAGE_VERSION@
PACKAGE=$(APPL)-$(PACKAGE_VERSION)-$(GIT_REVISION).$(PLATFORM).rpm
DEV_PACKAGE=$(APPL)-dev-$(PACKAGE_VERSION)-$(GIT_REVISION).$(PLATFORM).rpm
PACKAGE_PATH=$(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)
package: build-rpm
build-src:
cd ../..; ./autogen.sh; ./configure; make clean; make
cleanup-rpm:
$(RM) -r $(HOME)/rpmbuild/BUILD/ndpi* $(HOME)/rpmbuild/SOURCES/ndpi*
build-rpm: build-src cleanup-rpm
-$(RM) -r ndpi-@PACKAGE_VERSION@
mkdir -p ndpi-@PACKAGE_VERSION@/packages
cp ndpi.spec.in ndpi-@PACKAGE_VERSION@/packages
cp ../../Makefile.* ../../libtool ../../configure* ../../config.* ../../install-sh ../../autogen.sh ndpi-@PACKAGE_VERSION@
cp -rf ../../src ndpi-@PACKAGE_VERSION@
cp ../../CHANGELOG.md ../../COPYING ndpi-@PACKAGE_VERSION@
$(RM) ndpi-@PACKAGE_VERSION@/config.status
mkdir -p $(HOME)/rpmbuild/SOURCES
tar cvfz $(HOME)/rpmbuild/SOURCES/ndpi-@PACKAGE_VERSION@.tgz ndpi-@PACKAGE_VERSION@
@$(RM) $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)
@rpmbuild -bb ./$(APPL).spec --define "buildnumber $(GIT_REVISION)"
@if [[ $EUID -ne 0 ]]; then @RPM_SIGN_CMD@ $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE); fi
@if [[ $EUID -ne 0 ]]; then @RPM_SIGN_CMD@ $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(DEV_PACKAGE); fi
@echo ""
@echo "Package contents:"
@rpm -qpl $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)
@echo "The package is now available in $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)"