Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'd like to rebuild (from source RPM) a few RHEL 5 Nagios-plugins found in the EPEL repo. Examples of such plugins are "nagios-plugins-load" and "nagios-plugins-disk".
The only relevant source RPM I've found is the "nagios-plugins" package. This package seems to include all plugins. Should I use this package to build the above mentioned plugins? If so, does anyone know how to stip the spec file down to just a selected few plugins? I'm quite new to building RPMs, and could use some guidance.
Regards,
kenneho
PS. I posted this on the red hat mailing list, but since I didn't get any replies I'm posting it here.
I've actually allready tried to strip down the spec file to include only a selected few plugins, but with no luck - there seems to be a lot of details in there that causes problems. Would you guys mind looking through the attached file, and give me some pointers to what can be removed? In my modified versions of this file I've removed a lot of lines from the "packages" and "files" sections, and some from the "install" section, but I still have problems..
If you want only those two plugins, wouldn't it be easier to D/L the plugin sources from the Nagios plugins exchange site and RPM-ify those?
I'm sure it would, but I'd prefer to use the (source) packages found in EPEL, and as far as I can see the only relevant Nagios source package there is the "nagios-plugins" source...
I've decided to go for kirukan's advice, and compile the whole package. Now I'm getting a very strange error:
Code:
error: Could not open /home/rpmbuild/SRPMS/nagios-plugins-1.4.13-11.src.rpm: No such file or directory
Why is the build process expecting to find the source RPM there? And second: The source RPM I'm compiling _from_ has a slightly different name, as it has "el5" in there somewhere. Anyone knows why the build process is looking for the source RPM in the first place, and why it's looking for the wrong RPM in a directory that doesn't exists?
Sorry if these are very basic questions, but I'm new to the RPM building process..
Why is the build process expecting to find the source RPM there? And second: The source RPM I'm compiling _from_ has a slightly different name, as it has "el5" in there somewhere. Anyone knows why the build process is looking for the source RPM in the first place, and why it's looking for the wrong RPM in a directory that doesn't exists?
Rebuilding from a .src.rpm should be as easy as 'rpmbuild --rebuild /path/to/nagios-plugins-1.4.13-11.src.rpm'. Since you didn't show us what you actually did and my ESP is way low only guessing remains.
Quote:
Originally Posted by kenneho
Sorry if these are very basic questions, but I'm new to the RPM building process..
I guess it's time for me to elaborate a bit on what I'm acutally doing.
I'm playing around with RHEL 5 on IBM System Z (mainframe), also known as z/Linux. We use Nagios on our existing x86 infrastructure, and would like to be using Nagios on z/Linux. And we'd prefer to fetch everything from EPEL.
So I've fetched the package nagios-plugins-1.4.13-11.el5.src.rpm from EPEL, and would like to compile it on z/Linux. I guess I have these options:
Modify the specs-file to complie only the plugins I'm gonna use
Compile the whole source code, and extract only the wanted plugins
Don't know if this would work, but I could possibly extract the plugins from a running x86 instance, but this would only work for scripts (and not compiled plugins).
This is what I've done so far:
Regarding modifying the specs-file: I've tried to comment out as much as possible from the specs file, hoping that I'd end up with only the plugins I want. But this has proven more difficult than I expected. I can provide more details if needed.
Compiling the whole source code by issuing "rpmbuild --rebuild <package>" leaves me with these errors:
Code:
error: Failed build dependencies:
/usr/sbin/fping is needed by nagios-plugins-1.4.13-11.s390x
perl(Net::SNMP) is needed by nagios-plugins-1.4.13-11.s390x
radiusclient-ng-devel is needed by nagios-plugins-1.4.13-11.s390x
/usr/bin/qstat is needed by nagios-plugins-1.4.13-11.s390x
These packages doesn't seem to exist in the offical RHEL repo, which is the only repo for z/Linux I know about. They exist in EPEL, but I beilieve that woun't help me much...
So I think that my best option is alternative 1, modifying the specs file...
There's another solution being somewhat similar to post #5: if you extract the .src.rpm, configure the extracted tarball and run 'make check_load' in the plugins directory you'll see it requires making in ../lib, running 'make check_load' again shows it requires making in ../gl as well. Since neither check_load or check_disk (your OP examples) requires anything else in the sense of build or installation dependencies the .src.rpm requires, 'make -n install' should then show you you could adapt %install in terms of install commands, and manual pages, examples or docs to be copied over and how to fill %files. If you agree that is a usable and efficient approach, figure out the configure, make and install commands you need, supply any .spec specs you require plus a files listing and we'll build you a .spec file based on that.
There's another solution being somewhat similar to post #5: if you extract the .src.rpm, configure the extracted tarball and run 'make check_load' in the plugins directory you'll see it requires making in ../lib, running 'make check_load' again shows it requires making in ../gl as well. Since neither check_load or check_disk (your OP examples) requires anything else in the sense of build or installation dependencies the .src.rpm requires, 'make -n install' should then show you you could adapt %install in terms of install commands, and manual pages, examples or docs to be copied over and how to fill %files. If you agree that is a usable and efficient approach, figure out the configure, make and install commands you need, supply any .spec specs you require plus a files listing and we'll build you a .spec file based on that.
Thanks for the suggestion. I've tried to follow your repecipe, but got stuck at the "make -n install" part - I'm not sure what to include in the specs-file's %install section. I've piped the output of "make -n install" to a file and attached it. Could you please take a quick look and advice me on what to look for?
vi +342 make_install.out.txt
This should be in your %install section
Code:
echo "%%install"
mkdir -p -- "${RPM_BUILD_ROOT}/usr/lib64/nagios/plugins"
echo "%%files"
echo "%%defattr(-,root,root)"
list='check_disk check_load'; for p in $list; do
/usr/bin/install -m 0755 "$p" "${RPM_BUILD_ROOT}/usr/lib64/nagios/plugins/$p"
echo "%%attr(755,root,root) /usr/lib64/nagios/plugins/$p"
done
- I didn't see no docs for the %doc section
- The echoes should give you an idea what should be in your %files section
- IIRC I have to double the percent signs else it gets interpreted in the .spec file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.