How to create an rpm for an ordinary tar.gz file?
Hello everyone
I have some compressed (tar.gz) files that i need to get users to install on their servers but it becomes a pain some times to explain the command and where to uncompress it to. Is there a way to create an rpm of the files inside the tar.gz so that by just running rpm -ivh "file.rpm" it extracts them to the correct target destination. For example: rpm -ivh "www.rpm" will exact files inside rpm into /var/www Thanks in advance :) |
su
alien -r file.tar.gz .. will work on most rpm based Linux : .. when the file.tar.gz contains a directory tree like /var/www/files.. If you have no package 'alien' in your repo : http://kitenet.net/~joey/code/alien/ ..... |
Thank you very much for your reply, no we dont have alien installed and would not be abled to install it over quite a number of different servers.
Is is no way i can build an rpm just to extract files to a certain location? Especially as i may need to supply this rpm to red hat satalite servers so they can be used as a respositary based install. |
You need alien package only do compile the tar.gz's, once rpm's are created you do not need it.
To create rpms with rpmbuild, you need to create simple spec file first and use it to compile rpm. Check this tutorial and Maximum RPM tutorial. You can also check checkinstall utility. |
Thank you so much for you reply, i am little closer to my goal thanks to you, i ran the command
alien --to-rpm "file.tar.gz" which created an rpm which can be installed using rpm -ivh "file.rpm", but i dont know where it is installing it to? how can i tell alien "when creating the rpm" where i would like the rpm to get installed? for example i may want the files inside the rpm to be extracted to /usr/lib/"filename" or even /var/www/website Thanks again for your help, really appriciated |
Please read post # 2 again.
Make up a directory tree : var/www/<file> where <file> is the stuff, you want into /var/www/ and next : tar -cf new-package.tar var/ .. and do not write /var ! And : gzip new-package.tar .. getting new-package.tar.gz 1) su 2) alien -r new-package.tar.gz creates the same, but with suffix .rpm > > Easy to install anywhere with # rpm -Uvh <package>. ..... |
Quote:
Thanks to all you guys |
Hi all
I now need to run a simple bash script but would like to deploy and execute it using an rpm, is this also possible? Thanks in advance |
You can pack it inside rpm, and then use %post (or was it %postinstall ?) to run it immediately after rpm is installed. Check http://www.rpm.org/max-rpm/index.html for details
|
All times are GMT -5. The time now is 06:32 PM. |