diff options
author | Owen Synge <osynge@suse.com> | 2015-05-26 19:23:58 +0200 |
---|---|---|
committer | Sage Weil <sage@redhat.com> | 2015-08-01 15:58:33 +0200 |
commit | 1ba4694d7ed0322f5beff398a537eb66222bf55e (patch) | |
tree | 7635c85c5eba63afcc9bb6c7b2bd07b89b9757f1 | |
parent | Add unit files to the spec file. (diff) | |
download | ceph-1ba4694d7ed0322f5beff398a537eb66222bf55e.tar.xz ceph-1ba4694d7ed0322f5beff398a537eb66222bf55e.zip |
Autotools to install systemd unit files.
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 <osynge@suse.com>
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | ceph.spec.in | 6 | ||||
-rw-r--r-- | configure.ac | 29 | ||||
-rw-r--r-- | systemd/Makefile.am | 11 |
5 files changed, 47 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore index 3190b654403..01cccf55073 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,7 @@ release stamp-h1 systemd/ceph-osd@.service systemd/ceph-rgw.tmpfiles.d +systemd/Makefile vgcore.* # specific local dir files diff --git a/Makefile.am b/Makefile.am index 72053f8d76f..611256421f8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 \ diff --git a/ceph.spec.in b/ceph.spec.in index 314ca5f1521..1b8bae3fbf7 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -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" \ diff --git a/configure.ac b/configure.ac index 3257cae7694..ebc69ab87c8 100644 --- a/configure.ac +++ b/configure.ac @@ -1197,6 +1197,7 @@ AC_ARG_WITH( ] ) + dnl rgw-user AC_SUBST(user_rgw) AC_ARG_WITH( @@ -1218,7 +1219,6 @@ AC_ARG_WITH( ] ) - dnl rgw-group AC_SUBST(group_rgw) AC_ARG_WITH( @@ -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 @@ -1301,6 +1327,7 @@ AC_CONFIG_FILES([Makefile src/ocf/rbd src/java/Makefile src/tracing/Makefile + systemd/Makefile man/Makefile doc/Makefile systemd/ceph-osd@.service diff --git a/systemd/Makefile.am b/systemd/Makefile.am new file mode 100644 index 00000000000..70f41bccd2f --- /dev/null +++ b/systemd/Makefile.am @@ -0,0 +1,11 @@ +unitfiles = \ + ceph.target \ + ceph-mds@.service \ + ceph-mon@.service \ + ceph-osd@.service + +unitdir = $(systemd_unit_dir) + +unit_DATA = $(unitfiles) + +EXTRA_DIST = $(unitfiles) |