Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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 was wondering if anyone had a good tutorial or "howto" regarding modifying SRPMs.
I searched on google and I found tons of stuff about building RPMs from scratch and that's not what I'm looking for (don't really care about building .spec files right now...)
Basically this is what I'm looking for...
Say package-example.rpm doesn't have --with-perl compiled in it. I would like to download package-example.src.rpm and use the rpmbuild command to add that option.
Does anyone know of a good tutorial for something like that?
Extract .src.rpm (see 'rpm2cpio') into tarball, patches (if any) and .spec file. Modify %configure line in .spec file, save, run rpmbuild on the new .spec file. Should be about it.
Extract .src.rpm (see 'rpm2cpio') into tarball, patches (if any) and .spec file. Modify %configure line in .spec file, save, run rpmbuild on the new .spec file. Should be about it.
Ok, cool. Seems pretty straight forward.
I'll run some some tests and will post if I have trouble.
Extract .src.rpm (see 'rpm2cpio') into tarball, patches (if any) and .spec file. Modify %configure line in .spec file, save, run rpmbuild on the new .spec file. Should be about it.
Quick question...
If I installed the src rpm....
example:
Code:
root@host# rpm -ivh package-example.src.rpm
Wouldn't that bypass the rpm2cpio step? Couldn't I just edit the spec file under /usr/src/redhat?
If I installed the src rpm.... (..) Wouldn't that bypass the rpm2cpio step?
Sure, but please make it a habit to build packages as unprivileged user. Building as root is: potentially unsafe (foreign code executed locally), potentially dangerous (use the wrong $RPM_BUILD_ROOT and see %clean "clean" your system pretty good), unnecessary (what *really* requires root rights anyway?).
Quote:
Originally Posted by custangro
Couldn't I just edit the spec file under /usr/src/redhat?
Sure, but please make it a habit to build packages as unprivileged user. Building as root is: potentially unsafe (foreign code executed locally), potentially dangerous (use the wrong $RPM_BUILD_ROOT and see %clean "clean" your system pretty good), unnecessary (what *really* requires root rights anyway?).
Sure.
Thanks, I didn't know that about building packages as root. Should I make a pseudo user for this?
No, you could use any unprivileged user that's allowed a login. Just copy over the directory structure: 'mkdir -p ~/redhat/{BUILD,SOURCES,RPMS,SPECS,SRPMS,tmp}' (you don't need ~/redhat/tmp but I like to confine all movement to ~/redhat/) and add a basic ~/.rpmmacros replacing $HOME with the actual value:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.