Changes

From SME Server
Jump to navigationJump to search
m
Addd for clarity
Line 32: Line 32:  
==== Getting the source code ====
 
==== Getting the source code ====
 
In this How-To we want to work on the package 'e-smith-base'. We first need to download (with CVS this is called retrieving) the code for 'e-smith-base' from the SME Server CVS repository at SourceForge. For this issue the following command:
 
In this How-To we want to work on the package 'e-smith-base'. We first need to download (with CVS this is called retrieving) the code for 'e-smith-base' from the SME Server CVS repository at SourceForge. For this issue the following command:
 +
cd ~/smeserver
 
  cvs -z3 -d:pserver:anonymous@smeserver.cvs.sourceforge.net:/cvsroot/smeserver checkout -P e-smith-base
 
  cvs -z3 -d:pserver:anonymous@smeserver.cvs.sourceforge.net:/cvsroot/smeserver checkout -P e-smith-base
   Line 57: Line 58:  
Now we can make the changes or edit the source code in e-smith-base-5.2.0.
 
Now we can make the changes or edit the source code in e-smith-base-5.2.0.
   −
For a simple test you can edit the 'e-smith-base-5.2.0/root/sbin/e-smith/console' file and add something to the header.
+
For a simple test you can edit the SME8 'e-smith-base-5.2.0/root/sbin/e-smith/console' file and add something to the header.
 +
 
 +
cd ~/smeserver/rpms/e-smith-base/sme8
 
  nano -w e-smith-base-5.2.0/root/sbin/e-smith/console
 
  nano -w e-smith-base-5.2.0/root/sbin/e-smith/console
   Line 86: Line 89:     
== Create a patch ==
 
== Create a patch ==
When we have finished our editing of the source code (see above example), we can create a patch. (a file that contains the differences between the original file and the file we have been working on). To create the patch issue the following command:  
+
When we have finished our editing of the source code (see above example), we can create a patch. (a file that contains the differences between the original file and the file we have been working on). To create the patch issue the following command:
 +
 +
cd ~/smeserver/rpms/e-smith-base/sme8
 
  diff -urN e-smith-base-5.2.0.old e-smith-base-5.2.0 > e-smith-base-5.2.0-test.patch
 
  diff -urN e-smith-base-5.2.0.old e-smith-base-5.2.0 > e-smith-base-5.2.0-test.patch
   Line 95: Line 100:  
First we will update the spec file. Spec files are text files that contain RPM directives and macro definitions, which are used to build an RPM package.
 
First we will update the spec file. Spec files are text files that contain RPM directives and macro definitions, which are used to build an RPM package.
   −
Edit the file e-smith-base.spec and change:
+
For our examle we will continue to use the e-smith-base-5.2.0
 +
 
 +
cd ~/smeserver/rpms/e-smith-base/sme8
 +
 
 +
Edit the file e-smith-base.spec
 +
 
 +
nano e-smith-base.spec
 +
 
 +
and change:
    
<pre>
 
<pre>
Line 111: Line 124:  
  %patch2 -p1
 
  %patch2 -p1
 
</pre>
 
</pre>
 +
 +
Save the file
    
To check the changes issue the following command which compares your updated spec file with the original one in CVS. This is an optional step, but helps catch errors in the spec file.
 
To check the changes issue the following command which compares your updated spec file with the original one in CVS. This is an optional step, but helps catch errors in the spec file.
 +
 
  cvs diff e-smith-base.spec
 
  cvs diff e-smith-base.spec
  

Navigation menu