Devbeginnings
|
Size: 4144
Comment:
|
Size: 10660
Comment: Add comment in Set up pbuilder section - /root/.pbuilder
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 5: | Line 5: |
| If you are a beginning software developer for Ubuntu or even just beginning software development for the first time on any platform, this guide will provide you with a start by giving an overview of the necessary steps as well as links to more detailed instructions and further resources. | Regardless whether you are a beginning software developer for Ubuntu or just beginning software development for the first time on any platform, and no matter which programming language you choose, this guide will provide you with a start by giving additional resources, overview the necessary steps for setting up your development platform and links to more detailed instructions. = Ubuntu Beginning Developer Resources = * Tutorials, documentation, languages pages and other useful links: '''[[https://wiki.ubuntu.com/CaliforniaTeam/Projects/CodeCamp2010| Beginning Ubuntu Gnu/Linux Development]]''': Code Camp session videos and presentations [[http://okiebuntu.homelinux.com/okwiki/pythonquest|Quest for Python]]: Excellent collection of learning Python resources. [[https://wiki.ubuntu.com/BeginnersTeam/FocusGroups/Development/Academy | Free Ubuntu-Beginners-Dev Programming Academy ]] [[https://wiki.ubuntu.com/BeginnersTeam/FocusGroups/Development/Academy/IntroToPython|Intro to Python]] [[https://wiki.ubuntu.com/MeetingLogs/openweekMaverick/HaveYouTriedTurningItOffAndThenOnAgain?|Finding Help with Ubuntu or "Have you tried turning it off and then on again?"]] * [[https://wiki.ubuntu.com/BeginnersTeam/FocusGroups/Development|Ubuntu-Beginners-Dev Focus Group]] {{https://launchpad.net/favicon.ico}} '''Launchpad''': LaunchpadHome:ubuntu-beginners-dev <<BR>> {{https://launchpad.net/@@/language}} '''IRC''': [[http://webchat.freenode.net/?channels=ubuntu-beginners-dev |#ubuntu-beginners-dev]]<<BR>> * How``Tos * Books (CC) links to Creative Commons books, and other FLOSS resources = Getting Started with Ubuntu Development = This section was built upon Daniel Holbach's Ubuntu Developer's Week class [[https://wiki.ubuntu.com/MeetingLogs/devweek1007/GetStarted|Getting Started with Ubuntu Development]] and enhanced with additional experience from beginning, intermediate and advanced Ubuntu developers. |
| Line 8: | Line 35: |
| == Ubuntu Beginning Development Overview == [with rough guestimates as to how much time each step might take] |
'''Daniel recommends bookmarking [[https://wiki.ubuntu.com/MOTU/GettingStarted |MOTU/Getting Started]]''' because it has many of the important links you'll need for Ubuntu development. |
| Line 11: | Line 37: |
| === Create a Launchpad account === Launchpad (LP) is the hub for most Ubuntu development. [20 minutes] https://help.launchpad.net/YourAccount/NewAccount |
'''Note:''' if all you wish to do is browse source code on Launchpad, no special preparation is required. Simply go to a launchpad project page (for example [[https://launchpad.net/wifix|https://launchpad.net/wifix]]), click on the '''Code''' tab at the top of the page and follow the links provided. |
| Line 15: | Line 39: |
| The following steps are specific to a particular computer you want to use as a Development platform. So if you want to move to a different computer you would need to repeat these steps. To keep it simple to explain we'll assume your development computer is running some form of Ubuntu though many other possibilites are quite workable. | == Tools Installation Quick Start == ''with rough minimal time estimates for the first time'' |
| Line 17: | Line 42: |
| === Create an SSH Key === | === Create a Launchpad account === [[https://help.launchpad.net/YourAccount/NewAccount | Set up a new Launchpad (LP) account ]]. LP is the hub for most Ubuntu development. ''20 minutes'' == Preparing your Ubuntu Development Platform == '''The following steps are specific to a particular computer''' you want to use as a Development platform. So if you want to move to a different computer you would need to repeat these steps. To keep it simple to explain we'll assume your development computer is running some form of Ubuntu though many other possibilities are quite workable. === Create an SSH Key and Register it with Launchpad === |
| Line 19: | Line 55: |
| [up to an hour or more] Log onto LP onto your LP account's 'Overview' page and where it says SSH Keys there is a little yellow round button with a pencil icon on it. Click on that. That will bring up another screen 'Change your SSH settings'. On that screen there is a help link called Importing your SSH key which will take you to: https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair === Verify Bazaar (bzr) is installed === or install it if not. Bazaar is the distributed version control system that Launchpad uses. [10 minutes] |
|
| Line 27: | Line 56: |
| a) Bazaar Explorer (bzr-explorer) http://www.ubuntugeek.com/bazaar-explorer-advanced-version-control-made-simple.html a gui wrapper for the CLI bzr is recommended for beginners as an excellent way to get started immediately with bzr, and learn bzr functions. Optionally the program can be set to display a terminal while running its functions which can be very educational and actually help to learn the CLI operations. Additionally it can function as sort of a simple project management program -- almost like an IDE (though without debugging). it shows you each of the files in the project and you can easily click on the file icon and bzr-explorer will open the editor of your choice. Also it gives easy access to functions like showing file diffs and displaying project revisions and the change log. Overall it helps to give an overview of what is going on in all the projects you are working on and provides a conceptual overview of how Bazaar works for beginner to advanced user alike. [installation 10 minutes] b) Bazaar itself is a remarkably simple to use CLI tool, so with just a little practice it is realistic to expect being able to become productive with it. http://doc.bazaar.canonical.com/latest/en/mini-tutorial/ , http://ubuntuforums.org/showthread.php?t=916132 |
Log onto LP onto your LP account's 'Overview' page and where it says SSH Keys there is a little yellow round button with a pencil icon on it. Click on that icon. That will bring up another screen 'Change your SSH settings'. On that screen there is a help link called Importing your SSH key which will take you to: [[ https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair| Creating an SSH Key Pair ]] |
| Line 32: | Line 58: |
| At this point you will at least be able to branch code that is on Launch Pad and thereby be ready to start examining project code. | SSH (Secure Shell) uses public-key cryptography for LP to authenticate your computer, associate your computer with your LP account and therefore allow you to branch or check out LP project code to that particular authenticated computer. |
| Line 34: | Line 60: |
| 4) Bazaar Branching operations [First time novice: devote at least an hour or more for learning how to and then actually creating your local branch and pulling source from the LP branch. Similar or more time for doing a push of source back up to LP Once experienced: can be done in as little as 10 minutes] |
''15 minutes'' == Installing Development Tools == === Minimal Shortcut: Verify Bazaar (bzr) is installed === '''NOTE: If you want the full tools installation please skip down to [[https://wiki.ubuntu.com/BeginnersTeam/FocusGroups/Development/Devbeginnings#Thorough%20Install:%20Ubuntu%20Development%20Tools|Thorough Install: Development Environment]] now''' Bazaar is the distributed version control system that Launchpad uses. ''10 minutes'' ==== Bazaar Explorer (bzr-explorer) ==== [[http://www.ubuntugeek.com/bazaar-explorer-advanced-version-control-made-simple.html|Bazaar Explorer: Advanced version control made simple]]. Bazaar Explorer is a gui wrapper for the CLI bzr is recommended for beginners as an excellent way to get started immediately with bzr, and learn bzr functions. Optionally the program can be set to display a terminal while running its functions which can be very educational and actually help to learn the CLI operations. Additionally it can function as sort of a simple project management program -- almost like an IDE (though without debugging). it shows you each of the files in the project and you can easily click on the file icon and bzr-explorer will open the editor of your choice. Also it gives easy access to functions like showing file diffs and displaying project revisions and the change log. Overall it helps to give an overview of what is going on in all the projects you are working on and provides a conceptual overview of how Bazaar works for beginner to advanced user alike. ''10 minutes installation'' ==== Bazaar (bzr) ==== [[ http://doc.bazaar.canonical.com/latest/en/mini-tutorial/ | Bazaar mini-tutorial ]] , [[http://ubuntuforums.org/showthread.php?t=916132 | how to use Bazaar ]] Bazaar itself is a remarkably simple to use CLI (Command Line Interface) tool, so with just a little practice it is realistic to expect being able to make basic productive Use of it. ''10 minutes installation'' |
| Line 40: | Line 85: |
| '''NOTE: At this point your computer will at least be able to branch code that is on Launch Pad and thereby be ready to start examining project code on your computer.''' However to push code back up to the server you'll minimally need to create a GPG Key pair. === Bazaar Branch and Pull Source Code === [[http://doc.bazaar.canonical.com/latest/en/mini-tutorial/|Bazaar mini-tutorial]] ''1 hour plus'' |
|
| Line 43: | Line 94: |
| === Thorough Install and Configure: Ubuntu Development Tools === The following will accomplish the installation of Bazaar as well as most of the tools you would need for Ubuntu development, '''minus [[https://wiki.ubuntu.com/BeginnersTeam/FocusGroups/Development/Devbeginnings#Minimal%20Shortcut:%20Verify%20Bazaar%20(bzr)%20is%20installed|the above recommended Bazaar Explorer]]''' and other specialized tools. {{{sudo apt-get install --no-install-recommends bzr-builddeb ubuntu-dev-tools fakeroot build-essential gnupg pbuilder debhelper}}} * bzr-builddeb pulls in bzr. * ubuntu-dev-tools pulls in devscripts which both are incredibly helpful at making repetitive packaging tasks easy. * fakeroot is needed by debuild (in devscripts) to mimic root privileges when installing files into a package. * build-essential pulls in lots of useful very basic build tools like gcc, make, etc. * gnupg is used to sign files in our case (uploads in the future). * pbuilder is a build tool that builds source in a sane, clean and minimal environment it sets up itself. * debhelper contains scripts that automate lots of the build process in a package. ''20 minutes plus'' |
|
| Line 45: | Line 116: |
| === Create GPG Key Pair and Register it with Launchpad === '''Note: if you have a GPG key already, skip this step.''' |
|
| Line 46: | Line 119: |
| [[https://help.ubuntu.com/community/GnuPrivacyGuardHowto|GPG HowTo]] | |
| Line 47: | Line 121: |
| == More Resources for the Ubuntu Beginning Developer == | Gnu Privacy Guard (GPG) Keys are used to sign files to upload (aka 'push') to LP, but more generally it is used to sign and encrypt mails, files or text. Developers use it to indicate that '''we''' were the last to touch a file and not somebody else. That ensures that only people who we know about get to upload packages. |
| Line 49: | Line 123: |
| * How``Tos | run: {{{ gpg --gen-key}}} Note: A GPG Key is not machine-specific. Once it has been generated you can just copy it to another machine. |
| Line 51: | Line 127: |
| Sticking to the defaults is totally fine, for example don't you need a comment if you need more info on gpg keys, go to [[https://help.ubuntu.com/community/GnuPrivacyGuardHowto|GPG HowTo]] which talks about everything in more detail. Enter your name, email address and just stick to the default values for now. It could be that gpg is still sitting there and waiting for more random data to generate your key - that's expected and fine. Just open another terminal while we carry on, it'll finish on its own |
|
| Line 52: | Line 130: |
| * Tutorials, documentation, languages pages and other useful links: | ''20 minutes plus'' |
| Line 54: | Line 132: |
| https://wiki.ubuntu.com/BeginnersTeam/FocusGroups/Development/Academy | === Set up pbuilder === |
| Line 56: | Line 134: |
| * Books (CC) | Open an editor and edit the file ~/.pbuilderrc (create if you don't have it yet) Add the following content to the file |
| Line 58: | Line 137: |
| links to Creative Commons books, and other FLOSS resources | {{{ COMPONENTS="main universe multiverse restricted" }}} |
| Line 60: | Line 139: |
| * Reaching the Ubuntu-Beginners-Dev Focus Group | and save it |
| Line 62: | Line 141: |
| {{https://launchpad.net/favicon.ico}} '''Launchpad''': LaunchpadHome:ubuntu-beginners-dev <<BR>> {{https://launchpad.net/@@/language}} '''IRC''': [[http://webchat.freenode.net/?channels=ubuntu-beginners-dev |#ubuntu-beginners-dev]]<<BR>> |
once you're done, run |
| Line 65: | Line 143: |
| {{{ sudo pbuilder create }}} | |
| Line 66: | Line 145: |
| ## Note - lantzr - This should be either /root/.pbuilderrc or do not use sudo. This will also take some time. |
|
| Line 67: | Line 148: |
| pbuilder builds packages in a clean and minimal environment It keeps your system "clean" (so you don't install huge numbers of build dependencies on your own system). It makes sure the package builds in a minimal, unmodified environment so you ensure that the package does not just build because you made lots of changes on your system, but the build is reproducible. You can update package lists (later on) with: sudo pbuilder update and to build packages you run: sudo pbuilder build package_version.dsc |
|
| Line 68: | Line 152: |
| pbuilder first gets the minimal packages for a base system, stores them in a tarball, and whenever you build a package it'll untar the base tarball, then install whatever your current build requires, then build it, then tear it all down again. It caches the packages for efficiency's sake. ''30 minutes'' === Configure other tools === While gpg and pbuilder are doing completing their operations we can tell some other tools who we are. If you use the bash shell, which is the default, please edit ~/.bashrc and at the end of it, please add values match those we put into GPG. {{{ DEBFULLNAME="<Your name>" }}} {{{ DEBEMAIL="<Your email address>" }}} and save it. Once you're done editing ~/.bashrc, please run {{{ source ~/.bashrc }}} (it's only needed once) ''10 minutes'' |
|
| Line 70: | Line 171: |
| CategoryBeginnersTeam | CategoryBeginnersTeam CategoryBeginnersTeam |
Ubuntu Development Beginnings
Regardless whether you are a beginning software developer for Ubuntu or just beginning software development for the first time on any platform, and no matter which programming language you choose, this guide will provide you with a start by giving additional resources, overview the necessary steps for setting up your development platform and links to more detailed instructions.
Ubuntu Beginning Developer Resources
- Tutorials, documentation, languages pages and other useful links:
Beginning Ubuntu Gnu/Linux Development: Code Camp session videos and presentations
Quest for Python: Excellent collection of learning Python resources.
Free Ubuntu-Beginners-Dev Programming Academy
Finding Help with Ubuntu or "Have you tried turning it off and then on again?"
Ubuntu-Beginners-Dev Focus Group
Launchpad: ubuntu-beginners-dev
IRC: #ubuntu-beginners-dev
HowTos
- Books (CC)
- links to Creative Commons books, and other FLOSS resources
Getting Started with Ubuntu Development
This section was built upon Daniel Holbach's Ubuntu Developer's Week class Getting Started with Ubuntu Development and enhanced with additional experience from beginning, intermediate and advanced Ubuntu developers.
Daniel recommends bookmarking MOTU/Getting Started because it has many of the important links you'll need for Ubuntu development.
Note: if all you wish to do is browse source code on Launchpad, no special preparation is required. Simply go to a launchpad project page (for example https://launchpad.net/wifix), click on the Code tab at the top of the page and follow the links provided.
Tools Installation Quick Start
with rough minimal time estimates for the first time
Create a Launchpad account
Set up a new Launchpad (LP) account.
LP is the hub for most Ubuntu development.
20 minutes
Preparing your Ubuntu Development Platform
The following steps are specific to a particular computer you want to use as a Development platform. So if you want to move to a different computer you would need to repeat these steps. To keep it simple to explain we'll assume your development computer is running some form of Ubuntu though many other possibilities are quite workable.
Create an SSH Key and Register it with Launchpad
(or import an already created one)
Log onto LP onto your LP account's 'Overview' page and where it says SSH Keys there is a little yellow round button with a pencil icon on it. Click on that icon. That will bring up another screen 'Change your SSH settings'. On that screen there is a help link called Importing your SSH key which will take you to: Creating an SSH Key Pair
SSH (Secure Shell) uses public-key cryptography for LP to authenticate your computer, associate your computer with your LP account and therefore allow you to branch or check out LP project code to that particular authenticated computer.
15 minutes
Installing Development Tools
Minimal Shortcut: Verify Bazaar (bzr) is installed
NOTE: If you want the full tools installation please skip down to Thorough Install: Development Environment now Bazaar is the distributed version control system that Launchpad uses.
10 minutes
Bazaar Explorer (bzr-explorer)
Bazaar Explorer: Advanced version control made simple.
Bazaar Explorer is a gui wrapper for the CLI bzr is recommended for beginners as an excellent way to get started immediately with bzr, and learn bzr functions. Optionally the program can be set to display a terminal while running its functions which can be very educational and actually help to learn the CLI operations. Additionally it can function as sort of a simple project management program -- almost like an IDE (though without debugging). it shows you each of the files in the project and you can easily click on the file icon and bzr-explorer will open the editor of your choice. Also it gives easy access to functions like showing file diffs and displaying project revisions and the change log. Overall it helps to give an overview of what is going on in all the projects you are working on and provides a conceptual overview of how Bazaar works for beginner to advanced user alike.
10 minutes installation
Bazaar (bzr)
Bazaar mini-tutorial , how to use Bazaar
Bazaar itself is a remarkably simple to use CLI (Command Line Interface) tool, so with just a little practice it is realistic to expect being able to make basic productive Use of it.
10 minutes installation
NOTE: At this point your computer will at least be able to branch code that is on Launch Pad and thereby be ready to start examining project code on your computer. However to push code back up to the server you'll minimally need to create a GPG Key pair.
Bazaar Branch and Pull Source Code
1 hour plus
Thorough Install and Configure: Ubuntu Development Tools
The following will accomplish the installation of Bazaar as well as most of the tools you would need for Ubuntu development, minus the above recommended Bazaar Explorer and other specialized tools.
sudo apt-get install --no-install-recommends bzr-builddeb ubuntu-dev-tools fakeroot build-essential gnupg pbuilder debhelper
* bzr-builddeb pulls in bzr.
* ubuntu-dev-tools pulls in devscripts which both are incredibly helpful at making repetitive packaging tasks easy.
* fakeroot is needed by debuild (in devscripts) to mimic root privileges when installing files into a package.
* build-essential pulls in lots of useful very basic build tools like gcc, make, etc.
* gnupg is used to sign files in our case (uploads in the future).
* pbuilder is a build tool that builds source in a sane, clean and minimal environment it sets up itself.
* debhelper contains scripts that automate lots of the build process in a package.
20 minutes plus
Create GPG Key Pair and Register it with Launchpad
Note: if you have a GPG key already, skip this step.
Gnu Privacy Guard (GPG) Keys are used to sign files to upload (aka 'push') to LP, but more generally it is used to sign and encrypt mails, files or text. Developers use it to indicate that we were the last to touch a file and not somebody else. That ensures that only people who we know about get to upload packages.
run: gpg --gen-key Note: A GPG Key is not machine-specific. Once it has been generated you can just copy it to another machine.
Sticking to the defaults is totally fine, for example don't you need a comment if you need more info on gpg keys, go to GPG HowTo which talks about everything in more detail. Enter your name, email address and just stick to the default values for now. It could be that gpg is still sitting there and waiting for more random data to generate your key - that's expected and fine. Just open another terminal while we carry on, it'll finish on its own
20 minutes plus
Set up pbuilder
Open an editor and edit the file ~/.pbuilderrc (create if you don't have it yet) Add the following content to the file
COMPONENTS="main universe multiverse restricted"
and save it
once you're done, run
sudo pbuilder create
This will also take some time.
pbuilder builds packages in a clean and minimal environment It keeps your system "clean" (so you don't install huge numbers of build dependencies on your own system). It makes sure the package builds in a minimal, unmodified environment so you ensure that the package does not just build because you made lots of changes on your system, but the build is reproducible. You can update package lists (later on) with: sudo pbuilder update and to build packages you run: sudo pbuilder build package_version.dsc
pbuilder first gets the minimal packages for a base system, stores them in a tarball, and whenever you build a package it'll untar the base tarball, then install whatever your current build requires, then build it, then tear it all down again. It caches the packages for efficiency's sake.
30 minutes
Configure other tools
While gpg and pbuilder are doing completing their operations we can tell some other tools who we are. If you use the bash shell, which is the default, please edit ~/.bashrc and at the end of it, please add values match those we put into GPG.
DEBFULLNAME="<Your name>"
DEBEMAIL="<Your email address>"
and save it. Once you're done editing ~/.bashrc, please run
source ~/.bashrc (it's only needed once)
10 minutes
BeginnersTeam/FocusGroups/Development/Devbeginnings (last edited 2016-03-13 11:32:18 by jarnos)