Skip to content

Commit

Permalink
build: don't install systemd unit file outside of prefix
Browse files Browse the repository at this point in the history
Problem: make distcheck fails in an attempt to install
the systemd unit file into the actual system directory,
which is not writeable.

Bring over a fix from flux-core (courtesy @grondo):
flux-framework/flux-core@35ee727

His comments:
  When --with-systemdsystemunitdir is not set explicitly, prepend
  the pkg-config systemdsystemunitdir with ${prefix}, so that the
  unit file is not installed outside of --prefix.

  Distro packages should therefore use --with-systemdsystemunitdir
  explicitly, in the case where the unit file directory *is* outside
  of prefix (e.g. /lib/systemd/system when --prefix=/usr).

Based on the spec files in the examples subdir, I think we are
likely already setting this explicitly when we build RPMs for TOSS.
  • Loading branch information
garlick committed Feb 18, 2020
1 parent d006fb3 commit 704b63a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/systemd.m4
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ AC_DEFUN([RRA_WITH_SYSTEMD_UNITDIR],
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
[Directory for systemd service files])],
[],
[with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
[with_systemdsystemunitdir=\${prefix}$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
AS_IF([test x"$with_systemdsystemunitdir" != xno],
[AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
AM_CONDITIONAL([HAVE_SYSTEMD],
Expand Down

0 comments on commit 704b63a

Please sign in to comment.