Changes

From SME Server
Jump to navigationJump to search
5,531 bytes added ,  22:43, 9 April 2014
Line 122: Line 122:  
  make build
 
  make build
 
{{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===
 +
====Move contribs from SME(n-1) to SME(n) ====
 +
 +
here is an example for SME7 to SME8:
 +
 +
'''Do a clean checkout of smeserver-mycontrib (This is very important, must be a completely clean tree)'''
 +
rm -rf ~/smecontribs/rpms/smeserver-mycontrib
 +
cd ~/smecontribs/rpms
 +
cvs co smeserver-mycontrib
 +
cd smeserver-mycontrib
 +
 +
then you can copy (DO NOT MODIFY ANYTHING before commiting!!!):
 +
cp -a contribs7 contribs8
 +
rm -rf contribs8/CVS
 +
cvs add contribs8
 +
find contribs8 -mindepth 1 -name CVS -prune -o -print | xargs cvs add
 +
cvs commit -m 'Initial import'
 +
 +
finally you can make your first build
 +
 +
cd contribs8
 +
make local
 +
make tag
 +
make build
 +
 +
==== Creating a new branch, eg SME 9 ====
 +
 +
===== Package Build Steps =====
 +
check out package
 +
cp -a sme8 sme9
 +
rm -rf sme9/CVS
 +
cd sme9
 +
make prep
 +
 +
mv {sourcedir} {newsourcedir}
 +
* example e-smith-base-5.2.0 to e-smith-base-5.4.0
 +
rm -f *.patch
 +
* apply any fixes from spec to tree, only for SME Server packages
 +
* move lib/perl5/site_perl to share/perl5/vendor_perl
 +
tar Jcvf {newsource}.tar.xz {newsourcedir}
 +
 +
vi *.spec
 +
* remove patches and fixes applied directly to tree
 +
* bump version and reset release to 1
 +
* add changelog saying rolling for sme9
 +
make mockbuild
 +
* if this works then we can proceed
 +
rpm -qpl {package-version}_sme/{rpmname}.rpm
 +
* check that files look similar to the sme8 package
 +
 +
 +
===== These following steps need developer access =====
 +
They are here for reference, and transparency. They will need to be run on SME Server's build server.
 +
You do not need to do this part.  (If you have CVS access but not access to the build servers please don't run any of these commands)
 +
 +
cd ..
 +
cvs add sme9
 +
cd sme9
 +
 +
date +%s
 +
* get date for import
 +
vi import.log*
 +
* fix name/version/release and date
 +
cvs add .cvsignore *.spec Makefile import.log sources
 +
* be sure to add any other needed packages
 +
make new-sources FILES=*xz
 +
 +
make commit tag build
 +
 +
==== Patching an upstream package ====
 +
 +
initscripts is an example of a package where we have to patch the upstream package. Note that this is not the best approach, new method to be documented by Ian soon.
 +
 +
Original author [http://lists.contribs.org/pipermail/devinfo/2013-October/011977.html Ian Wells]
 +
 +
Here it is a 3-step process, Analysis, Integration, buildsys update. The majority of the work is in steps 1 & 2 where there needs to be an analysis of what has changed, and then an integration stage where you need to check that the patches still work, update CVS with new and modified files etc. Finally the new source needs updating into the buildsys before the official build will work.
 +
 +
initscripts-8.45.44-3.el5.centos.src.rpm
 +
 +
Steps to update initscripts
 +
 +
=====Step 1: Analysis, by anyone=====
 +
 +
Check the contents of the SRPMs
 +
 +
$ rpm -qlp initscripts-8.45.44-3.el5.centos.src.rpm
 +
0001-Fix-comments-in-sysctl.conf.ppc-862597.patch
 +
0002-create-tmp-.X11-unix-in-rc.sysinit.patch
 +
initscripts-8.45.44.tar.bz2
 +
initscripts-centos-branding.patch
 +
initscripts.spec
 +
 +
$ rpm -qlp initscripts-8.45.42-2.1.el5.sme.src.rpm
 +
0002-create-tmp-.X11-unix-in-rc.sysinit.patch
 +
initscripts-8.45.38-smepatches.patch
 +
initscripts-8.45.42-kpartx.patch
 +
initscripts-8.45.42.tar.bz2
 +
initscripts-centos-branding.patch
 +
initscripts.spec
 +
 +
 +
Check what is different (do a directory compare)
 +
 +
 +
* Identical
 +
initscripts-centos-branding.patch (content is identical, although files are not)
 +
 +
* Modified
 +
initscripts.spec
 +
0002-create-tmp-.X11-unix-in-rc.sysinit.patch (patch is identical but line numbers changed)
 +
 +
* New
 +
initscripts-8.45.44.tar.bz2 (New source will need to be added to buildsys)
 +
0001-Fix-comments-in-sysctl.conf.ppc-862597.patch (will be added to CVS)
 +
 +
* Obsolete
 +
initscripts-8.45.42-kpartx.patch (can be removed from CVS)
 +
initscripts-8.45.42.tar.bz2
 +
 +
* Not in upstream SRPM as this is an SME Server patch to be applied each time
 +
initscripts-8.45.38-smepatches.patch
 +
 +
 +
So we need the new initscripts-8.45.44.tar.bz2 & 0001-Fix-comments-in-sysctl.conf.ppc-862597.patch, and the updated 0002-create-tmp-.X11-unix-in-rc.sysinit.patch
 +
 +
 +
===== Step 2: Integration : local mock build, can be done by a developer =====
 +
 +
* Remove the obsolete files
 +
 +
* Update the spec file.
 +
Version
 +
Release
 +
Patches
 +
Check the description, don't copy the 'Centos' wording to the SME package
 +
Copy the latest upstream Changelog
 +
Add/modify the changelog regarding SME patches
 +
 +
* Copy the new patch & source to the local directory
 +
 +
* Check that the patches apply cleanly (You don't want to see lines like Hunk #1 succeeded at 890 (offset 1 line).)
 +
make prep
 +
 +
* Try to build it
 +
make mockbuild
 +
 +
{{Note box|msg=Mock will determine which configuration to use, but you can specify it if wanting to build for a different architecture for instance.
 +
* IF 32 BITS SYSTEM:
 +
BUILDARCH=i386 make mockbuild
 +
* IF 64 BITS SYSTEM:
 +
BUILDARCH=x86_64 make mockbuild}}
 +
* Once it builds cleanly on local mock, commit the changes to CVS. Note that you cannot submit the build yet as it will fail due to the new source.
 +
make commit
 +
 +
===== Step 3: Buildsys access and permissions needed =====
 +
 +
Then add new sources to buildsys ON BUILDSYS
 +
 +
If the above step has already been done then can update to latest in CVS, and retrieve the source tarball.
 +
 +
* get date for import
 +
$ date +%s
 +
1382918459
 +
 +
* fix name/version/release and date in the import.log (I don't have a good explanation for this)
 +
vi import.log*
 +
 +
* import the new source/tarball
 +
make new-sources FILES=*bz2
 +
 +
* Finally commit changes to CVS and build it.
 +
make commit tag build
 +
    
[[Category:Howto]][[Category:SME9-Development]] [[Category:SME Server Development Framework]]
 
[[Category:Howto]][[Category:SME9-Development]] [[Category:SME Server Development Framework]]

Navigation menu