Changes

Jump to navigation Jump to search
→‎Update the CVSROOT: - Correct cvs path
Line 2: Line 2:     
On top of that a build system (plague) is layered to build packages in the RPM format used by yum.
 
On top of that a build system (plague) is layered to build packages in the RPM format used by yum.
 
+
{{Tip box|[http://www-e815.fnal.gov/webspace/cvs/commands.html '''Here'''] you can find more explanations on CVS and its CLI}}
The following is a cheat sheet that was started by [[User:Cactus]] here [[User:Cactus:CVS:Cheat_Sheet]]
  −
but was locked so I copied the contents here to allow it to be updated where needed.
  −
 
   
==Repositories==
 
==Repositories==
 
There are two repositories hosting code for SME Server:
 
There are two repositories hosting code for SME Server:
 
# SME Server - holding the source code for the SME Server core
 
# SME Server - holding the source code for the SME Server core
# SME Contribs - holdint the source code for contribs (add-ons) for SME Server
+
# SME Contribs - holding the source code for contribs (add-ons) for SME Server
 
Both repositories are organized by the package name under which they appear in the software installer in the server-manager (or yum).
 
Both repositories are organized by the package name under which they appear in the software installer in the server-manager (or yum).
   Line 16: Line 13:     
====Browsing the source code====
 
====Browsing the source code====
There is a nice web based interface through which you can browse the development of SME Server core packages and you can find it [http://fisheye1.cenqua.com/browse/smeserver/ here].
+
There is a nice web based interface through which you can browse the development of SME Server contribs and you can find it [http://smeserver.cvs.sourceforge.net/viewvc/smeserver/rpms/ here for SME_Server] and [http://smeserver.cvs.sourceforge.net/viewvc/smecontribs/rpms/ here for SME_Contribs].
    
===SME Contribs repository===
 
===SME Contribs repository===
Line 24: Line 21:     
====Browsing the source code====
 
====Browsing the source code====
There is a nice web based interface through which you can browse the development of SME Server contribs and you can find it [http://fisheye1.cenqua.com/browse/smecontribs/rpms/ here].
+
There is a nice web based interface through which you can browse the development of SME Server contribs and you can find it [http://smeserver.cvs.sourceforge.net/viewvc/smeserver/rpms/ here for SME_Server] and [http://smeserver.cvs.sourceforge.net/viewvc/smecontribs/rpms/ here for SME_Contribs].
 +
 
 +
===koozali.org access===
 +
This chapter is used only by developers who aim to be granted in write access to the source code on koozali.org, you don't need it if you want to only make patch or modify code in your build environment. You can see [[Package_Modification]] for more informations.
 +
* SME Server code is stored in the CVS on  http://shell.koozali.org. To be able to work on your code in the SME Server CVS repository you need an account on koozali.org. With this account the development team can give you access to the CVS repository.
 +
* After you have created your koozali.org account you can ask the development team to give you developer access to smecontribs. Create a bug in the Bug Tracker as usual.
 +
 
 +
* Links to manage your SSH keys on koozali.org may be found on the ''to be advised''.
 +
 
 +
* If local username is different to shell.koozali.org username edit ~/.ssh/config:
 +
 +
Host  shell.koozali.org
 +
User  koozaliusername ''(without @shell.koozali.org)''
 +
Host  shell.koozali.org
 +
User  koozaliusername ''(without @shell.koozali.org)''
 +
port 222
 +
 
 +
* Don't forget to set the proper privileges on the file
 +
 +
chmod 600 ~/.ssh/config
 +
 
 +
If you have a number of different keys ssh/cvs may try and use the wrong one.
 +
 
 +
You can add the following to your ~/.ssh/config file to specify the correct key:
 +
 
 +
Host  shell.koozali.org
 +
User koozaliusername
 +
port 222
 +
IdentityFile ~/.ssh/my.private.key
    
==Workflow==
 
==Workflow==
 
The basic workflow is to first setup your development environment this is described in [[Package Modification]]. After that you need to get a copy of the source of a package by checking out the source. Than you can make your modifications by making a copy with a suffix (patchname) and make your modification to the original. You can refer to this page [[Rpm_build_example_using_cvs/mock]] to see many examples of mock/cvs usage
 
The basic workflow is to first setup your development environment this is described in [[Package Modification]]. After that you need to get a copy of the source of a package by checking out the source. Than you can make your modifications by making a copy with a suffix (patchname) and make your modification to the original. You can refer to this page [[Rpm_build_example_using_cvs/mock]] to see many examples of mock/cvs usage
 
After that we first need to test what we did, therefore we need to make a local build  
 
After that we first need to test what we did, therefore we need to make a local build  
  make local
+
  make mockbuild
 
and install and test the created package:
 
and install and test the created package:
 
  sudo -u root yum localinstall /path/to/packagename
 
  sudo -u root yum localinstall /path/to/packagename
Line 41: Line 66:  
====Check out====
 
====Check out====
 
To get a local copy of a package we need to retrieve the source from the repository, this is called a check out. To check out a package from the SME Contribs repository take a look at [[Package_Modification]].
 
To get a local copy of a package we need to retrieve the source from the repository, this is called a check out. To check out a package from the SME Contribs repository take a look at [[Package_Modification]].
To be able to work on your code in the SME Server CVS repository you need an account on SourceForge.  If you do not have an account at CVS, retrieving is performed as an anonymous user and changes cannot be saved.  
+
To be able to work on your code in the SME Server CVS repository you need an account on koozali.org.  If you do not have an account at CVS, retrieving is performed as an anonymous user and changes cannot be saved.  
    
===== Registered Users =====
 
===== Registered Users =====
 
- To retrieve a package or a full tree as a registered user, cd into a work directory and issue following commands:
 
- To retrieve a package or a full tree as a registered user, cd into a work directory and issue following commands:
 
* for smeserver
 
* for smeserver
  cvs -z3 -d:ext:smeserver.cvs.sourceforge.net:/cvsroot/smeserver co -P packagename [individual package]
+
  cvs -z3 -d:ext:shell.koozali.org:/cvs/smeserver co -P packagename [individual package]
  cvs -z3 -d:ext:smeserver.cvs.sourceforge.net:/cvsroot/smeserver co -P rpms [full tree]
+
  cvs -z3 -d:ext:shell.koozali.org:/cvs/smeserver co -P rpms [full tree]
 
* for smecontribs
 
* for smecontribs
  cvs -z3 -d:ext:smeserver.cvs.sourceforge.net:/cvsroot/smecontribs co -P packagename [individual package]
+
  cvs -z3 -d:ext:shell.koozali.org:/cvs/smecontribs co -P packagename [individual package]
  cvs -z3 -d:ext:smeserver.cvs.sourceforge.net:/cvsroot/smecontribs co -P rpms [full tree]
+
  cvs -z3 -d:ext:shell.koozali.org:/cvs/smecontribs co -P rpms [full tree]
    
===== Anonymous users =====
 
===== Anonymous users =====
 
- To retrieve a package or a full tree as an anonymous user, cd into a work directory and issue following commands:
 
- To retrieve a package or a full tree as an anonymous user, cd into a work directory and issue following commands:
 
* for smeserver
 
* for smeserver
  cvs -z3 -d:pserver:anonymous@smeserver.cvs.sourceforge.net:/cvsroot/smeserver checkout -P packagename [individual package]
+
  cvs -z3 -d:pserver:anonymous@shell.koozali.org:/cvs/smeserver checkout -P packagename [individual package]
  cvs -z3 -d:pserver:anonymous@smeserver.cvs.sourceforge.net:/cvsroot/smeserver co -P rpms [full tree]
+
  cvs -z3 -d:pserver:anonymous@shell.koozali.org:/cvs/smeserver co -P rpms [full tree]
    
* for smecontribs
 
* for smecontribs
  cvs -z3 -d:pserver:anonymous@smeserver.cvs.sourceforge.net:/cvsroot/smecontribs checkout -P packagename [individual package]
+
  cvs -z3 -d:pserver:anonymous@shell.koozali.org:/cvs/smecontribs checkout -P packagename [individual package]
  cvs -z3 -d:pserver:anonymous@smeserver.cvs.sourceforge.net:/cvsroot/smecontribs co -P rpms [full tree]
+
  cvs -z3 -d:pserver:anonymous@shell.koozali.org:/cvs/smecontribs co -P rpms [full tree]
    
====Retrieving the latest version====
 
====Retrieving the latest version====
Line 75: Line 100:     
====Check in or committing====
 
====Check in or committing====
To upload your source code into the repository (check in) you need to have a user account on the SourceForge system that is hosting the SME Server core and SME Server contribs repositories.
+
To upload your source code into the repository (check in) you need to have a user account on the koozali.org system that is hosting the SME Server core and SME Server contribs repositories.
 
Check in is quite simple
 
Check in is quite simple
 
  cvs commit -m 'message'
 
  cvs commit -m 'message'
 +
 +
for example the commit message should be the relevant modified changelog
 +
 +
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]'
 +
 +
=====Keyword substitution=====
 +
 +
RCS uses a mechanism known as [http://keyword%20substitution http://web.mit.edu/gnu/doc/html/cvs_17.html#SEC73] (or keyword expansion) to help identifying the files. Embedded strings of the form $keyword$ and $keyword:...$ in a file are replaced with strings of the form $keyword:value$ whenever you obtain a new revision of the file. This will lead that your patch won't be well applied any more after strings will be substituted.
 +
 +
If you have patch with strings substituted do
 +
 +
cvs admin -kk <file>
 +
cvs update -dPA
 +
 
====Adding/removing files====
 
====Adding/removing files====
 
Since files under source control are not aware of the local file system we need to add and remove them with special commands:
 
Since files under source control are not aware of the local file system we need to add and remove them with special commands:
Line 86: Line 126:  
To add a file to source control:
 
To add a file to source control:
 
  cvs add <file>
 
  cvs add <file>
 +
 +
====Revert changes to files====
 +
 +
*To see history of changes on a file do
 +
cvs log oldfile
 +
 +
* To see exactly what has changed between two different revisions of a file:
 +
cvs diff -r < first version > -r < second version >  oldfile
 +
eg
 +
cvs diff -r 1.1 -r 1.2  oldfile
 +
 +
* To revert to older version of a file, do:
 +
cvs update -j 1.7 -j 1.5 oldfile
 +
and the you have to commit modification to cvs
 +
cvs commit -m 'oldfile modification reverted from 1.X to 1.Y'
 +
 +
*If you want to go back to the most up to date version just do the following:
 +
cvs update -A oldfile
 +
The -A tag tells update to get rid of the sticky tag and do a full update of the file.
    
====Prepare a working copy====
 
====Prepare a working copy====
Line 123: Line 182:  
{{Note box|Before you do a 'make build' make sure you checked that everything builds locally and changes are tested and you have created a tag in the repository.}}
 
{{Note box|Before you do a 'make build' make sure you checked that everything builds locally and changes are tested and you have created a tag in the repository.}}
   −
===Examples of CVS usage===
+
====Update the CVSROOT====
 +
When you create a new CVS module on the buildsrv (by importing a new source with cvs add foldername) you must update the CVSROOT/modules files and add the name of your contribs (in the alphabetically sorted list). If you don't do that, when you will requested a build by plague, you will have a fail whereas you can build locally on your server.
 +
 
 +
first you need to checkout the CVSROOT, of course you need to be granted as developer
 +
cvs -z3 -d:ext:shell.koozali.org:/cvs/smecontribs co -P CVSROOT
 +
or if it is not a contrib
 +
cvs -z3 -d:ext:shell.koozali.org:/cvs/smeserver co -P CVSROOT
 +
 
 +
then
 +
cd CVSROOT
 +
vim modules
 +
 
 +
  smeserver-sme8admin            rpms/smeserver-sme8admin &common
 +
+ smeserver-sme9admin            rpms/smeserver-sme9admin &common
 +
  smeserver-smf          rpms/smeserver-smf &common
 +
and
 +
cvs commit -m "Add smeserver-sme9admin module"
 +
 
 +
==Examples of CVS usage==
 
====Move contribs from SME(n-1) to SME(n) ====
 
====Move contribs from SME(n-1) to SME(n) ====
   Line 148: Line 225:  
  make build
 
  make build
    +
------
 
==== Creating a new branch, eg SME 9 ====
 
==== Creating a new branch, eg SME 9 ====
   
===== Package Build Steps =====
 
===== Package Build Steps =====
 
check out package
 
check out package
Line 162: Line 239:  
* apply any fixes from spec to tree, only for SME Server packages
 
* apply any fixes from spec to tree, only for SME Server packages
 
* move lib/perl5/site_perl to share/perl5/vendor_perl
 
* move lib/perl5/site_perl to share/perl5/vendor_perl
  tar Jcvf {newsource}.tar.xz {newsourcedir}
+
mkdir -p packagename/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel
 +
mv packagename/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/File.pm packagename/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/
 +
rm -rf  packagename/root/usr/lib/
 +
* make an archive
 +
  tar cvzf {newsource}.tar.xz {newsourcedir}
    
  vi *.spec
 
  vi *.spec
 
* remove patches and fixes applied directly to tree
 
* remove patches and fixes applied directly to tree
 +
* change '''Source: %{name}-%{version}.tar.gz''' to '''Source: %{name}-%{version}.tar.xz'''
 
* bump version and reset release to 1
 
* bump version and reset release to 1
 
* add changelog saying rolling for sme9
 
* add changelog saying rolling for sme9
Line 172: Line 254:  
  rpm -qpl {package-version}_sme/{rpmname}.rpm
 
  rpm -qpl {package-version}_sme/{rpmname}.rpm
 
* check that files look similar to the sme8 package
 
* check that files look similar to the sme8 package
      
===== These following steps need developer access =====
 
===== These following steps need developer access =====
Line 191: Line 272:     
  make commit tag build
 
  make commit tag build
 +
 +
--------
 +
 +
==== Import a new source tarball (generic)====
 +
when you need to import a new version of an archive, these steps are done at the buildserver level. Once the the new source created, you can retrieve the cvs update in your personal build box and request via plague a build.
 +
===== These following steps need shell access to the buildserver (buildsrv) =====
 +
'''on the buildsrv (you must be granted)'''
 +
 +
* If you work directly from the cvs sources
 +
cd smeserver-contrib/contribs8
 +
make prep
 +
mv smeserver-contribs-1.1.0 smeserver-contribs-1.1.2
 +
 +
do your modifications in smeserver-contribs-1.1.2 folder then
 +
 +
tar cvzf smeserver-contribs-1.1.2.tar.gz smeserver-contribs-1.1.2
 +
make new-sources FILES="smeserver-contribs-1.1.2.tar.gz"
 +
cvs commit -m 'modified source smeserver-contribs-1.1.2.tar.gz'
 +
 +
* If you work from an already existent srpm
 +
 +
wget http://your.src.rpm
 +
rpm2cpio  *.src.rpm | cpio -idmv --no-absolute-filenames
 +
make new-sources FILES=*.?z
 +
rm -rf *.src.rpm *.?z *.spec
 +
cvs commit -m 'new source commited for the smeserver-contrib'
 +
 +
===== These following steps need developer access (shell)=====
 +
on your local build server retrieve the cvs upgrade
 +
cvs update -dPA
 +
 +
you have to modify the spec file for the changelog and any needed customisations (bump the version accordingly to the number of the above source (1.1.2))
 +
vim smeserver-contribs.spec
 +
cvs commit -m 'your commit message'
 +
make tag
 +
make build
 +
 +
==== Import a new source tarball for clamav====
 +
when you need to import a new version of clamav, these steps are done at the buildserver level. Once the the new source created, you can retrieve the cvs update in your personal build box and request via plague a build.
 +
 +
===== These following steps need shell access to the buildserver =====
 +
 +
wget http://sourceforge.net/projects/clamav/files/clamav/0.98.5/clamav-0.98.5.tar.gz/download
 +
wget http://database.clamav.net/main.cvd
 +
wget http://database.clamav.net/daily.cvd
 +
 +
make new-source FILES="clamav-0.98.5.tar.gz main.cvd daily.cvd"
 +
cvs commit -m "Import new source for clamav 0.98.5"
 +
 +
===== These following steps need developer access =====
 +
then in your personal build system
 +
 +
cd ~/work/smeserver/rpms/clamav/sme9
 +
cvs update -dPA
 +
 +
you have to modify the spec file for the changelog and any needed customisations
 +
 +
make commit -m '* Tue Dec 16 2014 Daniel Berteaud <daniel@firewall-services.com> - 0.98.5-1.sme
 +
- Updated to release 0.98.5 [SME: 8729]'
 +
make tag
 +
make build
    
==== Patching an upstream package ====
 
==== Patching an upstream package ====
Line 296: Line 438:  
  make commit tag build
 
  make commit tag build
   −
====import of perl-Passwd-Unix in CVS====
+
------
 +
 
 +
====Import of perl-Passwd-Unix====
 
One important part is updating the 'modules' file in CVS to allow the buildsys to build to correctly.
 
One important part is updating the 'modules' file in CVS to allow the buildsys to build to correctly.
   Line 320: Line 464:  
  ./common/cvs-import.sh -b sme8 -m 'Initial import'  perl-Passwd-Unix-0.71-1.src.rpm
 
  ./common/cvs-import.sh -b sme8 -m 'Initial import'  perl-Passwd-Unix-0.71-1.src.rpm
   −
====For perl-Struct-Compare-1.0.1-1.src.rpm====
+
--------
 +
 
 +
====Import perl-Struct-Compare====
    
  mkdir -p ~/rpms/perl-Struct-Compare/sme8
 
  mkdir -p ~/rpms/perl-Struct-Compare/sme8
Line 342: Line 488:  
The modules file needs to be updated before the buildsys will build them.
 
The modules file needs to be updated before the buildsys will build them.
   −
====import openssl====
+
-------
 +
 
 +
====Import openssl====
 
From /build/smeserver/repo/8.0/smeupdates/SRPMS/openssl-0.9.8e-27.el5_10.1.src.rpm
 
From /build/smeserver/repo/8.0/smeupdates/SRPMS/openssl-0.9.8e-27.el5_10.1.src.rpm
   Line 370: Line 518:  
  cvs tag -b upstream
 
  cvs tag -b upstream
   −
====import perl-Mojolicious and enable it in bugzilla====
+
--------
 +
 
 +
====Import perl-Mojolicious and enable it in bugzilla====
    
=====Start on buildsys=====
 
=====Start on buildsys=====
Line 391: Line 541:  
  wget http://bugs.contribs.org/attachment.cgi?id=4589 -O  perl-Mojolicious-4.91-1.el6.src.rpm
 
  wget http://bugs.contribs.org/attachment.cgi?id=4589 -O  perl-Mojolicious-4.91-1.el6.src.rpm
   −
=====Import the SRPM !! You have to press enter during this script =====
+
=====Import the SRPM =====
 +
You have to press enter during this script
 
  ./common/cvs-import.sh -b sme9 -m 'Initial import'  perl-Mojolicious-4.91-1.el6.src.rpm
 
  ./common/cvs-import.sh -b sme9 -m 'Initial import'  perl-Mojolicious-4.91-1.el6.src.rpm
    
End on buildsys
 
End on buildsys
      
=====Update the CVS module list=====
 
=====Update the CVS module list=====
Line 403: Line 553:     
  perl-Mojolicious    rpms/perl-Mojolicious &common
 
  perl-Mojolicious    rpms/perl-Mojolicious &common
  −
### --- ###
  −
      
=====Update bugzilla=====
 
=====Update bugzilla=====
Line 411: Line 558:  
Add a new package to bugzilla
 
Add a new package to bugzilla
 
  http://bugs.contribs.org/editvalues.cgi?action=add&field=cf_package
 
  http://bugs.contribs.org/editvalues.cgi?action=add&field=cf_package
 
+
[[Category:Howto]]
+
 
+
[[Category:Howto]]
[[Category:Developer]]
+
 +
 +
[[Category:Developer]]

Navigation menu