LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to create rpm package (.sh file to rpm package) (https://www.linuxquestions.org/questions/linux-software-2/how-to-create-rpm-package-sh-file-to-rpm-package-4175450749/)

kirthan 02-19-2013 12:54 AM

How to create rpm package (.sh file to rpm package)
 
Hi
i have created backup.sh file , I want this to create as a rpm installation package .please help me out how to do this ?

fortran 02-19-2013 01:41 AM

You are not clear enough.
Do you want to make a shell script which will install RPM package?
Same as you install it on terminal.
Code:

$ rpm -ivh file.rpm
Take a look here

knudfl 02-19-2013 04:35 AM

Setting up the rpm-build environment in /home/<name>/ :
# 13 http://www.linuxquestions.org/questi...1-a-766486/#13

Simplified build example :
$ mkdir -p rpms/BUILDROOT/script-1.0-1.i386/usr/bin/
.. and copy the script.sh to rpms/BUILDROOT/script-1.0-1.i386/usr/bin/

Write a "script.spec". This is my tested example :
Code:

Summary:  None
Name:      script
Version:  1.0
Release:  1
License:  GPL
Group:    None         
Packager:  Jerry Donut <jerry@donut.com>
BuildArchitectures: i386
BuildRoot: /home/knudfl/rpms/BUILDROOT/script-1.0-1.i386

%description
No description

%files
/usr/bin/script.sh

.. Then run $ rpmbuild -bb script.spec
.. And the rpm package 'script-1.0-1.i386.rpm' is created.

.


All times are GMT -5. The time now is 02:01 AM.