Fix debian packaging (#1742)

* Fix debian package
* Fix mode on pam config
* Set up PAM by default
* Update platform/debian/kanidm-unixd/postinst

---------

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
This commit is contained in:
Yuxuan Lu 2023-06-24 16:26:52 +08:00 committed by GitHub
parent a20dd3b113
commit 7cf8ff1e6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 3 deletions

View file

@ -8,13 +8,13 @@ set -e
case "$1" in case "$1" in
configure) configure)
pam-auth-update --package
if [ ! -f /etc/kanidm/config ]; then if [ ! -f /etc/kanidm/config ]; then
echo "=============================" echo "============================="
echo "Thanks for installing Kanidm!" echo "Thanks for installing Kanidm!"
echo "=============================" echo "============================="
echo "Please ensure you create configuration files at /etc/kanidm/unixd and /etc/kanidm/config" echo "Please ensure you create configuration files at /etc/kanidm/unixd and /etc/kanidm/config"
echo "Examples are in /usr/share/kanidm-unixd/" echo "Examples are in /usr/share/kanidm-unixd/"
echo "To configure pam module, please run pam-auth-update and select Kanidm"
echo "To configure nsswitch, please follow instructions in https://kanidm.github.io/kanidm/master/integrations/pam_and_nsswitch.html" echo "To configure nsswitch, please follow instructions in https://kanidm.github.io/kanidm/master/integrations/pam_and_nsswitch.html"
fi fi
;; ;;

View file

@ -0,0 +1,3 @@
if [ "$1" = remove ]; then
pam-auth-update --package --remove kanidm
fi

View file

@ -11,6 +11,7 @@ PKGDIR=debian/${PACKAGE}
BINDIR=${PKGDIR}/usr/sbin/ BINDIR=${PKGDIR}/usr/sbin/
LIBDIR=${PKGDIR}/lib/${DEB_HOST_MULTIARCH} LIBDIR=${PKGDIR}/lib/${DEB_HOST_MULTIARCH}
SHARED_DIR=${PKGDIR}/usr/share/${PACKAGE} SHARED_DIR=${PKGDIR}/usr/share/${PACKAGE}
PAMDIR=${PKGDIR}/usr/share/pam-configs/
DISTRIBUTOR_ID=$(shell lsb_release -is) DISTRIBUTOR_ID=$(shell lsb_release -is)
DISTRIBUTOR_RELEASE=$(shell lsb_release -rs) DISTRIBUTOR_RELEASE=$(shell lsb_release -rs)
DISTRIBUTOR=$(DISTRIBUTOR_ID)_$(DISTRIBUTOR_RELEASE) DISTRIBUTOR=$(DISTRIBUTOR_ID)_$(DISTRIBUTOR_RELEASE)
@ -51,6 +52,7 @@ override_dh_systemd_start:
override_dh_auto_install: override_dh_auto_install:
mkdir -p ${BINDIR} mkdir -p ${BINDIR}
mkdir -p ${PAMDIR}
mkdir -p ${LIBDIR}/security mkdir -p ${LIBDIR}/security
install \ install \
-g root -o root \ -g root -o root \
@ -80,8 +82,10 @@ override_dh_auto_install:
-g root -o root \ -g root -o root \
target/release/libnss_kanidm.so \ target/release/libnss_kanidm.so \
${LIBDIR}/libnss_kanidm.so.2 ${LIBDIR}/libnss_kanidm.so.2
install \
-g root -o root -m 644 \
debian/kanidm.pam \
${PAMDIR}/kanidm
override_dh_installexamples: override_dh_installexamples:
mkdir -p ${SHARED_DIR} mkdir -p ${SHARED_DIR}