Changes

Jump to navigation Jump to search
Update CVS server details
Line 1: Line 1:  +
{{Level|Developer}}
 
The simplest package modification is for someone to access the code via anonymous CVS and produce a patch to put into Bugzilla.
 
The simplest package modification is for someone to access the code via anonymous CVS and produce a patch to put into Bugzilla.
 
This can be done on SME 8 by installing only cvs as follows.
 
This can be done on SME 8 by installing only cvs as follows.
Line 10: Line 11:     
==== Create a new 'builder' user ====
 
==== Create a new 'builder' user ====
We will create a new user account that we use for our building purposes. The new user account can be created, as usual, through the server-manager, In this How-To we will have named our new user account 'builder'  
+
We will create a new user account that we use for our building purposes. The new user account can be created, as usual, through the server-manager, In this How-To we will have named our new user account 'builder'
 +
 
 +
useradd builder
 +
passwd builder
    
==== Grant shell access ====
 
==== Grant shell access ====
Line 21: Line 25:  
==== Create a development directory ====
 
==== Create a development directory ====
 
The user 'builder needs a dedicated development directory. In this How-To we will use ~/home/smeserver. To create the directory ~/home/smeserver please issue the following command as user 'builder':
 
The user 'builder needs a dedicated development directory. In this How-To we will use ~/home/smeserver. To create the directory ~/home/smeserver please issue the following command as user 'builder':
  mkdir ~/home/smeserver
+
  mkdir ~/smeserver
  cd ~/home/smeserver
+
cd ~/smeserver
 +
 
 +
To add the smecontribs cvs:
 +
mkdir ~/smecontribs
 +
  cd ~/smecontribs
   −
This is all what is required to setup your server to be able to start working on patches and packages
+
This is all what is required to setup your server to be able to start working on patches and packages.
    
== Retrieve code ==
 
== Retrieve code ==
 
==== 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. 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 koozali.org, we can also retrieve the CVS for the smecontribs tree. For this issue the following commands:
  cvs -z3 -d:pserver:anonymous@smeserver.cvs.sourceforge.net:/cvsroot/smeserver checkout -P e-smith-base
+
cd ~/smeserver
 +
  cvs -z3 -d:pserver:anonymous@shell.koozali.org:/cvs/smeserver checkout -P e-smith-base
 +
 
 +
For the 'smeserver-base' base from the contribs tree.
 +
cd ~/smecontribs
 +
cvs -z3 -d:pserver:anonymous@shell.koozali.org:/cvs/smecontribs checkout -P smeserver-base
    
Next to a selective retrieve as per above, you can also retrieve the whole CVS tree.  
 
Next to a selective retrieve as per above, you can also retrieve the whole CVS tree.  
  cd ~/home/smeserver
+
  cd ~/smeserver
  cvs -z3 -d:pserver:anonymous@smeserver.cvs.sourceforge.net:/cvsroot/smeserver co -P rpms  
+
  cvs -z3 -d:pserver:anonymous@shell.koozali.org:/cvs/smeserver co -P rpms
 +
 
 +
For the SME contribs tree.
 +
cd ~/smecontribs
 +
cvs -z3 -d:pserver:anonymous@shell.koozali.org:/cvs/smecontribs co -P rpms  
 +
 
 +
If you want to update/refresh the whole CVS tree smeserver or smecontribs, run the following from the rpms directory, or any lower directory with a CVS dir , issue
 +
cvs update -dPA
   −
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:
+
To work on the e-smith-base smeserver tree, change to the e-smith-base SME8 directory:
First change to the work directory:
+
  cd ~/smeserver/rpms/e-smith-base/sme8
  cd ~/home/smeserver/rpms/e-smith-base/sme8
      
Then we have to prepare a tree. Issue the following commands:
 
Then we have to prepare a tree. Issue the following commands:
  cvs update -dPA
+
  cvs update -dPA
  make clean      
+
  make clean
 
  make prep
 
  make prep
 
Please ignore if 'make clean' returns an error about a missing *.tgz package
 
Please ignore if 'make clean' returns an error about a missing *.tgz package
Line 52: Line 71:  
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 81: Line 102:     
== Create a patch ==
 
== 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:  
+
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
    
==== Test the patch ====
 
==== Test the patch ====
To see if our changes work correctly as intended, we will make a local RPM build to test, and before building the RPM it is necessary to update the spec file.
+
To see if our changes work correctly as intended, we will make a local RPM build to test, and before building the RPM it is necessary to update the spec file to increase the release number and to ensure your patch is included in the build.
    
===== Update the spec file =====
 
===== Update the spec file =====
First we will update the spec file (explain spec file in 1 line)
+
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.
 +
 
 +
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
   −
Edit the file e-smith-base.spec and change:
+
and change:
    
<pre>
 
<pre>
Line 104: Line 135:     
  #add patch version to the %setup section
 
  #add patch version to the %setup section
  %patch55 -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 -u e-smith-base.spec
    
* Ensure that the changelog version really matches the RPM version.
 
* Ensure that the changelog version really matches the RPM version.
Line 115: Line 149:  
* Is the date really correct? Both day and date.
 
* Is the date really correct? Both day and date.
 
* The version should follow after the email address
 
* The version should follow after the email address
  −
==== Update CVS ====
  −
CVS needs to be updated. Issue the following command:
  −
cvs update
  −
  −
* M modified, will be committed
  −
* U file has been updated since you last checked it out
  −
* A added, will be added on commit
  −
* D deleted, will be deleted on commit
  −
* ? egregious file not part of CVS record for this dir
  −
  −
* Ensure that the patch file has been added cvs add e-smith-base-5.2.0-test.patch
  −
* Ensure that your patch/files etc. are UNIX style or do they have DOS endings (bad)
      
==== Build the test RPM ====
 
==== Build the test RPM ====
Line 143: Line 164:  
==== If you have CVS commit access ====
 
==== If you have CVS commit access ====
   −
Once you are satisfied and want to submit the package to the build server commit your changes. (Please use descriptive comments so that other developers are aware of what is happening. Comments will appear on the subject line of the commit email that get send to the other developers.)  
+
CVS needs to be updated. To check what will be committed to CVS, issue the following command:
cvs commit -m 'your descriptive commit message here'
+
cvs update
cvs commit -m '<-- copy this then add changelog line
+
 
 +
* M modified, will be committed
 +
* U file has been updated since you last checked it out
 +
* A added, will be added on commit
 +
* D deleted, will be deleted on commit
 +
* ? egregious file not part of CVS record for this dir
 +
 
 +
* Ensure that the patch file has been added
 +
cvs add e-smith-base-5.2.0-test.patch
 +
* Ensure that your patch/files etc. are UNIX style and do not have DOS endings.
 +
 
 +
Once you are satisfied and want to submit the package to CVS commit your changes. (Please use descriptive comments so that other developers are aware of what is happening. Comments will appear on the subject line of the commit email that get send to the other developers.):
 +
cvs commit -m 'your descriptive commit message here'
 +
 
 +
for example
 +
cvs commit -m '* Wed Jan 23 2013 John Doe <jdoe@foo.net> 5.2.0-68.sme
 +
- just a test to see if I can do this [SME: 7129]'
   −
==== If you have CVS build access ====
+
==== If you have build access ====
 
Build it (from either the sme7 or sme8 dir):
 
Build it (from either the sme7 or sme8 dir):
 
  make tag
 
  make tag
 
  make build
 
  make build
 +
[[Category:SME9-Development]]
 +
[[Category:SME Server Development Framework]]
 +
[[Category:Development Tools]]

Navigation menu