- rpm --rebuilddb: fixes a corrupted databse used by the rpm program (just a note)
- rpmbuild {-ba|-bb|-bp|-bc|-bi|-bl|-bs} [rpmbuild-options] SPECFILE ...
(from the info page)
The build modes of rpm are now resident in the /usr/bin/rpmbuild exe-
cutable. Although legacy compatibility provided by the popt aliases
below has been adequate, the compatibility is not perfect; hence build
mode compatibility through popt aliases is being removed from rpm.
Install the rpmbuild package, and see rpmbuild(8) for documentation of
all the rpm build modes previously documented here in rpm(8).
Add the following lines to /etc/popt if you wish to continue invoking
rpmbuild from the rpm command line:
rpm exec --bp rpmb -bp
rpm exec --bc rpmb -bc
rpm exec --bi rpmb -bi
rpm exec --bl rpmb -bl
rpm exec --ba rpmb -ba
rpm exec --bb rpmb -bb
rpm exec --bs rpmb -bs
[root@www SPECS]# rpmbuild openssh.spec
[root@www SPECS]# rpmbuild -bb openssh.spec (builds like rpm -bb)
- rpm --showrc -- >lists the /usr/lib/rpm/rpmrc file, file which sets the configuration features of rpm
- [root@www SPECS]# rpm -q --scripts openssh-server
preinstall scriptlet (through /bin/sh):
/usr/sbin/useradd -c "Privilege-separated SSH" -u 74 \
-s /sbin/nologin -r -d /var/empty/sshd sshd 2> /dev/null || :
postinstall scriptlet (through /bin/sh):
/sbin/chkconfig --add sshd
preuninstall scriptlet (through /bin/sh):
if [ "$1" = 0 ]
then
/sbin/service sshd stop > /dev/null 2>&1 || :
/sbin/chkconfig --del sshd
fi
postuninstall scriptlet (through /bin/sh):
/sbin/service sshd condrestart > /dev/null 2>&1 || :
- another way to specify the prefix
$ rpm -ba --define 'prefix /opt/rtems/binutils-2.13.2.1-gcc-
3.2.1-newlib-1.11.0' --define 'gnat 0' --define 'gcj 0'
powerpc-rtems-gcc-3.2.1-newlib-1.11.0.spec
actually, that doesn't work just edit /var/lib/macros ... including the one in the i686 direcotry
- defining config options to rpmbuild script
Take the following example:
rpmbuild --define 'config_options --with-gm=/opt/gm' --rebuild ...
Note the single quotes after --define; --define only takes one
argument. That argument is later parsed by the specfile parser.
Hence, you put both the key and value in a single shell argument
enclosed in quotes.
This is effectively the same as having the following line in your
specfile:
%define config_options --with-gm=/opt/gm
So how is this useful, and how does this accomplish my above-stated
making the spec file
postun
source: openssh.spec
%postun
if [ $1 = 0 ]; then
stop services and maybe do some cleanup
fi
post
source: openssh.spec
%post server
/sbin/chkconfig --add sshd
%postun server
/sbin/service sshd condrestart > /dev/null 2>&1 || :
return to top