From 4d06806c6d8b8b80aed3dfb960d86fecf1ec27df Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Thu, 27 Jun 2013 21:29:40 +0200
Subject: [PATCH] units: work aroud automake bug unable to handle files with a
 leading '-'

---
 Makefile.am    | 13 ++++++++++++-
 units/-.slice  | 12 ------------
 units/x-.slice | 12 ++++++++++++
 3 files changed, 24 insertions(+), 13 deletions(-)
 delete mode 100644 units/-.slice
 create mode 100644 units/x-.slice

diff --git a/Makefile.am b/Makefile.am
index c64934e..a253a1c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -379,7 +379,7 @@ dist_systemunit_DATA = \
 	units/swap.target \
 	units/slices.target \
 	units/system.slice \
-	units/-.slice \
+	units/x-.slice \
 	units/systemd-initctl.socket \
 	units/systemd-shutdownd.socket \
 	units/syslog.socket \
@@ -498,6 +498,17 @@ EXTRA_DIST += \
 	units/rc-local.service.in \
 	units/halt-local.service.in
 
+# automake is broken and can't handle files with a dash in front
+# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14728#8
+units-install-hook:
+	mv $(DESTDIR)$(systemunitdir)/x-.slice $(DESTDIR)/$(systemunitdir)/-.slice
+
+units-uninstall-hook:
+	rm -f $(DESTDIR)/$(systemunitdir)/-.slice
+
+INSTALL_DATA_HOOKS += units-install-hook
+UNINSTALL_DATA_HOOKS += units-uninstall-hook
+
 dist_doc_DATA = \
 	README \
 	NEWS \
diff --git a/units/-.slice b/units/-.slice
deleted file mode 100644
index ac82c35..0000000
--- a/units/-.slice
+++ /dev/null
@@ -1,12 +0,0 @@
-#  This file is part of systemd.
-#
-#  systemd is free software; you can redistribute it and/or modify it
-#  under the terms of the GNU Lesser General Public License as published by
-#  the Free Software Foundation; either version 2.1 of the License, or
-#  (at your option) any later version.
-
-[Unit]
-Description=Root Slice
-Documentation=man:systemd.special(7)
-DefaultDependencies=no
-Before=slices.target
diff --git a/units/x-.slice b/units/x-.slice
new file mode 100644
index 0000000..ac82c35
--- /dev/null
+++ b/units/x-.slice
@@ -0,0 +1,12 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Root Slice
+Documentation=man:systemd.special(7)
+DefaultDependencies=no
+Before=slices.target
-- 
1.8.2.1

