This isn't really a how to - it needs rewriting to provide a solid series of steps - some of the content is better for index pages.
Open source software allows anyone to modify and use the software as they require. However, the strength of the open source development model is that everyone contributes to the core project as far as possible. That is, taking the software and modifying it locally is legal, but it is better for all if the customisations are donated back to the originating project.
Why Work With The Core Project
Open source software often relies on collaborative development for its long term survival. However, what many people don't realise that engaging with the core project when making local customisations also reduces upgrade costs.
What this means is that one needs to consider whether the customisations being made are relevant beyond the sponsoring organisation, or whether they may be relevant to a wider audience. If there is any potential for customisations to be useful outside of the originating organisation full consideration should be given to donating them back to the core project.
This then raises the question of whether the core project would recognise the contributions as valuable to their strategic goal. It is in the interests of a project to create an application framework that allows customisations to be contributed back even if they are only related to, if not core to, the projects objectives. That is, it should be possible to make customisations in such a way that they are optional components of the core system, either as plugins or as configurable functions.
Rolling customisations back into the core project has a number of advantages. It makes the project more likely to succeed as there are more people developing it and it becomes useful to a larger number of users. It also means that the upgrade path to future versions is easier since all local customisations will be available in those future releases and will not need to be made again.
Whilst, there is a short term overhead in working with the project in this way, in the long term it is extremely valuable to both user project.
Working With The Core Project
Not all projects are the same. Some will require that contributors assign copyright to the project others will simply require a licence to allow reuse of the copyrighted material. Either way, the project should employ a Contributor Licence Agreement to facilitate this.
Regardless of how the project manages its copyrights and licences all contributors must ensure that they are entitled to contribute to open source.
Having ensured that the legal hurdles to contributions have been cleared it becomes necessary to provide customisations in a form that is appropriate to the project. For small changes and bug fixes it is usually sufficient to submit a patch to the project. More significant changes should be discussed on the developer mailing list first.