SetupDeveloperEnvironment

Differences between revisions 1 and 46 (spanning 45 versions)
Revision 1 as of 2012-11-12 10:12:24
Size: 3204
Editor: 80
Comment:
Revision 46 as of 2013-05-12 15:28:26
Size: 6456
Editor: h-4-180
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
 * Set up launchpad account
 * Set up developer system
 * Set up testing system
<<Include(UbuntuStudio/Navigation/Header)>>
||<tablestyle="width: 30%; float: right; background-color: #e1f0f4; border-radius: 10px;"><<Include(UbuntuStudio/Navigation/DevSideBar)>>||
Line 5: Line 4:
== Create GPG Key == <<TableOfContents>>
Line 7: Line 6:
"GPG stands for GNU Privacy Guard and it implements the OpenPGP standard which allows you to sign and encrypt messages and files. This is useful for a number of purposes. In our case it is important that you can sign files with your key so they can be identified as something that you worked on. If you upload a source package to Launchpad, it will only accept the package if it can absolutely determine who uploaded the package." = Set Up A Basic Developer Environment =
Line 9: Line 8:
'''Command to create a gpg key in a terminal''' == Before you begin ==

Before doing this, you might want to install the [[UbuntuStudio/InstallDevelopmentRelease|Development Release]] first.

== Setup Launchpad Account ==

First thing you need to do is set up a [[http://launchpad.net|launchpad]] account. We do most of our planning, task management, and team management on launchpad. Some launchpad teams have special privileges. The link for creating an account is: https://login.launchpad.net/+new_account

To use launchpad fully, you'll need a GPG key, which is your virtual ID.
To handle source on launchpad you'll need a SSH key (which is sort of like an actual key to a lock).

== Create a GPG Key ==

GPG Stands for [[http://gnupg.org/| Gnu Privacy Guard]].

Initially, you are required to have a GPG key in order to sign the launchpad Code of Conduct. As a developer you will be using the GPG key to sign things like changes to Ubuntu source packages. Other people will know you were the one to make a change to a package from your gpg signature.

This key is your virtual identity, so be careful with it!

First, make sure you have installed gnupg
Line 12: Line 30:
gpg --gen-key $ sudo apt-get install gnupg
Line 15: Line 33:
'''Press ''Enter'' to select ''(default)'':''' === Creating the GPG key in a terminal ===

To create a GPG key, use this command in a terminal:
Line 17: Line 38:
Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
$ gpg --gen-key
Line 24: Line 41:
'''Press ''Enter'' to select ''(2048)'':''' Follow the instructions carefully. Choosing the default options is fine. Make sure to type in your '''real name''' and the '''email''' you want to have associated with your key. Choose a secure passphrase. If you loose the passphrase, there is no way to retrieve it.

'''Publish your key'''

Once you are done, you will need to publish your key to a server in order for it to be usable. First, you need to find out what your public ID is. To see all the GPG keys in your system, do:
Line 26: Line 48:
What keysize do you want? (2048) $ gpg --list-keys
Line 29: Line 51:
'''Press ''Enter'' to select ''(0)'':'''
{{{
Please specify how long the key should be valid.
         0 = key does not expire
      <n> = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0)
}}}

'''Answer ''y'' for Yes:'''
{{{
Is this correct? (y/N)
}}}

'''Type your real name here:'''
In this example, the public ID is '''F06EFAE2'''
Line 48: Line 54:
You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
    "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"

Real name: Kaj Ailomaa
}}}

'''Type your email adress:'''
{{{
Email address: zequence@mousike.me
}}}

'''Add a comment for you to keep track of this gpg key:'''
{{{
Comment: Debian/Ubuntu signing key
}}}

'''Answer ''O'' to accept:'''
{{{
You selected this USER-ID:
    "Kaj Ailomaa (Debian/Ubuntu package signing key) <zequence@mousike.me>"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit?
}}}

'''Create a password which will be used each time you sign with this key:'''
{{{
Enter passphrase: <longandcomplexpassword>
}}}

'''The result will look something like this:'''
{{{
gpg: key F06EFAE2 marked as ultimately trusted
public and secret key created and signed.

gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u
Line 87: Line 55:
      Key fingerprint = 85A3 E041 0A36 8A7C 9EDA 06C9 1473 559D F06E FAE2
Line 92: Line 59:
'''Next, you need to upload the public part of your key to a keyserver so the world can identify messages and files as yours. To do so, enter:''' ''(KEY ID in my case is F06EFAE2 as seen above)'' Now, publish your GPG key using your public ID:
Line 94: Line 62:
gpg --send-keys <KEY ID> $ gpg --send-keys <KEY ID>
Line 97: Line 65:
'''It may take up to one hour before the key is published and ready to be used''' It may take up to an hour before your key is published and ready to be used. There are alternative key servers to publish to, which may be quicker.
Line 99: Line 67:
[[http://developer.ubuntu.com/packaging/html/getting-set-up.html#create-your-gpg-key|GPG Reference at developer.ubuntu.com]] Your gpg keys end up in '''~/.gnupg'''
Line 101: Line 69:
== Create SSH Key == ''Read more about [[https://help.ubuntu.com/community/GnuPrivacyGuardHowto|GPG]] at the Ubuntu Community Wiki.''
Line 103: Line 71:
== Setup Launchpad Account == == Create a SSH Key ==
Line 105: Line 73:
== Setup Developer System == SSH stands for [[http://www.openssh.com/|Secure Shell]]. It's a method for connecting securely to remote places.
Line 107: Line 75:
== Setup Testing Environment == As a developer, you will need a SSH client in combination with a SSH key in order upload changes to Ubuntu source.

First, make sure you have install the SSH client:

{{{
$ sudo apt-get install openssh-client
}}}

=== Creating the SSH Key in a Terminal ===

To create a SSH key in a terminal:

{{{
$ ssh-keygen -t rsa
}}}

You can now find your keys in '''~/.ssh/'''

''Read more about [[http://help.ubuntu.com/community/SSH|SSH]] at the Ubuntu Community Wiki''

== Finish Setting Up Launchpad ==

=== Add the GPG key ===

First, get the fingerprint for your gpg key. In a terminal, do:

{{{
gpg --fingerprint
}}}

GPG will display a message similar to:

{{{
pub 1024D/12345678 2007-01-26
Key fingerprint = 0464 39CD 2486 190A 2C5A 0739 0E68 04DC 16E7 CB72
Geoffrey Hayes (My OpenPGP key) <geoffrey@bungle.com>
sub 2048g/ABCDEF12 2007-01-26
}}}

Highlight and copy only the numeric fingerprint: 0464 39CD 2486 190A 2C5A 0739 0E68 04DC 16E7 CB72 in the example above.

In your launchpad profile page ( https://launchpad.net/~yourusername ), edit the '''OpenPGP Keys''' field. You will be asked to login, as a safety measure.

Under '''Import an OpenPGP key''', paste your fingerprint. Now, click '''Import Key'''. (Remember, the key needs to be published before this will work.

=== Add the ssh key ===

First, let's get your public key. If you created it with the default file name, you can retrieve your public key with (notice that you have both a public and a secret key in ~/.ssh/):

{{{
cat ~/.ssh/id_rsa.pub
}}}

Copy the entire text that appers to your clipboard.

In your launchpad profile page ( https://launchpad.net/~yourusername ), edit the '''SSH Keys''' field. You will be asked to login, as a safety measure.

Paste the public key into the '''Add an SSH key''' field.

=== Sign Code of Conduct ===

In order for you to be able to upload source to launchpad, you will need to have signed the Code of Conduct. For this you need your gpg key. Go to [[https://help.launchpad.net/Signing%20the%20Ubuntu%20Code%20of%20Conduct]] for instructions on how to sign it.

== Set up Debian variables ==

When building Debian source packages, the build tools will look for two variables. DEBEMAIL and DEBFULLNAME.

In your ~/.bashrc, add this (replace with your name and email):

{{{
DEBFULLNAME="John Doe"
DEBEMAIL="johndoe@mailserver"
export DEBEMAIL DEBFULLNAME
}}}

These variables will be in effect next time you open a new Terminal shell.

== Set up bazaar ==

Bazaar is a source version control system used in launchpad. First make sure you have installed it:

{{{
sudo apt-get install bzr
}}}

Then, add your name and email to ~/.bazaar/bazaar.conf by doing (replace with your name and email):
{{{
bzr whoami "Kaj Ailomaa <zequence@mousike.me>"
}}}


== Set up git ==

git is another, very powerful source version control system, and to be able to get source from github, or Debian source repositories, you will need to use git.

First, install git:
{{{
sudo apt-get install git
}}}

Then, let git know who you are (replace with your name):
{{{
git config --global user.name "Kaj Ailomaa"
git config --global user.email zequence@mousike.me
}}}

Each git repo may have a .gitconfig file with your personal settings, but this is a global file, which you will find in ~/.gitconfig

== Install some build tools ==

Get some tools needed for packaging.

{{{
sudo apt-get install ubuntu-dev-tools germinate python3-germinate fakeroot debhelper packaging-dev
}}}

----
CategoryUbuntuStudioDev

Set Up A Basic Developer Environment

Before you begin

Before doing this, you might want to install the Development Release first.

Setup Launchpad Account

First thing you need to do is set up a launchpad account. We do most of our planning, task management, and team management on launchpad. Some launchpad teams have special privileges. The link for creating an account is: https://login.launchpad.net/+new_account

To use launchpad fully, you'll need a GPG key, which is your virtual ID. To handle source on launchpad you'll need a SSH key (which is sort of like an actual key to a lock).

Create a GPG Key

GPG Stands for Gnu Privacy Guard.

Initially, you are required to have a GPG key in order to sign the launchpad Code of Conduct. As a developer you will be using the GPG key to sign things like changes to Ubuntu source packages. Other people will know you were the one to make a change to a package from your gpg signature.

This key is your virtual identity, so be careful with it!

First, make sure you have installed gnupg

$ sudo apt-get install gnupg

Creating the GPG key in a terminal

To create a GPG key, use this command in a terminal:

$ gpg --gen-key

Follow the instructions carefully. Choosing the default options is fine. Make sure to type in your real name and the email you want to have associated with your key. Choose a secure passphrase. If you loose the passphrase, there is no way to retrieve it.

Publish your key

Once you are done, you will need to publish your key to a server in order for it to be usable. First, you need to find out what your public ID is. To see all the GPG keys in your system, do:

$ gpg --list-keys

In this example, the public ID is F06EFAE2

pub   2048R/F06EFAE2 2012-11-12
uid                  Kaj Ailomaa (Debian/Ubuntu signing key) <zequence@mousike.me>
sub   2048R/140030E5 2012-11-12

Now, publish your GPG key using your public ID:

$ gpg --send-keys <KEY ID>

It may take up to an hour before your key is published and ready to be used. There are alternative key servers to publish to, which may be quicker.

Your gpg keys end up in ~/.gnupg

Read more about GPG at the Ubuntu Community Wiki.

Create a SSH Key

SSH stands for Secure Shell. It's a method for connecting securely to remote places.

As a developer, you will need a SSH client in combination with a SSH key in order upload changes to Ubuntu source.

First, make sure you have install the SSH client:

$ sudo apt-get install openssh-client

Creating the SSH Key in a Terminal

To create a SSH key in a terminal:

$ ssh-keygen -t rsa

You can now find your keys in ~/.ssh/

Read more about SSH at the Ubuntu Community Wiki

Finish Setting Up Launchpad

Add the GPG key

First, get the fingerprint for your gpg key. In a terminal, do:

gpg --fingerprint

GPG will display a message similar to:

pub 1024D/12345678 2007-01-26
Key fingerprint = 0464 39CD 2486 190A 2C5A 0739 0E68 04DC 16E7 CB72
Geoffrey Hayes (My OpenPGP key) <geoffrey@bungle.com>
sub 2048g/ABCDEF12 2007-01-26

Highlight and copy only the numeric fingerprint: 0464 39CD 2486 190A 2C5A 0739 0E68 04DC 16E7 CB72 in the example above.

In your launchpad profile page ( https://launchpad.net/~yourusername ), edit the OpenPGP Keys field. You will be asked to login, as a safety measure.

Under Import an OpenPGP key, paste your fingerprint. Now, click Import Key. (Remember, the key needs to be published before this will work.

Add the ssh key

First, let's get your public key. If you created it with the default file name, you can retrieve your public key with (notice that you have both a public and a secret key in ~/.ssh/):

cat ~/.ssh/id_rsa.pub

Copy the entire text that appers to your clipboard.

In your launchpad profile page ( https://launchpad.net/~yourusername ), edit the SSH Keys field. You will be asked to login, as a safety measure.

Paste the public key into the Add an SSH key field.

Sign Code of Conduct

In order for you to be able to upload source to launchpad, you will need to have signed the Code of Conduct. For this you need your gpg key. Go to https://help.launchpad.net/Signing%20the%20Ubuntu%20Code%20of%20Conduct for instructions on how to sign it.

Set up Debian variables

When building Debian source packages, the build tools will look for two variables. DEBEMAIL and DEBFULLNAME.

In your ~/.bashrc, add this (replace with your name and email):

DEBFULLNAME="John Doe"
DEBEMAIL="johndoe@mailserver"
export DEBEMAIL DEBFULLNAME

These variables will be in effect next time you open a new Terminal shell.

Set up bazaar

Bazaar is a source version control system used in launchpad. First make sure you have installed it:

sudo apt-get install bzr

Then, add your name and email to ~/.bazaar/bazaar.conf by doing (replace with your name and email):

bzr whoami "Kaj Ailomaa <zequence@mousike.me>"

Set up git

git is another, very powerful source version control system, and to be able to get source from github, or Debian source repositories, you will need to use git.

First, install git:

sudo apt-get install git

Then, let git know who you are (replace with your name):

git config --global user.name "Kaj Ailomaa"
git config --global user.email zequence@mousike.me

Each git repo may have a .gitconfig file with your personal settings, but this is a global file, which you will find in ~/.gitconfig

Install some build tools

Get some tools needed for packaging.

sudo apt-get install ubuntu-dev-tools germinate python3-germinate fakeroot debhelper packaging-dev


CategoryUbuntuStudioDev

UbuntuStudio/SetupDeveloperEnvironment (last edited 2015-11-09 12:16:45 by h-141-65)