HOWTOFindMissingBuildRequires

From FedoraProject

Jump to: navigation, search

In package development and testing, please verify that your package is not missing any necessary Build Requires. Having proper build requirements saves the time of all developers and testers as well as autobuild systems because they will not need to search for missing build requirements manually. It is also a safety feature that prevents builds with that would not otherwise fail, but would be missing crucial features. For example, a graphical application may exclude PNG support after its configure script detects that libpng is not installed.

Before adding Build Requires to any package, please be aware of how HOWTOUseRequires.

fedora-rmdevelrpms is a suggested way for detecting missing Build Requires. It involves using a minimal build environment then adding only explicitly defined Build Requires in spec files. If the build fails or is missing certain features due to missing build dependencies, then the missing dependency needs to be found and added.

fedora-rmdevelrpms

fedora-rmdevelrpms script within the ["fedora-rpmdevtools"] toolkit is a script written by Ville Skytt� that helps RPM packagers in finding missing Build Requires. Simply run it and allow it to remove all *-devel packages and build tools like this example.

[root@build-fc1 /] fedora-rmdevelrpms
Found 52 devel packages:
guile-devel-1.6.4-8.2
bison-1.875-5
m4-1.4.1-14
flex-2.5.4a-30
openssl-devel-0.9.7a-23
automake-1.7.8-1
fontconfig-devel-2.2.1-6.1
XFree86-devel-4.3.0-42
tcl-devel-8.3.5-93
SDL_image-devel-1.2.3-3
SDL_ttf-devel-2.0.6-0.fdr.3.1
pth-devel-2.0.0-0.fdr.1.1
libIDL-devel-0.8.2-1
atk-devel-1.4.0-1
gtk2-devel-2.2.4-5.1
libmng-devel-1.0.4-4
glib-devel-1.2.10-11
gtk+-devel-1.2.10-28.1
audiofile-devel-0.2.3-7
compface-1.4-0.fdr.3.1
esound-devel-0.2.31-1
libungif-devel-4.1.0-16
gnome-libs-devel-1.4.1.2.90-35
openldap-devel-2.1.22-8
aspell-devel-0.50.3-16
gpgme03-devel-0.3.16-0.fdr.2.1
freeglut-devel-1.3-1.20020125.3
e2fsprogs-devel-1.34-1
db4-devel-4.1.25-14
krb5-devel-1.3.1-6
autoconf-2.57-3
libtool-1.5-8
gdbm-devel-1.8.0-21
freetype-devel-2.1.4-5
pkgconfig-0.14.0-6
ncurses-devel-5.3-9
tk-devel-8.3.5-93
SDL-devel-1.2.5-9
SDL_mixer-devel-1.2.4-9
zlib-devel-1.2.0.7-2
libgpg-error-devel-0.6-0.fr.3.1
glib2-devel-2.2.3-1.1
pango-devel-1.2.5-1.1
libjpeg-devel-6b-29
libpng-devel-1.2.2-17
ORBit-devel-0.5.17-10.3
clamav-devel-0.65-0.fdr.4.1
cyrus-sasl-devel-2.1.15-6
libtiff-devel-3.5.7-14
imlib-devel-1.9.13-14
gdk-pixbuf-devel-0.22.0-3.0
pilot-link-devel-0.11.8-1
Remove them? [y/N]  y
Removing.................................................................................................
................................................................Done.

Then attempt to build your RPM package. Use apt or yum to reinstall any packages that are already in Build Requires. If your build fails after this point, then you need to read through the build process and ascertain the missing Build Requires from the error messages within.

Be very careful to watch especially the configure part of the build process for missing optional libraries or tools that are desirable for the package.

By default, the script may attempt to remove some packages that your system needs to operate correctly. Usually, this will fail due to an unsatisfied dependency (and this, BTW is why the script is using rpm -e instead of apt-get -D remove...)

An example of this are the gettext and libgcj packages. gettext is usually a development-only package, but for example redhat-lsb depends on it. Also, it seems that RH9 Konqueror needs openssl-devel for SSL. If you wish to mark some packages so that they will be ignored by fedora-rmdevelrpms, do it in /etc/fedora/rmdevelrpms.conf or your personal ~/.rmdevelrpmsrc and pay special attention to the packages you treated this way when building.

Exceptions

There is no need to include the following packages or their dependencies as Build Requires because they would occur too often. These packages are considered the minimum build environment.

bash
bzip2
coreutils
cpio
diffutils
fedora-release (and/or redhat-release)
gcc
gcc-c++
gzip
make
patch
perl
rpm-build
redhat-rpm-config
sed
tar
unzip