From 80b08294141a162431e74fe9bfb08977a268d338 Mon Sep 17 00:00:00 2001 From: rublon-jfr Date: Wed, 2 Nov 2022 10:58:32 +0100 Subject: [PATCH] RDEV-3625: Add generic support for os library path --- SSH/PAM/Makefile | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/SSH/PAM/Makefile b/SSH/PAM/Makefile index 25b7614..3e64450 100644 --- a/SSH/PAM/Makefile +++ b/SSH/PAM/Makefile @@ -1,10 +1,25 @@ -make: - gcc -fPIC -fno-stack-protector -std=c99 -DOS_NAME="\"$(shell . /etc/os-release; echo $$PRETTY_NAME)\"" -I$(shell ./getPythonPath.sh) -c rublonPam.c src/pamApp.c src/coreHandler.c src/signatureWrapper.c lib/cfg_parse.c lib/cJSON.c lib/qrcodegen.c +include /etc/os-release + +ifeq ($(ID), ubuntu) + SYS_LIB_DIR := /usr/lib/x86_64-linux-gnu +else ifeq ($(ID), debian) + SYS_LIB_DIR := /usr/lib/x86_64-linux-gnu +else ifeq ($(ID), centos) + SYS_LIB_DIR := /usr/lib64 +endif + +.PHONY: all selinux install clean +default: all + +all: + gcc -fPIC -fno-stack-protector -std=c99 -DOS_NAME='$(PRETTY_NAME)' -I$(shell ./getPythonPath.sh) -c rublonPam.c src/pamApp.c src/coreHandler.c src/signatureWrapper.c lib/cfg_parse.c lib/cJSON.c lib/qrcodegen.c ld -x --shared -o pam_rublon.so -lcurl rublonPam.o pamApp.o coreHandler.o signatureWrapper.o cfg_parse.o cJSON.o qrcodegen.o + selinux: checkmodule -M -m -o login_rublon.mod login_rublon.te semodule_package -o login_rublon.pp -m login_rublon.mod #semodule -i login_rublon.pp + install: install -m 644 rublon.config $(DESTDIR)/etc @@ -13,7 +28,8 @@ install: install -m 755 confirmUser.py $(DESTDIR)/usr/share/rublon-ssh install -m 644 login_rublon.pp $(DESTDIR)/usr/share/rublon-ssh - install -d $(DESTDIR)/usr/lib64/security - install -m 644 pam_rublon.so $(DESTDIR)/usr/lib64/security/ + install -d $(DESTDIR)$(SYS_LIB_DIR)/security + install -m 644 pam_rublon.so $(DESTDIR)$(SYS_LIB_DIR)/security + clean: rm pam_rublon.so rublonPam.o pamApp.o coreHandler.o signatureWrapper.o cfg_parse.o cJSON.o qrcodegen.o