[Kimchi-devel] [PATCH] Install service on make install

Ramon Medeiros ramonn at linux.vnet.ibm.com
Wed May 20 17:29:10 UTC 2015


Issue #643: Service not created when building from source

Signed-off-by: Ramon Medeiros <ramonn at linux.vnet.ibm.com>
---
 Makefile.am | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 0720277..91a0fa2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,7 +16,6 @@
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
 SUBDIRS = src ui docs contrib tests po config plugins
 
 man_MANS = docs/kimchid.8
@@ -115,6 +114,28 @@ ChangeLog:
 		$(top_srcdir)/build-aux/genChangelog --release > $@; \
 	fi
 
+install-data-local:
+	@if  test -d /usr/lib/systemd/system/ ; then \
+		$(INSTALL_DATA) contrib/kimchid.service.fedora /usr/lib/systemd/system/kimchid.service; \
+		systemctl daemon-reload; \
+	elif test -d /etc/systemd/system; then \
+		$(INSTALL_DATA) contrib/kimchid.service.fedora /etc/systemd/system/kimchid.service; \
+		systemctl daemon-reload; \
+    else \
+		$(INSTALL_DATA) contrib/kimchid.sysvinit /etc/init.d/kimchid; \
+		chmod +x /etc/init.d/kimchid; \
+    fi 
+
+uninstall-local:
+	@if test -f /usr/lib/systemd/system/kimchid.service; then \
+		$(RM) /usr/lib/systemd/system/kimchid.service; \
+		systemctl daemon-reload; \
+	elif test -f /etc/systemd/system/kimchid.service; then \
+        $(RM) /etc/systemd/system/kimchid.service; \
+	elif test -f /etc/init.d/kimchid; then \
+		$(RM) /etc/init.d/kimchid; \
+	fi
+				
 VERSION:
 	@if test -d .git; then                                \
 		git describe --abbrev=0 > $@;                     \
@@ -122,6 +143,7 @@ VERSION:
 
 .PHONY: deb install-deb rpm fedora-rpm suse-rpm ChangeLog VERSION
 
+
 clean-local:
 	rm -rf mo rpm
 
-- 
2.1.0




More information about the Kimchi-devel mailing list