a) Add an option for '--tarbal' or something to override the git archive tarbal creation
b) Move ./contrib/holland.spec to ./holland.spec where people could build packages with 'rpmbuild -tb holland-1.0.2.tar.gz'
Thoughts?
---
derks
Begin forwarded message:
> From: GitHub <nor...@github.com>
> Date: July 13, 2010 3:17:09 PM CDT
> To: wdie...@5dollarwhitebox.org
> Subject: [GitHub] build_rpms.py script bailing on git [holland-backup/holland GH-50]
>
> gondoi reported an issue:
>
> When downloading the tarball of holland 1.0.2, I attempt to run the build_rpms.py script to create the packages, but git errors out:
>
> [root@hollandcent holland-1.0.2]# python scripts/build_rpms.py
> git archive --prefix=holland-1.0.2/ HEAD > /root/holland-buildroot/SOURCES/holland-1.0.2.tar.gz
> fatal: Not a git repository
>
> View Issue: http://github.com/holland-backup/holland/issues#issue/50
~Andy
> --
> WIKI: http://wiki.hollandbackup.org
> CODE: http://github.com/holland-backup
> UNSUBSCRIBE: holland-deve...@googlegroups.com
>
> I'm not against moving holland.spec and debian/ to the package root
> (at least for source distributions). I think fixing the build_rpms.py
> script to handle building a non-git tree would be useful too. I don't
> recall how we were doing this before git archive.
>
I'm pretty sure it just took the 'basedir', determined the version, and copied it to 'some_tmp/hollad-version' and then tar'd it.
---
derks
t = TarFile.open(..., 'w:gz')
t.add(holland_source_tree_root, arcname='holland-${version}/', ...)
I would still prefer git archive when exporting from a git tree, however.
~Andy
> IIRC, the move to git archive was sparked by my annoyance with the
> persistent staging tempdirs the old build_rpms script generated. :)
> It would be nice if any solution that has to stage the source tree to
> generate a tarball could clean up after itself. We can probably avoid
> that altogether by using python tarfile and doing something like:
>
Pretty sure the 'annoyance with the persistent staging tempdirs' is unrelated. That was done to create a tmpdir to work out of (an rpm buildroot).. and was to my knowledge resolved to not annoy you anymore. ;)
> t = TarFile.open(..., 'w:gz')
> t.add(holland_source_tree_root, arcname='holland-${version}/', ...)
>
Sounds find to me.
> I would still prefer git archive when exporting from a git tree, however.
>
As would I ... I was planning on keeping everything the same if ./.git exists.
---
derks
~Andy
We don't need to move this, rpmbuild -tb will still build fine:
$ python scripts/make_release.py
[INFO] created archive holland-1.0.3.tar.gz
$ tar ztvf holland-1.0.3.tar.gz | grep holland.spec
-rw-rw-r-- root/root 22234 2010-07-15 22:27:34
holland-1.0.3/contrib/holland.spec
$ rpmbuild -tb holland-1.0.3.tar.gz
...
Wrote: /home/agarner/redhat/RPMS/noarch/holland-1.0.3-2.noarch.rpm
Wrote: /home/agarner/redhat/RPMS/noarch/holland-common-1.0.3-2.noarch.rpm
Wrote: /home/agarner/redhat/RPMS/noarch/holland-example-1.0.3-2.noarch.rpm
Wrote: /home/agarner/redhat/RPMS/noarch/holland-random-1.0.3-2.noarch.rpm
Wrote: /home/agarner/redhat/RPMS/noarch/holland-mysqldump-1.0.3-2.noarch.rpm
Wrote: /home/agarner/redhat/RPMS/noarch/holland-mysqllvm-1.0.3-2.noarch.rpm
...
+ exit 0
~Andy
Oh, awesome! I guess rpm just does a find/search for a .spec... I though it had to be in the root dir. That is perfect.
Thanks Andy.
---
derks