mirror of
https://github.com/vel21ripn/nDPI.git
synced 2026-04-28 15:09:47 +00:00
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.
38 lines
1.5 KiB
Makefile
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)"
|
|
|