[sheepdog] [PATCH v3 2/3] symlink dog to collie for compatibility

Liu Yuan namei.unix at gmail.com
Mon Aug 12 17:18:47 CEST 2013


Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 debian/sheepdog.postinst |    2 ++
 debian/sheepdog.postrm   |    2 ++
 dog/Makefile.am          |    6 ++++++
 sheepdog.spec.in         |    3 +++
 4 files changed, 13 insertions(+)

diff --git a/debian/sheepdog.postinst b/debian/sheepdog.postinst
index bc72f06..c0d3c0f 100644
--- a/debian/sheepdog.postinst
+++ b/debian/sheepdog.postinst
@@ -24,6 +24,8 @@ if [ "$1" = "configure" ] ; then
 	db_stop || true
 fi
 
+ln -s -f /usr/sbin/dog /usr/sbin/collie
+
 #DEBHELPER#
 
 exit 0
diff --git a/debian/sheepdog.postrm b/debian/sheepdog.postrm
index 1611169..9ff442b 100644
--- a/debian/sheepdog.postrm
+++ b/debian/sheepdog.postrm
@@ -6,6 +6,8 @@ if [ "${1}" = "purge" ] ; then
 	rm -f /etc/default/sheepdog
 fi
 
+rm -f /usr/sbin/collie
+
 #DEBHELPER#
 
 exit 0
diff --git a/dog/Makefile.am b/dog/Makefile.am
index fc826d9..49d05ff 100644
--- a/dog/Makefile.am
+++ b/dog/Makefile.am
@@ -39,6 +39,12 @@ noinst_HEADERS		= treeview.h dog.h farm/farm.h
 
 EXTRA_DIST		=
 
+install-exec-hook:
+	if [ -z "${DESTDIR}" ];then $(LN_S) -f ${sbindir}/dog ${sbindir}/collie;fi
+
+uninstall-hook:
+	rm -f ${sbindir}/collie
+
 all-local:
 	@echo Built dog
 
diff --git a/sheepdog.spec.in b/sheepdog.spec.in
index b6ec4e6..dde9bd9 100644
--- a/sheepdog.spec.in
+++ b/sheepdog.spec.in
@@ -46,6 +46,7 @@ rm -rf %{buildroot}
 
 %post
 /sbin/chkconfig --add sheepdog
+ln -s -f %{_sbindir}/dog %{_sbindir}/collie
 
 %preun
 if [ $1 -eq 0 ] ; then
@@ -56,6 +57,8 @@ fi
 %postun
 if [ "$1" -ge "1" ] ; then
 	/sbin/service sheepdog condrestart >/dev/null 2>&1 || :
+else
+	rm -f /usr/sbin/collie
 fi
 
 %files
-- 
1.7.9.5




More information about the sheepdog mailing list