Changes

From SME Server
Jump to navigationJump to search
no edit summary
Line 28: Line 28:     
== Retrieve code ==
 
== Retrieve code ==
==== Getting the right module ====
+
==== 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. 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. For this issue the following command:
 
  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 35: Line 35:  
  cd ~/home/smeserver
 
  cd ~/home/smeserver
 
  cvs -z3 -d:pserver:anonymous@smeserver.cvs.sourceforge.net:/cvsroot/smeserver co -P rpms  
 
  cvs -z3 -d:pserver:anonymous@smeserver.cvs.sourceforge.net:/cvsroot/smeserver co -P rpms  
  −
WIP Up to here [HF]
      
You can now retrieve one of the packages from SourceForge. In this case, we want to modify the e-smith-base package for SME8, so let's retrieve it from SourceForge:
 
You can now retrieve one of the packages from SourceForge. In this case, we want to modify the e-smith-base package for SME8, so let's retrieve it from SourceForge:
 +
First change to the work directory:
 +
cd ~/home/smeserver/rpms/e-smith-base/sme8
   −
* Change to work directory
+
Then we have to prepare a tree. Issue the following commands:
 
+
cvs  update -dPA
cd ~/home/smeserver/rpms/e-smith-base/sme8
+
make clean         
 
+
make prep
To prepare a tree
  −
 
  −
cvs  update -dPA
  −
 
  −
make clean         
  −
 
  −
make prep
     −
* Save a copy of the original files
+
We want to save a copy of the original files:
 +
cp -R e-smith-base-5.2.0 e-smith-base-5.2.0.old
   −
cp -R e-smith-base-5.2.0 e-smith-base-5.2.0.old
     −
<Now make the changes needed to the files in e-smith-base-5.2.0>
+
== Make changes ==
 +
==== Edit the source code ====
 +
Now make the changes needed to the files in e-smith-base-5.2.0.
   −
* Create a patch
+
We need to have an example!
   −
diff -urN smeserver-foo-2.0.0.old smeserver-yum-2.0.0 > smeserver-yum-2.0.0-importKeys.patch
      +
== Create the RPM ==
 +
==== Create a patch ====
 +
When we have finished our editing 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:
 +
diff -urN smeserver-foo-2.0.0.old smeserver-yum-2.0.0 > smeserver-yum-2.0.0-importKeys.patch
   −
* Now to make a build to test if it works:
+
==== Test the patch ====
 +
To see if our changes work correctly as intended, we will make a build of the new package to test.
 +
First we will update the spec file (explain spec file in 1 line)
 +
<pre>#increase the release
 +
%define release 15
   −
* Update the spec file
+
Then we apply our patch to the code:
<pre>#increase the release
+
Patch2: smeserver-foo-1.2-widget.patch
%define release 15
     −
#add the patch
+
Then we need to update the changelog, including the bug number
Patch2: smeserver-foo-1.2-widget.patch
+
* Fri Jan 11 2008 John Smith <smith@foo.net> 1.2-15
 +
- fixed foo to create bar [SME 3470]
   −
#update the changelog, include the bug number
+
Then we need to apply the patch in %setup (explain %setup in 1 line)
* Fri Jan 11 2008 John Smith <smith@foo.net> 1.2-15
+
%patch2 -p1
- fixed foo to create bar [SME 3470]
+
</pre>
   −
#apply the patch in %setup
+
[Reformatted upto here]
%patch2 -p1
  −
</pre>
      
CHECK: that the changelog version really matches the RPM version.
 
CHECK: that the changelog version really matches the RPM version.

Navigation menu