Post thumbnail of Useful rpmbuild macros
3 December 2010
Continue reading Useful rpmbuild macros

Useful rpmbuild macros

Utilizing macros can make life easier when you’re dealing with building on, and for, multiple platforms. Why bother with hard-coding full paths to system utilities when you can simply refer to them by their macro name? These can also be useful for avoiding things like rpm check-files errors, installed (but unpackaged) file(s) found, and debuginfo related stuff.

Post thumbnail of Build source rpms with Mock to avoid compiler problems
2 December 2010
Continue reading Build source rpms with Mock to avoid compiler problems

Build source rpms with Mock to avoid compiler problems

If you’ve ever run into a dreaded configure problem such as C compiler cannot create executables, and gotten lost in a tangle of glibc/cc/g++ packages, you might find that building source rpms using Mock turns a multi-step process into a breezy single step. Build source rpms using mock which builds inside a chroot. This lets you compile 32-bit on 64-bit without a problem. Check out mock configurations in etc. You may have preconfigured configurations for your Linux distribution.

Post thumbnail of Automate rpmbuilds from spec files including name-version-build info automatically
28 June 2010
Continue reading Automate rpmbuilds from spec files including name-version-build info automatically

Automate rpmbuilds from spec files including name-version-build info automatically

Start the spec file with %define statements at the top. Continue the spec file as you would normally, using the variables you just defined in place of the real name, version, build. Create an rpmbuild script that replaces the template variables with current information. Make an rpm target in your Makefile that calls the rpmbuild script.

Post thumbnail of Rpmmacros variables affecting rpmbuild portability
14 June 2010
Continue reading Rpmmacros variables affecting rpmbuild portability

Rpmmacros variables affecting rpmbuild portability

Defining things like %_topdir and %_smp_mflags for all your rpmbuilds can be done in the hidden rpmmacros file in your build user’s home directory. The problem is portability. If you define unnecessary things such as %_tmppath, and try to use it in your spec files, everything will work fine until the day you or someone else attempts to build without having their rpmmacros set up quite the same way.

Post thumbnail of Build noarch RPM packages when architecture matters not
1 June 2010
Continue reading Build noarch RPM packages when architecture matters not

Build noarch RPM packages when architecture matters not

With rpmbuild, you can make custom packages for any architecture, but what if there’s no difference between the architectures in what you’re building. If you’re copying around something like scripts, docs or other text files that have nothing to do with 32 vs 64 bit or endianness, it’s easier and more efficient to create a single noarch package and just keep one copy of it in a repository.

Post thumbnail of Rpmbuild check-rpaths can break spec files
20 January 2010
Continue reading Rpmbuild check-rpaths can break spec files

Rpmbuild check-rpaths can break spec files

Rpmbuild’s RPATH feature is used to search libraries outside of standard paths. They are given to the linker at buildtime. If the developers of the code you’re trying to turn into an RPM did not take any of these considerations into account when they write their programs then you may be forced to skip check-rpath.

Post thumbnail of Building qpidc AMQP C++ libraries on ppc
24 November 2009
Continue reading Building qpidc AMQP C++ libraries on ppc

Building qpidc AMQP C++ libraries on ppc

Wow, there are a crap load of dependencies to build qpid, the AMQP client/server libraries for C++! What do you mean my architecture isn’t supported? Bah, whatever… Add ppc to the list or rip it out for now. Just build it and stop complaining!

Post thumbnail of How to avoid stripping when building RPMs
21 April 2009
Continue reading How to avoid stripping when building RPMs

How to avoid stripping when building RPMs

I’ve found 3 ways to disable the strip binary option when building RPMs.

Powered by Wordpress   |   Lunated designed by ZenVerse