drbd-latest introduces new build dependency on subversion
Subsystems (2)
Is that really necessary just for calling svnversion?
Sincerely,
Lars Marowsky-Brée <[email protected]>
Signature · 3 lines
High Availability & Clustering \ ever tried. ever failed. no matter. SUSE Labs, Research and Development | try again. fail again. fail better. SUSE LINUX AG - A Novell company \ -- Samuel Beckett
Lars Ellenberg
maintainer/ 2004-08-04 13:27:39 +0200
\ Lars Marowsky-Bree:
Quoted 1 line
Is that really necessary just for calling svnversion?
not exactly. if you get the tgz,
svnversion should never be called,
I checked that.
(well, as long as you don't rm drbd_buildtag.c)
if you don't get the tgz, you obviously have svn.
ok?
lge
Lars Ellenberg
maintainer/ 2004-08-04 14:36:14 +0200
\ Lars Ellenberg:
Quoted 4 lines
/ 2004-08-04 13:27:39 +0200
\ Lars Marowsky-Bree:Quoted 1 line
Is that really necessary just for calling svnversion?
Quoted 8 lines
not exactly. if you get the tgz,
svnversion should never be called,
I checked that.
(well, as long as you don't rmdrbd_buildtag.c)if you don't get the tgz, you obviously have svn.
ok?
to be even more exact, drbd_buildtag.c is generated thus:
[ moved lengthy explanation of code you were not concerned about anyways
to the end of this mail.
while writing that, I understand that probably mean: ]
the tgz, and therefore the rpm target does not work in and extracted tarball... since the .filelist depends now on svn...
ok, so I remove the .filelist dependency from the tgz target,
but leave it in for the tarball target
(which is used to create the distribution tarballs)
.filelist is only removed by distclean, so that should work. I just now did a successfull "make rpm" in a tar xvzf drbd-0.7.1.tgz.
now, does it work for you again?
Lars Ellenberg
----
the other use of svn in our makefiles is here,
and I took the svn-havenots intoconsideration
from the very beginning:
# update of drbd_buildtag.c is forced: .PHONY: drbd/drbd_buildtag.c drbd/drbd_buildtag.c:
I like to call it by name, to here we have a boolean value:
@is_tarball=`test -e .svn/. && echo false || echo true`;
whatever goes to stdout from now on goes to drbd_buildtag.c.new
set -e; exec > [email protected]; echo -e "/* automatically generated. DO NOT EDIT. */"; echo -e "const char * drbd_buildtag(void)\n{"; \ if $$is_tarball; then if ! test -e $@ ; then
can only happen when you rm drbd_buildtag.c; if you did, just:
echo >&2 "your DRBD source tree is broken. unpack again.";
exit 1;
fi;this is the reason, why I split the string constant in drbd_buildtag.c into two lines: I just grep the svn version tag from the previous drbd_buildtag.c:
grep return $@ ;
so you are expected to never modify the code in a tgz, if you do, we lose that information ("M" postfix on the svn version).
else
not $$is_tarball, i.e. .svn/ exists,
generate a new version line, with correct "version:otherversion[MS]" structure:
echo -ne "\treturn \"SVN Revision: "; svnversion -n .; echo \";
fi ;
echo -e "\t\t\" build by $$USER@$$HOSTNAME, `date "+%F %T"`\";\n}";
mv $@{.new,}Lars Ellenberg
maintainer/ 2004-08-16 14:02:02 +0200
\ Lars Marowsky-Bree:
Quoted 12 lines
Quoted 4 lines · Lars Ellenberg
.filelist is only removed by distclean, so that should work. I just now did a successfull "make rpm" in a tar xvzf drbd-0.7.1.tgz.
now, does it work for you again?
I don't use make rpm; I our buildsystem gets the source files + a spec file to build everything from, but for various reasons build from svn sources.
Quoted 6 lines
Now as the drbd specfile also generates the
km_drbdpackage which holds the external module which is needed to build the kernel, this means that I try to keep the dependency chain short. Introducing subversion meant that essentially the kernel got build aftersubversion->drbd, which wasn't good. I've now replaced the call to svnversion with a perl one liner to grab it from the .svn/dir-wcprops file. ;)
which is the same only for the special case
of an unmodified svn checkout.
Quoted 3 lines
Maybe I really should generate the source tarball for building using make tgz though instead of simply tarring the svn dir up...
if you do so, please use "make tarball".
make tgz lacks some preparation steps...
tarball additionally makes sure that there are no modifications pending, that the changelogs are up-to-date, that documentation is build (ok, *you* won't need that in the tarball), the .filelist is regenerated, and then calls make tgz, which just generates the tgz.
tarring up the .svn working dir should work the same, too. you'd need to "make drbd/drbd_buildtag.c" before you tar it, and you apply this patch with the preparation step in your drbd.spec:
Makefile +1 -1
@@ -96,7 +96,7 @@ # update of drbd_buildtag.c is forced: .PHONY: drbd/drbd_buildtag.c drbd/drbd_buildtag.c: - @is_tarball=`test -e .svn/. && echo false || echo true`; \ + @is_tarball=true; \ set -e; exec > [email protected]; \ echo -e "/* automatically generated. DO NOT EDIT. */"; \ echo -e "const char * drbd_buildtag(void)\n{"; \