Mailing List
Home
Linux - General Red Hat Linux discussion list
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Installation - Getting started with Red Hat Linux
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
sendmail configuration on redhat
Couldn 't open PID file /var/run/named/named pid Permission denied
Promise 378 controller
kernel 2 6 and /dev/sound/mixer not found
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
Lotus Notes under Wine
/etc/security/limits conf question
Intel E/1000 driver
Command stream end of file while reading
rpm database corrupt
qla2300 modules
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
RPM Build ?? My rpm does nothing :(

RPM Build ?? My rpm does nothing :(

2005-03-24       - By Stuart

 Back
Reply:     1     2     3     4  

On Thursday 24 March 2005 17:54, Michael Gale wrote:
> Hello,
>
> I just ran rpm -qpl nrpe-2.0-1.src.rpm and it says that it does not
> contain files.
This is because it doesn't.
your %files section in your .spec file does not list any files at all.
This is the list that rpm uses to decide which files to package...
but apart from this there are a few more serious points to consider.
1. You are building your rpm as root.
this is a Very Bad Thing, particularly in your case, as you have made a
couple
of quite serious errors in your spec file that with a more complex
package
could cause major system damage.
you should build as a non-privileged user.
this means that you
a) create a ~/.rpmmacros file which contains a line like
%_topdir /home/stuart/REDHAT
b) you then create the directory mentioned above and a few
subdirectories:
mkdir -p /home/stuart/REDHAT/{RPMS,SRPMS,BUILD,SOURCES,SPECS}
you then put the spec/source files into these directories and work
there. This
limits the damage you can do to your system with a badly written .spec
file
2. you misunderstand (slightly) how the rpm build process works.
This may be because you have made some simple assumptions about it.
There is
very good guide to doing this on http://freshrpms.net somewhere.
Perhaps
someone else can supply the complete URL for you.
I'll show you the part of your spec file that makes me think this:
# -- extract from spec file
>%prep
>%setup
>./setup-nrpe.sh
why not the ./configure options that are (presumably) included in the
setup
script? RPM is designed to do these things for you.
incidentally, what precisely does ./setup-nrpe.sh do?

>%build
>make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
fine

>%install
>rm -rf $RPM_BUILD_ROOT
also ok, but usually done in a %clean section

>install -s -m 755 src/nrpe /home/nrpe/nrpe
>chown nrpe:nrpe /home/nrpe/nrpe
>install -m 644 nrpe.cfg-rpminstall /home/nrpe/nrpe.cfg
>install -s -m 755 nrpe.init-script /etc/rc.d/init.d/nrpe
these are the main issues - you are copying files *directly*
into /home
and /etc (etc) with these commands.
what you *should* be doing is something like this:
mkdir -p $RPM_BUILD_ROOT/home/nrpe/nrpe
install -s -m 755 src/nrpe $RPM_BUILD_ROOT/home/nrpe/nrpe
etc etc.
This is because an rpmbuild does a chrooted install into its buildroot
and
expects to find files to package under there.
doing it the way that you have copies files straight into your live
fileystem, probably overwriting any that were already there with the
same name
doing this as root is extremely hazardous to your system's health.

>ln -s /etc/rc.d/init.d/nrpe /etc/rc.d/rc3.d/nrpe
you should really create a chkconfig-compliant init script and add it as
part
of a %post scripts in your rpm .spec file. You should also realise that
this
script will never actually run as it is not called (something like)
S88nrpe.
you would also need to add the user nrpe in a %pre script, or their
home
directory will not exist *unless* you create it before you install the
rpm
package you are building. This means your rpm will only install on some
systems and not on others...
>%clean
>rm -rf $RPM_BUILD_ROOT

>%files
>%defattr(-,root,root)
Assuming that you install into the $RPM_BUILD_ROOT as designed, this
should be
a list of the files you want packaged with the
RPM_BUILD_ROOT stripped from their paths, ie in your case
%files
%defattr(-,root,root)
/home/nrpe/nrpe
/home/nrpe/nrpe.cfg
/etc/rc.d/init.d/nrpe
bearing in mind that with you %defattr line you have changed the
ownership on
all of these files to root:root!


> On Thu, 2005-03-24 at 10:48 -0700, Michael Gale wrote:
> > Hello,
> >
> > I am trying to build a package for nrpe-2.0, I was following the
> > instructions at http://www.rpm.org/RPM-HOWTO/build-it.html.
I would also recommend you look at the RPM articles written by Chip
Turner in
past editions of the Red hat Magazine
http://www.redhat.com/magazine/002dec04/ (and also issue 1 if you can
find
it)
and http://www.rpm.org/max-rpm
which is rather out of date but there are links to updated CVS versions.

HTH

Stuart
--
Stuart Sears RHCE, RHCX, RTFM, ASAP
A businessman is a hybrid of a dancer and a calculator.
    -- Paul Valery


--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@(protected)?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list