Package Modification

From SME Server
Revision as of 06:30, 25 December 2007 by Snoble (talk | contribs)
Jump to navigation Jump to search

SME Server code is stored in the CVS on http://SourceForge.net in two repositories smeserver and smecontribs

This page is to help you make changes to the base or contribs package stored on sourceforge.

Set up

Local environment

  • We now use cvs without needing mezzanine, check you have it installed
yum install cvs
  • Setup CVS to use ssh
/etc/profile.d/smebuild.sh

# Developer environment
# This gets symlinked into /etc/profile.d 

export CVS_RSH=ssh # tell CVS to use ssh

# DO NOT set CVSROOT

alias rm='rm -i'
alias cp='cp -i --preserve=timestamps'
alias mv='mv -i'

Access to build system

Check updates/status on the build server: http://buildsys.contribs.org

Ask admin@contribs.org for certificates, give the email address to use for notifications

yum install --enablerepo=smedev plague-client

Copy certificates and config file to ~/

.plague-client.cfg
.username.pem
.contribs-upload-ca.pem
.contribs-server-ca.pem

chmod 600 .username.pem

Check it's working

plague-client list_builders

Builders:
------------------------------------------------------------------------------------------
 build64-1.contribs.org      x86_64 amd64 ia32e noarch i386 i486 i586 i686 athlon available
 build32-1.contribs.org      i386 i486 i586 i686 athlon noarch  available

Sourceforge access

  • SME Server code is stored in the CVS on http://SourceForge.net. To be able to work on your code in the SME Server CVS repository you need an account on SourceForge. With this account the development team can give you access to the CVS repository. More information can be found here:
B04: Registering a User Account
E04: CVS (Version Control for Source Code)
F02: SSH Key Generation and Usage
  • After you have created your SourceForge account you can ask the development team to give you developer access to smecontribs. Create a bug in the Bug Tracker as usual.
  • If local username is different to sf.net username
~/.ssh/config

Host  smeserver.cvs.sourceforge.net
User  sfusername
Host  smecontribs.cvs.sourceforge.net
User  sfusername

chmod 600 ~/.ssh/config

Usage

Import cvs

This is just cvs information, not source code.

You can use ~/home/smeserver or whatever suits.

mkdir ~/smeserver
cd ~/smeserver
cvs -z3 -d:ext:smeserver.cvs.sourceforge.net:/cvsroot/smeserver co -P rpms 
cd rpms
cvs -z3 -d:ext:smeserver.cvs.sourceforge.net:/cvsroot/smeserver co -P common 

mkdir ~/smecontribs
cd ~/smecontribs 
cvs -z3 -d:ext:smecontribs.cvs.sourceforge.net:/cvsroot/smecontribs co -P rpms 
cd rpms
cvs -z3 -d:ext:smecontribs.cvs.sourceforge.net:/cvsroot/smecontribs co -P common 


Modify a package

Builders have rights to patch packages, tag, and build. If you need to upload new source tarballs or versions shad has to do that for now. Binary files are stored in a look-aside cache on shads box. CVS isn't great on binary files.

Mezzanine, (mzsfget, mzclean, mzprep, mzpatch, mzbuild, mzput) have all be replaced with a new method.

These are the most common commands.

make sources
make local
make prep
make srpm
make tag
make build
make clean
make patch SUFFIX=<stuff>

change to work directory

cd smecontribs/rpms/smeserver-foo/contribs7

For more information

make help

To prepare a tree

cvs update -dPA
make clean
make prep

You can switch to the tree and make modification.

In the prepared dir copy a file you want to modify like so:

cp 28UserManagerProxyPass 28UserManagerProxyPass.{patchname}

Then modify the original file 28UserManagerProxyPass To add new files touch the file.{patchname} so it is empty. [Check]

Once you have all the files you want patched copied and changed then you can build the patch (from the contribs7 dir) with:

make patch SUFFIX={patchname}

It will build and add the patch for you. It should be named "name-version-{patchname}.patch" Read up on gendiff. That is what the makefile uses to generate the diff file.

Once you are satisfied and want to submit the package to the build server you can do the following. This tags all files as belonging to a particular build version

make tag

This will submit the request to the build server which will checkout the recently tagged version and build it in a chroot (mock) env.

make build

Once the commit is done you can test a build locally [check, can we make local before a commit]

make local

Key things are to always do "make tag" before "make build"

Always ensure you are working with the latest version (cvs update -dPA). Issue from rpms directory, or a directory below, anywhere with a CVS directory

You and updatesteam will get an email on successfull build. Only you will get an email on failed build.

Workflow

Once the server successfully builds it will automatically be pulled on the next repo update run (40 past the even hours MDT). The package will either be put into the smedev (new package) or smetest (exist in higher repo) After verification the package is manually moved from smedev/smetest to smecontribs/smeupdates-testing

Mailing Lists

Subscribe yourself to the devinfo mailinglist. This is the place to discuss the development of the server and contribs. If you have other questions, not regarding development please use the forums.

Other lists exist to monitor bugs and the build system, UpdatesTeam + ...