<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 04/11/2014 11:50 PM,
<a class="moz-txt-link-abbreviated" href="mailto:shaohef@linux.vnet.ibm.com">shaohef@linux.vnet.ibm.com</a> wrote:<br>
</div>
<blockquote
cite="mid:1397231432-22601-1-git-send-email-shaohef@linux.vnet.ibm.com"
type="cite">
<pre wrap="">From: ShaoHe Feng <a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
It means the kimchi run in package install path when the packaged file exists.</pre>
</blockquote>
discuss with aline,<br>
<font size="3">use config.get_prefix() to know kimchi is installed
or not<br>
</font><font size="3">if it is installed try "rpm -qa kimchi"<br>
</font><font size="3">if it returns the package is installed
otherwise it is from a "make install"</font> <br>
<br>
<font size="3">we can "rpm -qa kimchi" to check it is installed by
rpm not by make install. </font><br>
<font size="3">for deb we can use: "dpkg --get-selections kimchi"</font><br>
<span style="font-weight: normal;"></span><font size="3">try with
rpm, if fails try deb</font><br>
<blockquote
cite="mid:1397231432-22601-1-git-send-email-shaohef@linux.vnet.ibm.com"
type="cite">
<pre wrap="">
Signed-off-by: ShaoHe Feng <a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
---
Makefile.am | 2 ++
contrib/kimchi.spec.fedora.in | 1 +
contrib/kimchi.spec.suse.in | 1 +
3 files changed, 4 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 6831b5d..290e3dd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -102,11 +102,13 @@ all-local:
install-deb: install
        cp -R $(top_srcdir)/contrib/DEBIAN $(DESTDIR)/
        $(MKDIR_P) $(DESTDIR)/etc/init
+        $(MKDIR_P) $(DESTDIR)/lib/kimchi
        $(MKDIR_P) $(DESTDIR)/usr/lib/firewalld/services
        cp -R $(top_srcdir)/contrib/kimchid-upstart.conf.debian \
                $(DESTDIR)/etc/init/kimchid.conf
        cp -R $(top_srcdir)/src/firewalld.xml \
                $(DESTDIR)/usr/lib/firewalld/services/kimchid.xml
+        touch $(DESTDIR)/lib/kimchi/packaged
deb: contrib/make-deb.sh
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index 1cd99b0..2e66b00 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -83,6 +83,7 @@ install -Dm 0755 contrib/kimchid.sysvinit %{buildroot}%{_initrddir}/kimchid
%endif
%post
+touch %{_localstatedir}/lib/kimchi/packaged
if [ $1 -eq 1 ] ; then
/bin/systemctl enable kimchid.service >/dev/null 2>&1 || :
# Initial installation
diff --git a/contrib/kimchi.spec.suse.in b/contrib/kimchi.spec.suse.in
index efb2c08..ee69384 100644
--- a/contrib/kimchi.spec.suse.in
+++ b/contrib/kimchi.spec.suse.in
@@ -51,6 +51,7 @@ install -Dm 0755 contrib/kimchid.sysvinit %{buildroot}%{_initrddir}/kimchid
%post
+touch %{_localstatedir}/lib/kimchi/packaged
chkconfig kimchid on
%preun
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Thanks and best regards!
Sheldon Feng(冯少合)<a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
IBM Linux Technology Center</pre>
</body>
</html>