Re: Insert a %post into existing rpm?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I used rpmrebuild and it turned out to be very easy; can do it 
non-interactively on one line.
sudo rpmrebuild -p --change-spec-post="cat /home/daniel/post" 
intel-ifort91037-9.1.037-1.i386.rpm

And the contents of /home/daniel/post:
%post
for FILE in $(find $RPM_INSTALL_PREFIX/bin/ -regex '.*[ei](cc|fort|fc|
cpc)$\|.*cfg$\|.*pcl$\|.*vars[^/]*.c?sh$' 2> /dev/null) ; do
    sed s@\<INSTALLDIR\>@$RPM_INSTALL_PREFIX@g $FILE > ${FILE}.abs
    mv ${FILE}.abs $FILE
    chmod 755 $FILE
done
<snip other similar for loops>

Seems to work whether installing with the default prefix or overwriting with 
rpm --prefix=/bla.  Thanks Valery!

I submitted a support request to Intel in 2003 about this and got nowhere.  
Hopefully by giving them the working spec file and a blurb about simplifying 
their management I'll get somewhere this time around ;).

Mats the install script does ask some questions up front.  In the Fortran 
installation it gets us to accept a licence agreement before letting us 
override the default installation directory.  The change to the rpm file is 
compatible with that.  The C++ compiler is just as easy as well, but I'm not 
sure about the IDE that goes with the C++ compiler, as I don't use it.

BTW I didn't want to use triggers because I also intend to convert the rpms to 
deb format as we have a mix of Fedora and Debian machines.  Alien converts it 
fine, except it doesn't do anything with RPM_INSTALL_PREFIX.  Something else 
to work on....

Thanks all.
Daniel.


---------------------------------------------------------------------
Dr. Daniel Grimwood                   Room : 303.201
Nanochemistry Research Institute      Email: reaper@xxxxxxxx
Curtin University of Technology       Phone: +61 8 9266 3780
P.O. Box U 1987, Perth                Phone: +61 8 6436 8920
Western Australia, 6845 Australia     Fax  : +61 8 9266 4699

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux