Blame doc/manual/builddependencies

2ff057
/*! \page builddependencies Generating build dependencies automatically
2ff057
2ff057
As we start updating packages for the next Red Hat distro, I'd like to see
2ff057
packages start to make use of build dependencies. Basically build
2ff057
dependencies are just like install dependencies, but they are resolved
2ff057
against the build system just after parsing the spec file. Syntactically,
2ff057
build dependencies look just like install dependencies in a spec file with
2ff057
"Build" prefixed:
2ff057
2ff057
\verbatim
2ff057
	BuildPreReq:
2ff057
	BuildRequires:
2ff057
	BuildConflicts:
2ff057
\endverbatim
2ff057
2ff057
All the above dependencies include versions, files, existence/range tests, etc.
2ff057
The build dependency checking can also be turned off with --nodeps if necessary
2ff057
just like install dependency checking can. Eventually, build dependencies will
2ff057
be automated in rpm, but the major impediment to that effort is the engineering
2ff057
required to maintain the pretense that src rpm's are "noarch".
2ff057
2ff057
Meanwhile, I've added a package called "InDependence-1.0" to powertools-6.2
2ff057
that may be of use in detecting build dependencies that can be added to
2ff057
spec files as part of rebuilding packages for Red Hat 6.2.
2ff057
2ff057
Here's a short example of how to generate the package/file names that were used
2ff057
while building gnorpm using InDependence:
2ff057
2ff057
\verbatim
2ff057
	rpm -U /mnt/redhat/comps/powertools/6.2/i386/InDependence-1.0-3.i386.rpm
2ff057
	rpm -i /mnt/redhat/comps/dist/6.2/SRPMS/gnorpm-0.9-11.src.rpm
2ff057
	cd /usr/src/redhat/SPECS
2ff057
	dep -detail rpmbuild -ba gnorpm.spec >& xxx
2ff057
	...
2ff057
	(the build will take longer since both dep and strace are pigs)
2ff057
	...
2ff057
	grep -- '::' xxx > yyy
2ff057
\endverbatim
2ff057
2ff057
\verbatim
2ff057
Aside:	The dep perl wrapper is a "pig" only because it's exec'ing
2ff057
		rpm -qf <filename>
2ff057
        in order to turn filenames into package names. There are easier/faster
2ff057
	ways to get this information...
2ff057
2ff057
	There's no way to speed up the
2ff057
		/sbin/strace -q -etrace=open,execve -o ...
2ff057
	command itself. The eventual implementation in rpm will snatch the
2ff057
	same open/execve syscalls using LD_PRELOAD.
2ff057
2ff057
	Patches cheerfully accepted :-)
2ff057
\endverbatim
2ff057
2ff057
Here's what's in yyy (\<packagename\>::\<filename\> format):
2ff057
2ff057
\verbatim
2ff057
	ORBit-devel-0.4.95-2::/usr/bin/orbit-config 
2ff057
	XFree86-libs-3.3.5-6::/usr/X11R6/lib/libICE.so.6 
2ff057
	XFree86-libs-3.3.5-6::/usr/X11R6/lib/libSM.so.6 
2ff057
	XFree86-libs-3.3.5-6::/usr/X11R6/lib/libX11.so.6 
2ff057
	XFree86-libs-3.3.5-6::/usr/X11R6/lib/libXext.so.6 
2ff057
	audiofile-0.1.9-1::/usr/lib/libaudiofile.so.0 
2ff057
	autoconf-2.13-5::/usr/bin/autoconf 
2ff057
	autoconf-2.13-5::/usr/bin/autoheader 
2ff057
	autoconf-2.13-5::/usr/share/autoconf/acgeneral.m4 
2ff057
	autoconf-2.13-5::/usr/share/autoconf/autoconf.m4f 
2ff057
	automake-1.4-5::/usr/bin/aclocal 
2ff057
	automake-1.4-5::/usr/bin/automake 
2ff057
	bash-1.14.7-16::/bin/sh 
2ff057
	bash-1.14.7-16::/etc/bashrc 
2ff057
	binutils-2.9.1.0.23-7::/usr/bin/strip 
2ff057
	binutils-2.9.1.0.23-7::/usr/lib/libbfd-2.9.1.0.24.so 
2ff057
	binutils-2.9.1.0.23-7::/usr/lib/libopcodes-2.9.1.0.24.so 
2ff057
	bzip2-0.9.5c-1::/usr/lib/libbz2.so.0 
2ff057
	dev-2.7.10-2::/dev/null 
2ff057
	diffutils-2.7-16::/usr/bin/cmp 
2ff057
	egcs-1.1.2-25::/usr/bin/gcc 
2ff057
	egcs-1.1.2-25::/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs 
2ff057
	esound-0.2.14-1::/usr/lib/libesd.so.0 
2ff057
	file-3.27-3::/usr/bin/file 
2ff057
	file-3.27-3::/usr/share/magic 
2ff057
	fileutils-4.0-8::/bin/chgrp 
2ff057
	fileutils-4.0-8::/bin/chmod 
2ff057
	fileutils-4.0-8::/bin/chown 
2ff057
	fileutils-4.0-8::/bin/cp 
2ff057
	fileutils-4.0-8::/bin/ln 
2ff057
	fileutils-4.0-8::/bin/ls 
2ff057
	fileutils-4.0-8::/bin/mkdir 
2ff057
	fileutils-4.0-8::/bin/mv 
2ff057
	fileutils-4.0-8::/bin/rm 
2ff057
	fileutils-4.0-8::/usr/bin/install 
2ff057
	findutils-4.1-32::/usr/bin/xargs 
2ff057
	gawk-3.0.4-1::/bin/awk 
2ff057
	gawk-3.0.4-1::/bin/gawk 
2ff057
	gettext-0.10.35-13::/usr/bin/xgettext 
2ff057
	glib-1.2.5-1::/usr/lib/libglib-1.2.so.0 
2ff057
	glib-1.2.5-1::/usr/lib/libgmodule-1.2.so.0 
2ff057
	glib-devel-1.2.5-1::/usr/bin/glib-config 
2ff057
	glibc-2.1.2-13::/etc/localtime 
2ff057
	glibc-2.1.2-13::/etc/nsswitch.conf 
2ff057
	glibc-2.1.2-13::/lib/ld-linux.so.2 
2ff057
	glibc-2.1.2-13::/lib/libc.so.6 
2ff057
	glibc-2.1.2-13::/lib/libcrypt.so.1 
2ff057
	glibc-2.1.2-13::/lib/libdb.so.2 
2ff057
	glibc-2.1.2-13::/lib/libdl.so.2 
2ff057
	glibc-2.1.2-13::/lib/libm.so.6 
2ff057
	glibc-2.1.2-13::/lib/libnsl.so.1 
2ff057
	glibc-2.1.2-13::/lib/libnss_dns.so.2 
2ff057
	glibc-2.1.2-13::/lib/libnss_files.so.2 
2ff057
	glibc-2.1.2-13::/lib/libnss_nis.so.2 
2ff057
	glibc-2.1.2-13::/lib/libnss_nisplus.so.2 
2ff057
	glibc-2.1.2-13::/lib/libresolv.so.2 
2ff057
	glibc-2.1.2-13::/usr/bin/ldd 
2ff057
	gnome-libs-1.0.54-1::/usr/lib/libart_lgpl.so.2 
2ff057
	gnome-libs-1.0.54-1::/usr/lib/libgnome.so.32 
2ff057
	gnome-libs-1.0.54-1::/usr/lib/libgnomesupport.so.0 
2ff057
	gnome-libs-1.0.54-1::/usr/lib/libgnomeui.so.32 
2ff057
	gnome-libs-devel-1.0.54-1::/usr/bin/gnome-config 
2ff057
	grep-2.3-2::/bin/egrep 
2ff057
	grep-2.3-2::/bin/fgrep 
2ff057
	grep-2.3-2::/bin/grep 
2ff057
	gtk+-1.2.5-2::/usr/lib/libgdk-1.2.so.0 
2ff057
	gtk+-1.2.5-2::/usr/lib/libgtk-1.2.so.0 
2ff057
	imlib-1.9.7-1::/usr/lib/libgdk_imlib.so.1 
2ff057
	libghttp-1.0.4-1::/usr/lib/libghttp.so.1 
2ff057
	libtool-1.3.3-1::/usr/bin/libtoolize 
2ff057
	libtool-1.3.3-1::/usr/share/libtool/config.guess 
2ff057
	libtool-1.3.3-1::/usr/share/libtool/config.sub 
2ff057
	libtool-1.3.3-1::/usr/share/libtool/ltconfig 
2ff057
	libtool-1.3.3-1::/usr/share/libtool/ltmain.sh 
2ff057
	libxml-1.4.0-1::/usr/lib/libxml.so.1 
2ff057
	libxml-devel-1.4.0-1::/usr/bin/xml-config 
2ff057
	m4-1.4-12::/usr/bin/m4 
2ff057
	make-3.77-6::/usr/bin/make 
2ff057
	mktemp-1.5-1::/bin/mktemp 
2ff057
	net-tools-1.53-1::/bin/hostname 
2ff057
	patch-2.5-9::/usr/bin/patch 
2ff057
	rootfiles-5.2-5::/root/.bashrc 
2ff057
	rpm-3.0.4-0.16::/bin/rpm 
2ff057
	rpm-3.0.4-0.16::/usr/lib/librpm.so.0 
2ff057
	rpm-3.0.4-0.16::/usr/lib/rpm/find-provides 
2ff057
	rpm-3.0.4-0.16::/usr/lib/rpm/find-requires 
2ff057
	rpm-3.0.4-0.16::/usr/lib/rpm/macros 
2ff057
	rpm-3.0.4-0.16::/usr/lib/rpm/rpmpopt 
2ff057
	rpm-3.0.4-0.16::/usr/lib/rpm/rpmrc 
2ff057
	sed-3.02-4::/bin/sed 
2ff057
	setup-2.0.5-1::/etc/group 
2ff057
	setup-2.0.5-1::/etc/host.conf 
2ff057
	setup-2.0.5-1::/etc/passwd 
2ff057
	sh-utils-2.0-1::/bin/basename 
2ff057
	sh-utils-2.0-1::/bin/false 
2ff057
	sh-utils-2.0-1::/bin/sleep 
2ff057
	sh-utils-2.0-1::/bin/true 
2ff057
	sh-utils-2.0-1::/usr/bin/expr 
2ff057
	sh-utils-2.0-1::/usr/bin/id 
2ff057
	texinfo-3.12h-2::/usr/bin/makeinfo 
2ff057
	textutils-2.0-2::/bin/cat 
2ff057
	textutils-2.0-2::/bin/sort 
2ff057
	textutils-2.0-2::/usr/bin/cut 
2ff057
	textutils-2.0-2::/usr/bin/tr 
2ff057
	zlib-1.1.3-5::/usr/lib/libz.so.1 
2ff057
\endverbatim
2ff057
2ff057
The information can be used to generate build prerequisites. What is still
2ff057
needed is a sensible approach on
2ff057
2ff057
\verbatim
2ff057
	1) eliminating obvious common dependencies (e.g. libtool, egcs).
2ff057
	2) identifying (and removing for now) per-platform build dependencies.
2ff057
	3) deciding on whether to add the build dependency on a file or on the
2ff057
	package that contains the file.
2ff057
	4) if adding a dependency on a package, choosing version ranges as
2ff057
	appropriate.
2ff057
\endverbatim
2ff057
2ff057
but that's up to individual packagers.
2ff057
2ff057
*/