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