]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Autotools to install systemd unit files.
authorOwen Synge <osynge@suse.com>
Tue, 26 May 2015 17:23:58 +0000 (19:23 +0200)
committerSage Weil <sage@redhat.com>
Sat, 1 Aug 2015 13:58:33 +0000 (09:58 -0400)
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>
.gitignore
Makefile.am
ceph.spec.in
configure.ac
systemd/Makefile.am [new file with mode: 0644]

index 3190b6544039bb9edf0dfda8995c7b94ac09eb91..01cccf5507345501e976d2d066f342cbfa97e31e 100644 (file)
@@ -54,6 +54,7 @@ release
 stamp-h1
 systemd/ceph-osd@.service
 systemd/ceph-rgw.tmpfiles.d
+systemd/Makefile
 vgcore.*
 
 # specific local dir files
index 72053f8d76f864600d3eb40b950d1f94aa5bf744..611256421f8b68f04f7671ef89cb1c1984db0cc7 100644 (file)
@@ -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 \
index 314ca5f1521a5764208bd519870250153de9e837..1b8bae3fbf7df1a1b39a5991181ab8ec1ae4bc71 100644 (file)
@@ -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" \
index 3257cae769443492ec029e37df5e7c621fecf772..ebc69ab87c84eb6af1bf26a98512912eb4fb2f32 100644 (file)
@@ -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 (file)
index 0000000..70f41bc
--- /dev/null
@@ -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)