Skip to content

Commit

Permalink
Autotools to install systemd unit files.
Browse files Browse the repository at this point in the history
To simplify the spec file we should install as much using autotools
and as little as possible in the spec file.

Signed-off-by: Owen Synge <[email protected]>
  • Loading branch information
oms4suse authored and liewegas committed Aug 1, 2015
1 parent d6213b6 commit 1ba4694
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ release
stamp-h1
systemd/[email protected]
systemd/ceph-rgw.tmpfiles.d
systemd/Makefile
vgcore.*

# specific local dir files
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = gnu
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = autogen.sh ceph.spec.in ceph.spec install-deps.sh
# the "." here makes sure check-local builds gtest and gmock before they are used
SUBDIRS = . src man doc
SUBDIRS = . src man doc systemd

EXTRA_DIST += \
src/test/run-cli-tests \
Expand Down
6 changes: 6 additions & 0 deletions ceph.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,12 @@ export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed -e 's/i386/i486/'`
--prefix=/usr \
--localstatedir=/var \
--sysconfdir=/etc \
%if 0%{?rhel} || 0%{?fedora}
--with-systemd-libexec-dir=/usr/lib/systemd/system \
%endif
%if 0%{?opensuse} || 0%{?suse_version}
--with-systemdsystemunitdir=%_unitdir \
%endif
--docdir=%{_docdir}/ceph \
--with-man-pages \
--mandir="%_mandir" \
Expand Down
29 changes: 28 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,7 @@ AC_ARG_WITH(
]
)


dnl rgw-user
AC_SUBST(user_rgw)
AC_ARG_WITH(
Expand All @@ -1218,7 +1219,6 @@ AC_ARG_WITH(
]
)


dnl rgw-group
AC_SUBST(group_rgw)
AC_ARG_WITH(
Expand All @@ -1241,6 +1241,32 @@ AC_ARG_WITH(
)


AC_SUBST(systemd_unit_dir)
AC_ARG_WITH(
systemd-unit-dir,
AS_HELP_STRING(
[--with-systemdsystemunitdir=DIR],
[systemd unit directory @<:@SYSTEMD_UNIT_DIR@:>@
Defaults to the correct value for debian /etc/systemd/system/]
),
[
systemd_unit_dir="$withval"
],
[
# default to the systemd admin unit directory
which pkg-config
pkg_config_exists=$?
if test x"$pkg_config_exists" = x"0"; then
systemd_unit_dir=`pkg-config systemd --variable=systemdsystemunitdir`
else
systemd_unit_dir="/etc/systemd/system/"
fi
]
)




# Checks for typedefs, structures, and compiler characteristics.
#AC_HEADER_STDBOOL
#AC_C_CONST
Expand Down Expand Up @@ -1301,6 +1327,7 @@ AC_CONFIG_FILES([Makefile
src/ocf/rbd
src/java/Makefile
src/tracing/Makefile
systemd/Makefile
man/Makefile
doc/Makefile
systemd/[email protected]
Expand Down
11 changes: 11 additions & 0 deletions systemd/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
unitfiles = \
ceph.target \
[email protected] \
[email protected] \
[email protected]

unitdir = $(systemd_unit_dir)

unit_DATA = $(unitfiles)

EXTRA_DIST = $(unitfiles)

0 comments on commit 1ba4694

Please sign in to comment.