setup.py examples?

Complete walkthrough of writing setup.py scripts here. (with some examples) If you’d like a real-world example, I could point you towards the setup.py scripts of a couple major projects. Django’s is here, pyglet’s is here. You can just browse the source of other projects for a file named setup.py for more examples. These aren’t simple … Read more

rpm without root

Depending on the contents of the package you could simply extract the contents of the rpm and use it from somewhere withing your home directory. Even if it isn’t flagged as relocatable. If binaries in the package have hard-coded paths, or if the application requires root access then it may not be possible.

Why is it bad to build RPMs as root?

Badly written RPM .spec files (or even well-written ones with a typo) can do improper things such as: Install directly to the running system instead of to a sandbox Leave junk on the filesystem Accidentally run nasty commands such as: rm -rf ${RPM_BUILD_ROOT} There is no part of the RPM build process that actually needs … Read more

Do .rpm files have metadata

They have lots of metadata. Use -qp to target the package file and –qf to specify which metadata you’re interested in. $ rpm -qp /var/cache/yum/x86_64/16/fedora/packages/db4-4.8.30-3.fc15.i686.rpm –qf “%{name}: %{buildhost}\n” db4: x86-10.phx2.fedoraproject.org rpm –querytags will show you the metadata tags.

Python 3.0 RPMs for CentOS 5 (RHEL 5)

You can try package from ActiveState http://www.activestate.com/activepython/downloads. It doesn’t depend on package manager (just unpack and run “install.sh”). Or you can compile Python and create package by yourself Here is how to create RPM by yourself: http://www.ibm.com/developerworks/library/l-rpm1 http://www.tldp.org/HOWTO/RPM-HOWTO/ Here is how you can compile it: ./configure make make test sudo make install # or “make … Read more

Creating symlink in /usr/bin when creating an RPM

ln -sf /opt/bupc2.8/bin/upcc ${RPM_BUILD_ROOT}/%{_bindir} The link needs to be created in the %build section and it also needs to point to where you’re installing the RPM. Before creating the link make sure that the destination directory exists, i.e. ${RPM_BUILD_ROOT}/%{_bindir}. You can use mkdir or install -d for this.

How can I find what options an rpm was compiled with

Well, the closest thing you can do (that I’m aware of) is to query the OPTFLAGS variable of the exim package: [root@fedora11 ~]# rpm -q –queryformat=”%{NAME}: %{OPTFLAGS}\n” exim exim: -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic [root@fedora11 ~]# You’ll get better answer, however, if you download the source rpm of exim (rpm … Read more