Changes

Jump to navigation Jump to search
107 bytes added ,  00:30, 9 June 2015
Line 1: Line 1: −
Building RPMs is fairly easy to do, especially if you can get the software you are trying to package to build on its own. We assume here that you know how to build software from source. If you don't you probably shouldn't be starting with this document.
+
{{Level|Developer}}
 +
 
 +
===Introduction===
 +
 
 +
[http://www.sme-server.de/download/Howtos/build.html original author]<br />
 +
 
 +
Building RPMs is fairly easy to do, especially if you can get the software you are trying to package to build on its own. We assume here that you know how to build software from source. If you don't you probably shouldn't be starting with this document.
    
The basic procedure to build an RPM is as follows:
 
The basic procedure to build an RPM is as follows:
Line 14: Line 20:     
Under normal operation, RPM builds both binary and source packages.
 
Under normal operation, RPM builds both binary and source packages.
 +
 
===The Spec File===
 
===The Spec File===
   Line 169: Line 176:  
The next of the available macros is the %patch macro. This macro helps automate the process of applying patches to the sources. It takes several options, listed below:
 
The next of the available macros is the %patch macro. This macro helps automate the process of applying patches to the sources. It takes several options, listed below:
   −
    # will apply Patch# as the patch file.
+
* # will apply Patch# as the patch file.
   −
    -p # specifies the number of directories to strip for the patch(1) command.
+
* -p # specifies the number of directories to strip for the patch(1) command.
   −
    -P The default action is to apply Patch (or Patch0). This flag inhibits the default action and will require a 0 to get the main source file untarred. This option is useful in a second (or later) %patch macro that required a different number than the first macro.
+
* -P The default action is to apply Patch (or Patch0). This flag inhibits the default action and will require a 0 to get the main source file untarred. This option is useful in a second (or later) %patch macro that required a different number than the first macro.
   −
    You can also do %patch# instead of doing the real command: %patch # -P
+
You can also do %patch# instead of doing the real command: %patch # -P
   −
    -b extension will save originals as filename.extension before patching.  
+
* -b extension will save originals as filename.extension before patching.  
    
That should be all the macros you need. After you have those right, you can also do any other setup you need to do via sh type scripting. Anything you include up until the %build macro (discussed in the next section) is executed via sh. Look at the example above for the types of things you might want to do here.
 
That should be all the macros you need. After you have those right, you can also do any other setup you need to do via sh type scripting. Anything you include up until the %build macro (discussed in the next section) is executed via sh. Look at the example above for the types of things you might want to do here.
 +
 
===Build===
 
===Build===
   Line 233: Line 241:  
The format is simple. Start each new entry with a line with a * followed by the date, your name, and your email address. The date should appear in the same format that is output by:
 
The format is simple. Start each new entry with a line with a * followed by the date, your name, and your email address. The date should appear in the same format that is output by:
   −
date +"%a %b %d %Y"
+
date +"%a %b %d %Y"
 
        
 
        
    
The rest of the section is a free text field, but should be organized in some coherent manner.
 
The rest of the section is a free text field, but should be organized in some coherent manner.

Navigation menu