WastePo1ato | Hi. | 00:16 |
---|---|---|
bodhizazen | we shall be compiling today :) | 00:48 |
bodhizazen | so let's review how to connect to the shared ssh session shall we ? | 00:48 |
bodhizazen | http://paste.ubuntu.com/188659/ | 00:48 |
bodhizazen | can people try to connect and let me know if there are problems ? | 00:48 |
bodhizazen | please note: the server has changed | 00:49 |
bodhizazen | it is ssh.bodhizazen.net | 00:49 |
bodhizazen | wb swoody | 00:53 |
swoody | ty bodhizazen :) | 00:53 |
swoody | logging a lot, trying to get FreeBSD to boot :( | 00:54 |
bodhizazen | FreeBSD, now that's hard core, lol | 00:55 |
swoody | haha | 00:55 |
bodhizazen | 5 minute warning :) | 00:57 |
bodhizazen | not many on the ssh session , LOL | 00:58 |
bodhizazen | http://paste.ubuntu.com/188659/ | 00:58 |
* jgoguen is there \o/ | 00:59 | |
bodhizazen | >:) | 00:59 |
bodhizazen | anyone needing assistance connecting ? | 01:00 |
bodhizazen | are we ready to start then ? | 01:03 |
TuxPurple | yes :) | 01:03 |
jgoguen | yup | 01:03 |
bodhizazen | This session is in follow up to the last when we discussed installing packages | 01:03 |
bodhizazen | I will review installing from source today with a few tips | 01:04 |
bodhizazen | First, advantages / disadvantages of installing from source ? | 01:04 |
bodhizazen | advantage - newer package possibly with bug fixes | 01:04 |
bodhizazen | disadvantage - you will need to install dependencies manually | 01:05 |
bodhizazen | you will have to update manually | 01:05 |
bodhizazen | and you may break things, lol | 01:05 |
jimi_hendrix | bodhizazen, thats always amusing though :) | 01:05 |
bodhizazen | Let's start with a review of the most basic package installation | 01:05 |
bodhizazen | you need to install a few tools | 01:06 |
bodhizazen | apt-get install build-essential | 01:06 |
bodhizazen | ;) | 01:06 |
bodhizazen | then to install a package it is simple | 01:06 |
bodhizazen | download the source code | 01:06 |
bodhizazen | extract the archive | 01:06 |
bodhizazen | cd into archive | 01:06 |
bodhizazen | ./configure | 01:06 |
bodhizazen | make | 01:06 |
bodhizazen | make install | 01:07 |
bodhizazen | sudo make install , sorry | 01:07 |
bodhizazen | now lets go through that in some more detail | 01:07 |
bodhizazen | 1. download the source code | 01:07 |
bodhizazen | lets look at dillo | 01:08 |
bodhizazen | http://www.dillo.org/ | 01:08 |
Kasm279 | so i heard the class is on compiling drivers today? | 01:08 |
bodhizazen | yep | 01:08 |
bodhizazen | from the home page, go to dl page | 01:09 |
bodhizazen | http://www.dillo.org/download.html | 01:09 |
bodhizazen | ALWAYS LOOK ON THE PROJECT HOME PAGE FOR INFORMATIO | 01:09 |
bodhizazen | including bugs, fixes, and dependencies | 01:09 |
jimi_hendrix | bodhizazen, you may want to check the README too... | 01:10 |
bodhizazen | we are not there yet jimi_hendrix , patience | 01:10 |
bodhizazen | wget http://www.dillo.org/download/dillo-0.8.5.tar.bz2 | 01:10 |
jimi_hendrix | yes master | 01:10 |
Kasm279 | so, watsup right now? | 01:10 |
bodhizazen | now most source code is actually c | 01:11 |
bodhizazen | and needs to be compiled | 01:11 |
bodhizazen | some applications are python or distributed as binaries | 01:11 |
Kasm279 | what about shell scripts? | 01:11 |
bodhizazen | some is like nvidia, sorry excuses for linux programming run as an install script :) | 01:11 |
bodhizazen | vmare is that way too | 01:11 |
bodhizazen | back to dillo | 01:12 |
bodhizazen | Kasm279: the install scripts are the same, you still need to install teh dependencies | 01:12 |
Kasm279 | k | 01:12 |
bodhizazen | unpack the archive, usually a tar.gz , sometimes a zip or other archive | 01:12 |
bodhizazen | tar -xzvf dillo* | 01:13 |
bodhizazen | this will make a dillo-0.8.5 driectory | 01:13 |
bodhizazen | I personally keep these archives in ~/src | 01:13 |
bodhizazen | mkdir -p ~src/dillo | 01:13 |
bodhizazen | mv dillo-0.8.5 ~/src/dillo | 01:14 |
bodhizazen | now lets look at the archive | 01:14 |
bodhizazen | cd ~/src/dillo/dillo-0.8.5 | 01:14 |
bodhizazen | Now you may keep your archive anywhere, just so long as you cd into it :) | 01:15 |
Kasm279 | im wondering, what is dillo? | 01:15 |
bodhizazen | in the archive there is almost always a README | 01:15 |
bodhizazen | read the README now :) | 01:15 |
bodhizazen | Kasm279: http://www.dillo.org/ | 01:15 |
bodhizazen | just an example | 01:15 |
bodhizazen | The most common reason installation fails is what ? | 01:16 |
bodhizazen | anyone want to guess at that ? | 01:16 |
bodhizazen | failure to install the dependencies !!!!!! | 01:16 |
bodhizazen | you will get part way through the compile and it will fail with a cryptic message, this is almost always a problem with dependencies | 01:17 |
bodhizazen | dependenceies come in 2 flavors | 01:17 |
bodhizazen | -dev and lib | 01:17 |
bodhizazen | c uses headers | 01:17 |
bodhizazen | the headers are not in the ubuntu package | 01:18 |
bodhizazen | they are in the 8-dev | 01:18 |
bodhizazen | so while your application may list foo as a dependency | 01:18 |
bodhizazen | you can not simple | 01:18 |
bodhizazen | apt-get install foo | 01:18 |
bodhizazen | you almost always need | 01:18 |
bodhizazen | apt-get install foo-dev | 01:19 |
bodhizazen | sometimes foo is provided as a shard library | 01:19 |
bodhizazen | ie libfoo | 01:19 |
bodhizazen | in which case | 01:19 |
bodhizazen | apt-get install libfoo | 01:19 |
bodhizazen | when finding dependencies google is your friend | 01:19 |
bodhizazen | as is searching for packages | 01:20 |
bodhizazen | Want a trick ? | 01:20 |
bodhizazen | use apt-get | 01:20 |
bodhizazen | sudo apt-get build-dep bar | 01:20 |
bodhizazen | will download and install the dependencies for bar, including foo | 01:20 |
bodhizazen | >:) | 01:20 |
bodhizazen | OK, we are now done with dependencies | 01:21 |
bodhizazen | now let us compile and install | 01:21 |
bodhizazen | first configure | 01:21 |
bodhizazen | b4 you configure use | 01:21 |
bodhizazen | ./configure --help | 01:21 |
bodhizazen | this will list the options | 01:21 |
bodhizazen | you almost ALWAYS want one option | 01:21 |
bodhizazen | --prefix/usr/local | 01:22 |
bodhizazen | this installs teh application into /usr/local | 01:22 |
bodhizazen | so | 01:22 |
bodhizazen | /usr/lcoal/bin | 01:22 |
bodhizazen | rather then /bin | 01:22 |
bodhizazen | this will significantly reduce breakage | 01:22 |
bodhizazen | if you do not use this , you will create conflicts with apt-get | 01:23 |
bodhizazen | or apt-get will over write libs etc | 01:23 |
bodhizazen | or you will break apt-get (dpkg) | 01:23 |
bodhizazen | so | 01:23 |
bodhizazen | ./configure --prefix=/usr/local --with-option2 --enable-foo | 01:24 |
bodhizazen | next make | 01:24 |
bodhizazen | make | 01:24 |
bodhizazen | that will compile the app | 01:24 |
bodhizazen | then | 01:24 |
bodhizazen | sudo make install | 01:24 |
bodhizazen | to remove | 01:24 |
bodhizazen | sudo make uninstall | 01:24 |
bodhizazen | if you are luck | 01:24 |
bodhizazen | otherwise | 01:24 |
bodhizazen | locate bar | 01:24 |
bodhizazen | and rm -rf all instances of bar . lol | 01:25 |
bodhizazen | to run app | 01:25 |
bodhizazen | /usr/local/bar | 01:25 |
bodhizazen | You can use apt-get to build from source | 01:25 |
bodhizazen | enable the deb-src repo | 01:25 |
bodhizazen | then | 01:25 |
bodhizazen | apt-get source foo | 01:26 |
bodhizazen | then | 01:26 |
bodhizazen | sudo apt-get install dpkg-dev fakeroot | 01:26 |
bodhizazen | cd foo-0.1.0 | 01:27 |
bodhizazen | dpkg-dev fakeroot | 01:27 |
bodhizazen | dpkg-buildpackage -rfakeroot -uc -b | 01:27 |
bodhizazen | want to see some examples ? | 01:27 |
bodhizazen | I have a shared session and we can compile a simple application | 01:27 |
bodhizazen | everyone on the ssh session ? | 01:28 |
bodhizazen | anyone need help ? | 01:28 |
bodhizazen | OK, to make things faster I already downloaded the porgram hello | 01:28 |
bodhizazen | you can see the tar ball in ~/src/hello | 01:29 |
bodhizazen | lets extract | 01:29 |
bodhizazen | now we have hello-2.4 | 01:29 |
bodhizazen | so .. | 01:29 |
bodhizazen | it says to see INSTALL for directions | 01:30 |
bodhizazen | lets do it :) | 01:30 |
bodhizazen | it is checking for dependencies and system configuration | 01:31 |
bodhizazen | now it is ready | 01:31 |
bodhizazen | it is making (compiling) | 01:31 |
bodhizazen | done | 01:31 |
bodhizazen | now insatall | 01:31 |
bodhizazen | shall we test it ? | 01:32 |
bodhizazen | OOPS | 01:32 |
bodhizazen | do not forget to use sudo, lol | 01:33 |
bodhizazen | and you can see it works :) | 01:33 |
bodhizazen | now lets remove it | 01:33 |
bodhizazen | now it is gone | 01:33 |
bodhizazen | lets compile from the ubuntu repos :) | 01:34 |
bodhizazen | The application in the repos is called hello-debhelper | 01:34 |
bodhizazen | apt-get source has retrieved the package | 01:34 |
bodhizazen | no dependencies .... | 01:35 |
bodhizazen | building with dpkg-buildpackage -rfakeroot -uc -b | 01:35 |
bodhizazen | fakeroot means we can build without being root | 01:36 |
bodhizazen | now it builds a .deb in one directory higher | 01:36 |
bodhizazen | see it ? | 01:36 |
bodhizazen | hello-debhelper_2.2-3_amd64.deb | 01:36 |
bodhizazen | now lets install | 01:36 |
bodhizazen | sudo dpkg -i hello-debhelper_2.2-3_amd64.deb | 01:37 |
bodhizazen | and run ... | 01:37 |
bodhizazen | see how dpkg put it in /usr/bin ? | 01:37 |
bodhizazen | this is why we used --prefix=/usr/local >:) | 01:38 |
bodhizazen | remove ? | 01:38 |
bodhizazen | all gone now :) | 01:38 |
bodhizazen | Where to do for additional information ? | 01:38 |
bodhizazen | http://www.debian.org/doc/manuals/apt-howto/ch-sourcehandling.en.html | 01:39 |
bodhizazen | https://wiki.ubuntu.com/PackagingGuide | 01:39 |
bodhizazen | https://wiki.ubuntu.com/PackagingGuide/Complete | 01:39 |
bodhizazen | https://wiki.ubuntu.com/PbuilderHowto | 01:39 |
bodhizazen | Questions ? | 01:39 |
bodhizazen | Kasm279 you were asking about install scripts and what not ? | 01:40 |
bodhizazen | these are usually nvidia, ati, or vmware | 01:40 |
bodhizazen | the general process is the same | 01:40 |
bodhizazen | first install the dependencies | 01:40 |
bodhizazen | then download the install script | 01:41 |
bodhizazen | read the README | 01:41 |
bodhizazen | if there is one | 01:41 |
bodhizazen | ./install.sh --help | 01:41 |
bodhizazen | if there is any | 01:41 |
bodhizazen | then | 01:41 |
bodhizazen | chmod a+x ./install.sh | 01:41 |
bodhizazen | sudo ./install.sh | 01:41 |
bodhizazen | the install scripts will typically download and install the source code | 01:42 |
bodhizazen | nothing like compiling from source to silence a room, lol | 01:43 |
bodhizazen | questions ? | 01:43 |
bodhizazen | so now you are all experts on compiling from source then :) | 01:44 |
bodhizazen | want to see apparmor in action ? | 01:44 |
bodhizazen | BOO !!! | 01:45 |
mzz | no need to shout | 01:46 |
bodhizazen | OK, well I will hang for a few minutes then to see if there are any additional questions :) | 01:46 |
mzz | (also, can I scroll up a shared screen session the usual way or does that disrupt what others see?) | 01:46 |
bodhizazen | just checking mzz :) | 01:46 |
bodhizazen | yes mzz | 01:46 |
bodhizazen | you mau scroll at will | 01:47 |
mzz | drat, "copy: permission denied (guest)" | 01:47 |
bodhizazen | LOL | 01:47 |
* mzz must be doing it wrong | 01:47 | |
bodhizazen | do you want me to past bin something | 01:47 |
mzz | nah, don't bother | 01:47 |
bodhizazen | what client are you using ? | 01:47 |
jgoguen | mine's better: stuff: permission denied (user guest) | 01:47 |
mzz | oh, I use urxvt but I have its history disabled, because I normally use screen's (urxvt's doesn't really work if you're in a split screen session) | 01:48 |
bodhizazen | dam security | 01:48 |
bodhizazen | post a command here and I will run it | 01:48 |
bodhizazen | this session is logged | 01:48 |
bodhizazen | and if you wish I can pastebin output | 01:48 |
bodhizazen | w/ pastebin everyone can see | 01:49 |
mzz | nah, it's ok, I'll just read the actual documentation later | 01:49 |
bodhizazen | mzz: well, this is what I am here for now, demo and questions | 01:49 |
bodhizazen | so we have 10 min, ask away | 01:49 |
mzz | compiling stuff is easy, I'm only paying attention to the packaging-related bits | 01:50 |
bodhizazen | Ah | 01:50 |
bodhizazen | packaging for ubuntu is a bit more comples | 01:50 |
bodhizazen | the MOTU are giving session on packaging | 01:50 |
bodhizazen | we are building a moodle session to teach such things | 01:51 |
mzz | since nobody is saying much I'll share a slightly fakeroot-related story: be careful what you name the package you created here, because if a package with that name already exists you'll replace it | 01:51 |
mzz | I accidentally created a package called "udev" at one point, and almost didn't realise what I had just done before rebooting, which would have been bad. | 01:52 |
bodhizazen | LOL | 01:53 |
bodhizazen | I was asking the same question - how to name a package | 01:53 |
bodhizazen | https://help.launchpad.net/Packaging/PPA | 01:53 |
bodhizazen | specifically : https://help.launchpad.net/Packaging/PPA#Versioning | 01:53 |
bodhizazen | Any requests for future sessions ? | 01:54 |
bodhizazen | anyone want to tell us what I broke ? | 01:54 |
mzz | well, gnu hello had better be a well-behaved package with a working "make uninstall", but that may not always be the case | 01:55 |
bodhizazen | mzz: I can show yo uapparmor if you want | 01:55 |
bodhizazen | yes, you need to take great care in that | 01:56 |
bodhizazen | the good new is ... | 01:56 |
bodhizazen | usually you can manually remove stuff | 01:56 |
mzz | (I tend to install as "me" with --prefix pointing into my homedir to reduce the chance of catastrophic accidents) | 01:56 |
jgoguen | hehe | 01:56 |
bodhizazen | that works | 01:57 |
bodhizazen | /usr/local is if you want to share | 01:57 |
mzz | that doesn't always works, but if it does you can easily get rid of the package | 01:57 |
bodhizazen | I always keep the source code to any installed package | 01:57 |
mzz | oh, that's another point: "make uninstall" needs a configured source tree to run from, so you have to keep that around or recreate it (rerunning configure with the same args) | 01:58 |
mzz | so be careful, use fakeroot or the like if at all possible | 01:58 |
mzz | try with /usr if you dare :) | 01:59 |
bodhizazen | naw, /usr is not so good | 02:00 |
bodhizazen | ~/bin | 02:00 |
mzz | I meant your rm -rf | 02:00 |
bodhizazen | add ~/bin and /usr/local/bin to $PATH | 02:00 |
bodhizazen | no, it will remove /usr | 02:00 |
mzz | oh, ok, don't do that then :) | 02:00 |
bodhizazen | it will also kill rm -rf /* | 02:01 |
bodhizazen | see ? | 02:01 |
mzz | err, no | 02:01 |
mzz | (the "*" is expanded by the shell, so if rm -rf /* is safe so is rm -rf /usr, right?) | 02:02 |
bodhizazen | well the only reason the system is still running is apparmor, lol | 02:02 |
bodhizazen | no | 02:02 |
bodhizazen | rm -rf /* will rmove everything by / | 02:02 |
bodhizazen | *but* | 02:02 |
bodhizazen | OK, thanks everyone | 02:04 |
bodhizazen | I think the next planned session is next week | 02:04 |
bodhizazen | topic ? | 02:04 |
bodhizazen | or shall I choose ? | 02:04 |
mzz | go for it | 02:05 |
bodhizazen | kthxbi | 02:07 |
=== MaWaLe is now known as Wajih | ||
=== Wajih is now known as UBot-tn | ||
=== UBot-tn is now known as MaWaLe | ||
=== MaWaLe is now known as UBot-tn | ||
=== UBot-tn is now known as MaWaLe | ||
=== statik` is now known as statik | ||
=== agateau_ is now known as agateau | ||
=== yofel_ is now known as yofel | ||
=== kklimonda_ is now known as kklimonda | ||
=== MaWaLe is now known as UBot-tn | ||
=== UBot-tn is now known as MaWaLe |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!