diff --git a/config/mount-helper.m4 b/config/mount-helper.m4 index e559b9ab2734..98f3179a93cb 100644 --- a/config/mount-helper.m4 +++ b/config/mount-helper.m4 @@ -1,8 +1,8 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_MOUNT_HELPER], [ AC_ARG_WITH(mounthelperdir, AS_HELP_STRING([--with-mounthelperdir=DIR], - [install mount.zfs in dir [[/sbin]]]), - mounthelperdir=$withval,mounthelperdir=/sbin) + [install mount.zfs in dir [[$sbindir]]]), + mounthelperdir=$withval,mounthelperdir=$sbindir) AC_SUBST(mounthelperdir) ]) diff --git a/config/user-dracut.m4 b/config/user-dracut.m4 index b9705297f744..f5f14fb00ef7 100644 --- a/config/user-dracut.m4 +++ b/config/user-dracut.m4 @@ -7,8 +7,8 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_DRACUT], [ [dracutdir=check]) AS_IF([test "x$dracutdir" = xcheck], [ - path1=/usr/share/dracut - path2=/usr/lib/dracut + path1=$prefix/share/dracut + path2=$prefix/lib/dracut default=$path2 AS_IF([test -d "$path1"], [dracutdir="$path1"], [ diff --git a/config/user-systemd.m4 b/config/user-systemd.m4 index e4fd0b57c2b7..8b0d45c4c689 100644 --- a/config/user-systemd.m4 +++ b/config/user-systemd.m4 @@ -7,23 +7,23 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_SYSTEMD], [ AC_ARG_WITH(systemdunitdir, AS_HELP_STRING([--with-systemdunitdir=DIR], - [install systemd unit files in dir [[/usr/lib/systemd/system]]]), - systemdunitdir=$withval,systemdunitdir=/usr/lib/systemd/system) + [install systemd unit files in dir [[$libdir/systemd/system]]]), + systemdunitdir=$withval,systemdunitdir=$libdir/systemd/system) AC_ARG_WITH(systemdpresetdir, AS_HELP_STRING([--with-systemdpresetdir=DIR], - [install systemd preset files in dir [[/usr/lib/systemd/system-preset]]]), - systemdpresetdir=$withval,systemdpresetdir=/usr/lib/systemd/system-preset) + [install systemd preset files in dir [[$libdir/systemd/system-preset]]]), + systemdpresetdir=$withval,systemdpresetdir=$libdir/systemd/system-preset) AC_ARG_WITH(systemdmodulesloaddir, AS_HELP_STRING([--with-systemdmodulesloaddir=DIR], - [install systemd module load files into dir [[/usr/lib/modules-load.d]]]), - systemdmodulesloaddir=$withval,systemdmodulesloaddir=/usr/lib/modules-load.d) + [install systemd module load files into dir [[$libdir/modules-load.d]]]), + systemdmodulesloaddir=$withval,systemdmodulesloaddir=$libdir/modules-load.d) AC_ARG_WITH(systemdgeneratordir, AS_HELP_STRING([--with-systemdgeneratordir=DIR], - [install systemd generators in dir [[/usr/lib/systemd/system-generators]]]), - systemdgeneratordir=$withval,systemdgeneratordir=/usr/lib/systemd/system-generators) + [install systemd generators in dir [[$libdir/systemd/system-generators]]]), + systemdgeneratordir=$withval,systemdgeneratordir=$libdir/systemd/system-generators) AS_IF([test "x$enable_systemd" = xcheck], [ AS_IF([systemctl --version >/dev/null 2>&1], diff --git a/config/user-udev.m4 b/config/user-udev.m4 index e6120fc8fef6..1bb7b8eec041 100644 --- a/config/user-udev.m4 +++ b/config/user-udev.m4 @@ -8,13 +8,15 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_UDEV], [ AS_IF([test "x$udevdir" = xcheck], [ path1=/lib/udev - path2=/usr/lib/udev + path2=$prefix/lib/udev default=$path2 - AS_IF([test -d "$path1"], [udevdir="$path1"], [ - AS_IF([test -d "$path2"], [udevdir="$path2"], - [udevdir="$default"]) - ]) + AS_IF([test "$prefix" = "/usr"], [ + AS_IF([test -d "$path1"], [udevdir="$path1"], [ + AS_IF([test -d "$path2"], [udevdir="$path2"], + [udevdir="$default"]) + ]) + ], [udevdir="$default"]) ]) AC_ARG_WITH(udevruledir, diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 index 55fc029f0847..eb4a7af82180 100644 --- a/config/zfs-build.m4 +++ b/config/zfs-build.m4 @@ -601,24 +601,24 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ AC_MSG_CHECKING([default init config directory]) case "$VENDOR" in alpine|artix|gentoo) - initconfdir=/etc/conf.d + initconfdir=$sysconfdir/conf.d ;; fedora|openeuler|redhat|sles|toss) - initconfdir=/etc/sysconfig + initconfdir=$sysconfdir/sysconfig ;; freebsd) initconfdir=$sysconfdir/rc.conf.d ;; *) # debian|ubuntu - initconfdir=/etc/default + initconfdir=$sysconfdir/default ;; esac AC_MSG_RESULT([$initconfdir]) AC_SUBST(initconfdir) AC_MSG_CHECKING([whether initramfs-tools is available]) - if test -d /usr/share/initramfs-tools ; then + if test -d $datarootdir/initramfs-tools ; then RPM_DEFINE_INITRAMFS='--define "_initramfs 1"' AC_MSG_RESULT([yes]) else @@ -630,13 +630,13 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ AC_MSG_CHECKING([default bash completion directory]) case "$VENDOR" in alpine|arch|artix|debian|gentoo|ubuntu) - bashcompletiondir=/usr/share/bash-completion/completions + bashcompletiondir=$datarootdir/bash-completion/completions ;; freebsd) bashcompletiondir=$sysconfdir/bash_completion.d ;; *) - bashcompletiondir=/etc/bash_completion.d + bashcompletiondir=$sysconfdir/bash_completion.d ;; esac AC_MSG_RESULT([$bashcompletiondir]) diff --git a/contrib/initramfs/Makefile.am b/contrib/initramfs/Makefile.am index a583341ea2b1..ee0160c04d9e 100644 --- a/contrib/initramfs/Makefile.am +++ b/contrib/initramfs/Makefile.am @@ -1,4 +1,4 @@ -i_tdir = /usr/share/initramfs-tools +i_tdir = $(datarootdir)/initramfs-tools dist_i_t_SCRIPTS = \ %D%/zfsunlock