From 8b4f8c2c5bb7577f5484f8a67f0e0f6493925889 Mon Sep 17 00:00:00 2001 From: bharnden Date: Mon, 17 Jun 2019 19:59:44 -0700 Subject: [PATCH] changes to fix some issues when building fpm packages --- Makefile.am | 13 +++++++++---- scripts/core-daemon.in | 2 +- scripts/core-daemon.service.in | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6bf34253..23fdd956 100644 --- a/Makefile.am +++ b/Makefile.am @@ -46,9 +46,11 @@ MAINTAINERCLEANFILES = .version \ if PYTHON3 -PYTHON_DEP = python3 >= 3.0 +PYTHON_DEB_DEP = python3 >= 3.0 +PYTHON_RPM_DEP = python3 >= 3.0 else -PYTHON_DEP = python >= 2.7, python < 3.0 +PYTHON_DEB_DEP = python (>= 2.7), python (<< 3.0) +PYTHON_RPM_DEP = python >= 2.7, python < 3.0 endif define fpm-rpm = @@ -61,6 +63,7 @@ fpm -s dir -t rpm -n core \ -p core_$(PYTHON)_VERSION_ARCH.rpm \ -v $(PACKAGE_VERSION) \ --rpm-init scripts/core-daemon \ + --config-files "/etc/core" \ -d "tcl" \ -d "tk" \ -d "procps-ng" \ @@ -70,7 +73,7 @@ fpm -s dir -t rpm -n core \ -d "iproute" \ -d "libev" \ -d "net-tools" \ - -d "$(PYTHON_DEP)" \ + -d "$(PYTHON_RPM_DEP)" \ -C $(DESTDIR) endef @@ -84,6 +87,8 @@ fpm -s dir -t deb -n core \ -p core_$(PYTHON)_VERSION_ARCH.deb \ -v $(PACKAGE_VERSION) \ --deb-systemd scripts/core-daemon.service \ + --deb-no-default-config-files \ + --config-files "/etc/core" \ -d "tcl" \ -d "tk" \ -d "libtk-img" \ @@ -94,7 +99,7 @@ fpm -s dir -t deb -n core \ -d "ebtables" \ -d "iproute2" \ -d "libev4" \ - -d "$(PYTHON_DEP)" \ + -d "$(PYTHON_DEB_DEP)" \ -C $(DESTDIR) endef diff --git a/scripts/core-daemon.in b/scripts/core-daemon.in index a865fcef..263d980d 100644 --- a/scripts/core-daemon.in +++ b/scripts/core-daemon.in @@ -20,7 +20,7 @@ NAME=`basename $0` PIDFILE="@CORE_STATE_DIR@/run/$NAME.pid" LOG="@CORE_STATE_DIR@/log/$NAME.log" -CMD="PYTHONPATH=@pythondir@ @PYTHON@ @bindir@/$NAME" +CMD="@bindir@/$NAME" get_pid() { cat "$PIDFILE" diff --git a/scripts/core-daemon.service.in b/scripts/core-daemon.service.in index 210de4d5..cd53cfad 100644 --- a/scripts/core-daemon.service.in +++ b/scripts/core-daemon.service.in @@ -4,7 +4,7 @@ After=network.target [Service] Type=simple -ExecStart=@PYTHON@ @bindir@/core-daemon +ExecStart=@bindir@/core-daemon TasksMax=infinity [Install]