[packages/ejabberd] Make a dummy git repository for building

jajcus jajcus at pld-linux.org
Fri Nov 15 16:18:15 CET 2013


commit 8e1415389ca3b44acb74844792282f81f70e2552
Author: Jacek Konieczny <j.konieczny at eggsoft.pl>
Date:   Fri Nov 15 16:17:22 2013 +0100

    Make a dummy git repository for building
    
    I give up. It wants a GIT repository, let it have it.

 ejabberd.spec | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/ejabberd.spec b/ejabberd.spec
index baceae7..b1903ca 100644
--- a/ejabberd.spec
+++ b/ejabberd.spec
@@ -70,6 +70,7 @@ BuildRequires:	pam-devel
 BuildRequires:	rpmbuild(macros) >= 1.268
 BuildRequires:	yaml-devel
 BuildRequires:	zlib-devel
+BuildRequires:	git-core
 Requires(post):	/usr/bin/perl
 Requires(post):	jabber-common
 Requires(post):	sed >= 4.0
@@ -106,13 +107,19 @@ Server-side logging module.
 %patch2 -p0
 %endif
 
-# do not let it use 'git describe' to fetch version
-# it uses nonsense during manual builds and fails on the builder
-sed -i -e"s/AC_INIT(ejabberd,[^,]*,/AC_INIT(ejabberd,community %{version},/" configure.ac
-sed -i -e's/\([[:space:]]*REVISION=\).*git.*describe.*/\1"%{version}"/' contrib/extract_translations/prepare-translation.sh
-! grep -q "git describe" configure.ac contrib/extract_translations/prepare-translation.sh
+# Various parts of the build system use 'git describe'
+# which returns nonsense on manual builds using the builder script
+# and which fails on the PLD builders
+# I was not able to locate all 'git describe' invocation, sot let's
+# fool them with this dummy repository
+unset GIT_DIR GIT_WORK_TREE
+git init
+git add configure.ac
+git commit -a -m "dummy commit"
+git tag "%{version}"
 
 %build
+unset GIT_DIR GIT_WORK_TREE
 %{__aclocal} -I m4
 %{__autoconf}
 %configure \
@@ -159,6 +166,8 @@ cd ../..
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{/var/lib/%{realname},/etc/{sysconfig,rc.d/init.d},%{_sbindir}}
 
+unset GIT_DIR GIT_WORK_TREE
+
 %{__make} install -j1 \
 	CHOWN_COMMAND=true \
 	O_USER="" \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ejabberd.git/commitdiff/8e1415389ca3b44acb74844792282f81f70e2552



More information about the pld-cvs-commit mailing list