Setup of Development Environment for Debian: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
= Required software =
= Required software =


== Git ==
== Bazaar ==
* on Ubuntu/Debian: apt-get install git-core
* TODO: how to install bazaar. does <code>apt-get install bzr</code> return a version that is compatible with bzr 2.2 on the server?


== Mono 2.x ==
== Mono 2.x ==
Line 42: Line 42:


= Get the source code =
= Get the source code =
The source code is managed with Git.  
The source code is managed with Bazaar.  


Please understand that we will provide write permissions only to the core members of the development team, just to keep the project on one track (refered to as '' 'developer access' '' below). We very much need your contributions though, and we will aim to quickly deal with submitted patches and code. Please see our document on [[submitting patches and features]]!
Please understand that we will provide write permissions only to the core members of the development team, just to keep the project on one track (refered to as '' 'developer access' '' below). We very much need your contributions though, and we will aim to quickly deal with submitted patches and code. Please see our document on [[submitting patches and features]]!


You can get the source code in several ways:
Please follow the instructions at [[How to work with bazaar on the command line]] to get the source code
* see the [https://sourceforge.net/scm/?type=git&group_id=260632 Git instructions at Sourceforge]
** that page describes how you can download anonymously from Git
* you can also browse the [http://git.openpetra.org Git repository online], and you can download a tar.gz snapshot of each version there
* for developers: more detailed instructions how to create the ssh key and where to upload it to Sourceforge: https://sourceforge.net/apps/trac/sourceforge/wiki/SSH%20keys
 
for anonymous access, you can use this URL to clone the repository with TortoiseGit:
git://openpetraorg.git.sourceforge.net/gitroot/openpetraorg/openpetraorg
 
for developer access (with write permissions), use this URL to clone the repository with TortoiseGit:
ssh://USERNAME@openpetraorg.git.sourceforge.net/gitroot/openpetraorg/openpetraorg
 
For development, I recommend you create a local branch, and switch to it. Then you pull updates from the server ("master") into your local branch, and push your updates up to the server in the master branch. Otherwise you get all sorts of problems with pushing and pulling, so don't commit to master at all. see also [[Notes about Git]]


= Configuration of Development Environment =
= Configuration of Development Environment =
for anonymous access:
cd ~
git clone git://openpetraorg.git.sourceforge.net/gitroot/openpetraorg/openpetraorg
cd openpetraorg
cp OpenPetra.build-sample-linux.config OpenPetra.build.config
for developer access (with write permissions):
cd ~
eval `/usr/bin/ssh-agent`
ssh-add ~/.ssh/YOURPRIVATEKEYFILE     
git clone ssh://USERNAME@openpetraorg.git.sourceforge.net/gitroot/openpetraorg/openpetraorg
git config user.name "YOUR NAME"
git config user.email "USERNAME@users.sourceforge.net"
cd openpetraorg
cp OpenPetra.build-sample-linux.config OpenPetra.build.config
Please check your OpenPetra.build.config file and make sure the paths are all adjusted to your system and the version numbers in the paths are correct.
Please check your OpenPetra.build.config file and make sure the paths are all adjusted to your system and the version numbers in the paths are correct.



Revision as of 16:28, 20 December 2010

Required software

Bazaar

  • TODO: how to install bazaar. does apt-get install bzr return a version that is compatible with bzr 2.2 on the server?

Mono 2.x

  • need to use Lenny Backports, since Lenny only provides Mono 1.x
echo "deb http://www.backports.org/debian lenny-backports main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get install debian-backports-keyring
apt-get -t lenny-backports install mono-runtime mono-xbuild libmono-microsoft-build2.0-cil monodevelop
  • if you get this error: ICSharpCode.SharpZipLib.Tar.TarArchive does not contain a definition for Close
    • solution: sudo gacutil -u ICSharpCode.SharpZipLib; sudo gacutil --install csharp/ThirdParty/ICSharpCode/ICSharpCode.SharpZipLib.dll
    • another problem without a solution yet: error CS0006: cannot find metadata file `ICSharpCode.SharpZipLib.dll'
      • perhaps try git checkout csharp to undo ChangeProjectFileXBuild
      • solution: I realised the symbolic link was broken.
sudo rm /usr/lib/mono/2.0/ICSharpCode.SharpZipLib.dll
sudo ln -s /usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.85.5.452__1b03e6acf1164f73/ICSharpCode.SharpZipLib.dll /usr/lib/mono/2.0/ICSharpCode.SharpZipLib.dll

NAnt

  • apt-get -t lenny-backports install nant
    • Problem: NAnt 0.85 (Build 0.85.2478.0; release; 10/14/2006) does not seem to support the task "solution" on Linux? Invalid element <solution>. Unknown task or datatype.
    • Problem: exec spawn is not supported in 0.85
    • Solution: copy binary zip from sourceforge (http://nant.sourceforge.net/nightly/latest/nant-bin.tar.gz), unzip, and change /usr/bin/nant to point at the latest NAnt.exe
    • to avoid all the warnings "Could not load file or assembly" run: apt-get install libmono-microsoft-build2.0-cil
    • to avoid problems finding log4net etc, make sure the property NAntBin.dir in your OpenPetra.build.config is set correctly
    • Also you need to make a symbolic link:
ln -s /usr/lib/mono/2.0/Microsoft.CSharp.targets /usr/lib/mono/2.0/Microsoft.CSharp.Targets

SQLite or PostgreSQL or MySQL

  • apt-get install sqlite3 (requires 3.6.1 or higher; might need to use another repository, eg testing)
  • or apt-get install postgresql
  • or apt-get install mysql-server

xgettext and msgfmt

  • apt-get install gettext

dos2unix

  • this is needed for building releases (nant buildRelease)
  • apt-get install tofrodos

Get the source code

The source code is managed with Bazaar.

Please understand that we will provide write permissions only to the core members of the development team, just to keep the project on one track (refered to as 'developer access' below). We very much need your contributions though, and we will aim to quickly deal with submitted patches and code. Please see our document on submitting patches and features!

Please follow the instructions at How to work with bazaar on the command line to get the source code

Configuration of Development Environment

Please check your OpenPetra.build.config file and make sure the paths are all adjusted to your system and the version numbers in the paths are correct.

This OpenPetra.build.config file is also the file where you set the database you want to use. If you want to switch the database system later, see Setup_of_Development_environment#Use_another_database_system.

NAnt script

There is a central NAnt script that is able to generate a lot of code and is able to do all automated tasks in the OpenPetra project.

Please see OpenPetra NAnt script for details

If you want to switch from SQLite to PostgreSQL which we recommend for serious development, please follow the instructions at Setup_of_Development_environment#Use_another_database_system.