John Sullivan: The Bad Plus at Jazz Alley
Sorry for the triple-language post
Today, Dec. 15, it's Zamenhof Day. Let's everybody
celebrate Esperanto!
Oggi, 15 Dicembre, lo Zamenhof Day. Festeggiamo tutti
l'Esperanto!
Hodia , 15-a de decembro, estas la Zamenhofa Tago. Festu
iuj la Esperanton!
Being able to rebuild an existing Debian package is a very useful skill. It s a prerequisite for many tasks that an admin might want to perform at some point: enable a feature that is disabled in the official Debian package, rebuild a source package for another suite (for example build a Debian Testing package for use on Debian Stable, we call that backporting), include a bug fix that upstream developers prepared, etc. Discover the 4 steps to rebuild a Debian package.
1. Download the source package
The preferred way to download source packages is to use APT. It can download them from the source repositories that you have configured in /etc/apt/sources.list, for example:
deb-src http://ftp.debian.org/debian unstable main contrib non-free deb-src http://ftp.debian.org/debian testing main contrib non-free deb-src http://ftp.debian.org/debian stable main contrib non-freeNote that the lines start with deb-src instead of the usual deb . This tells APT that we are interested in the source packages and not in the binary packages. After an
apt-get update you can use apt-get source publican to retrieve the latest version of the source package publican . You can also indicate the distribution where the source package must be fetched with the syntax package/distribution . apt-get source publican/testing will grab the source package publican in the testing distribution and extract it in the current directory (with dpkg-source -x, thus you need to have installed the dpkg-dev package).
$ apt-get source publican/testing Reading package lists... Done Building dependency tree Reading state information... Done NOTICE: 'publican' packaging is maintained in the 'Git' version control system at: git://git.debian.org/collab-maint/publican.git Need to get 727 kB of source archives. Get:1 http://nas/debian/ squeeze/main publican 2.1-2 (dsc) [2253 B] Get:2 http://nas/debian/ squeeze/main publican 2.1-2 (tar) [720 kB] Get:3 http://nas/debian/ squeeze/main publican 2.1-2 (diff) [4728 B] Fetched 727 kB in 0s (2970 kB/s) dpkg-source: info: extracting publican in publican-2.1 dpkg-source: info: unpacking publican_2.1.orig.tar.gz dpkg-source: info: unpacking publican_2.1-2.debian.tar.gz $ ls -dF publican* publican-2.1/ publican_2.1-2.dsc publican_2.1-2.debian.tar.gz publican_2.1.orig.tar.gzIf you don t want to use APT, or if the source package is not hosted in an APT source repository, you can download a complete source package with
dget -u dsc-url where dsc-url is the URL of the .dsc file representing the source package. dget is provided by the devscripts package. Note that the -u option means that the origin of the source package is not verified before extraction.
2. Install the build-dependencies
Again APT can do the grunt work for you, you just have to use apt-get build-dep foo to install the build-dependencies for the last version of the source package foo. It supports the same syntactic sugar than apt-get source so that you can run apt-get build-dep publican/testing to install the build-dependencies required to build the testing version of the publican source package.
If you can t use APT for this, enter the directory where the source package has been unpacked and run dpkg-checkbuilddeps. It will spit out a list of unmet build dependencies (if there are any, otherwise it will print nothing and you can go ahead safely). With a bit of copy and paste and a apt-get install invocation, you ll install the required packages in a few seconds.
3. Do whatever changes you need
I won t detail this step since it depends on your specific goal with the rebuild. You might have to edit debian/rules, or to apply a patch.
But one thing is sure, if you have made any change or have recompiled the package in a different environment, you should really change its version number. You can do this with dch --local foo (again from the devscripts package), replace foo by a short name identifying you as the supplier of the updated version. It will update debian/changelog and invite you to write a small entry documenting your change.
4. Build the package
The last step is also the simplest one now that everything is in place. You must be in the directory of the unpacked source package.$ cd publican-2.1 $ debuild -us -uc dpkg-buildpackage -rfakeroot -D -us -uc dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2 dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2 dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2 dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): dpkg-buildpackage: source package publican dpkg-buildpackage: source version 2.1-2rh1 dpkg-buildpackage: source changed by Rapha l Hertzog <hertzog> dpkg-source --before-build publican-2.1 dpkg-buildpackage: host architecture i386 [...] dpkg-deb: building package publican' in ../publican_2.1-2rh1_all.deb'. dpkg-genchanges >../publican_2.1-2rh1_i386.changes dpkg-genchanges: not including original source code in upload dpkg-source --after-build publican-2.1 dpkg-buildpackage: binary and diff upload (original source NOT included) Now running lintian... Finished running lintian.The build is over, the updated source and binary packages have been generated in the parent directory.
$ cd .. $ ls -dF publican* publican-2.1/ publican_2.1-2rh1.dsc publican_2.1-2.debian.tar.gz publican_2.1-2rh1_i386.changes publican_2.1-2.dsc publican_2.1-2rh1_source.changes publican_2.1-2rh1_all.deb publican_2.1.orig.tar.gz publican_2.1-2rh1.debian.tar.gz
Do you want to read more tutorials like this one? Click here to subscribe to my free newsletter, you can opt to receive future articles by email.
11 comments Liked this article? Click here. My blog is Flattr-enabled.
We've just posted
a news item
about the removal of non-free firmware from Debian's Linux kernel
packages. Kudos to the kernel team and others for the work involved to
make this happen!
While we would be much happier if these binary blobs were not
necessary at all, it's clear that some of our users may depend on them
to support the hardware they are using. So, as mentioned in that news
item, we've started making some unofficial CD images available that
include the non-free firmware packages that we can redistribute. If
you need one of these CDs, daily builds are to be found
at http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/
. Starting with the next debian-installer release (hopefully RC1,
coming soon!), we'll be generating fixed versions of these images to
match each release too.
Be aware that these are only netinstall images,
equivalent to the normal free netinst images that we normally produce
but with the firmware files added. If you want to do an installation
entirely from a set of CDs/DVDs/BDs then you will need to burn one of
these in addition to that set, then feed the rest of
the set when prompted to by the installer.
As I'm not currently working on any suitable paper, I'll just post this to my blog so it does not completely slip off my radar ;-) Also, it might be interesting to my reader. Readers? Oh, there are two of you now? Good!
Yesterday, I learnt thanks to Beatriz Busaniche that a group of South American Free Culture activists launched number zero of a magazine that promises to be very interesting: Cultura RWX, cultura en modo lectura, escritura y acci n (culture in reading, writing and action mode). Guys, best luck with this new project!
Anyway, reading it, I found this asseveration I want to keep at hand:
( )cuando surge la industria musical aparecen los derechos de autor como forma de defensa de los productores musicales, espec ficamente los m sicos. No tanto frente a los usuarios, porque hasta el cassette no existi posibilidad de copiar una obra musical. Era una defensa frente a las discogr ficas, que buscaban cerrar contratos muchas veces abusivos con los artistas. M sica en Libertad: La industria musical frente al cambio de paradigma; Mat as Lennie, adaptaci n: Sebasti n VazquezYes, yes, translating to English:
( )when the musical industry was born, copyright appeared as a means of defense of the musical producers, specifically of the musicians. Not so much against the users, because up until the invention of the cassette there was no possibility to copy a musical creation. It was a defense against the discographic companies, which tried to close often abusive contracts with the artists. Music in Freedom: Musical industry and the paradigm shift; Mat as Lennie, adaptation: Sebasti n V zquezI have argued (i.e. in here) in this same line regarding the birth of copyright itself It was an arrangement that had to be made between writers and printers, back in the XVI/XVII centuries. Simple individuals were just unable to get anything of value out of the copying technology they had at hand. Copyright was born in a time where reproduction required specialized equipment. Today, massive reproduction technology is a given for a good portion of the planet's population. Copyright now only defends big corporations And will inevitably fade away as anachronic. Of course, it refuses to go without a fight... But it cannot win long-term. We cannot afford to allow it!
A new package RcppDE has been uploaded in a first version 0.1.0 to
CRAN.
It provides differential evolution optimisation---a variant of stochastic
optimisation that is similar to genetic algorithms but particularly suitable
for the floating-point representations common in numerical optimisation.
It builds of on the nice
DEoptim package by
Ardia et al, but reimplements the algorithm in C++ (rather than C) using a
large serving of
Rcpp and
RcppArmadillo.
I worked on this on for a few evenings and weekends in October and November
and then spent a few more evenings writing a
paper / vignette
(which is finished as a very first draft now)
about it. This was an interesting and captivating problem as I had worked on
genetic algorithms going back quite some time to the beginning and then again
the end of graduate school (and traces of that early work are near the bottom of my
presentations page).
So what got me started?
DEoptim is a really
nice package, but it is implemented in old-school
C.
There is nothing wrong with that per se, but at the same time that I was
wrestling with GAs, I also taught myself
C++ which, to put it
simply, offers a few more choices to the programmer. I like having those choices.
And with all the work that
Romain and I have put into
Rcpp, I was curious
how far I could push this cart if I were to move it along.
I made a bet with myself starting from the old saw shorter, easier,
faster: pick any two. Would it be possible to achieve all three of
these goals?
DEoptim, and I take
version 2.0-7 as my reference point here, is pretty efficiently yet
verbosely coded. Copying a vector takes a loop with an assignment for each
element, copying a matrix does the same using two loops. Replacing that with
a single statement in C++ is pretty easy.
We also have a few little optimisations behind the scenes here and there in
Rcpp: would all
that be enough to move the needle in terms of performance?
And the same time,
DEoptim is also full
of the uses of the old R API which we often point to in the
Rcpp documentation
so fixing readibility should be a relatively low-hanging fruit.
To cut a long story short, I was able to reduce code size quite
easily by using a combination of
C++ and
Rcpp idioms. I was
also able to get to faster: the
paper / vignette
demostrates consistent speed improvements on all setups that I tested (three
standard functions on three small and three larger parameter vectors). More
important speed gains were achieved by allowing use of objective functions
that are written in C++
which again is both possible and easy thanks to
Rcpp.
That leaves easier to prove: adding compiled objective functions is
one indication; further proof could be provided by, say, moving the inner
loop to parallel execution thanks to Open MP
which I may attempt over the next few months. So far I'd like to give myself about
half a point here. So not quite yet shorter, easier, faster: pick any three, but working on it.
Over the next few days I may try to follow up with a blog post or two
contrasting some code examples and maybe showing a chart from the vignette.
Anna visited the Hollow a month ago and blogged a "tour of an
underground solar house".
She was quietly taking pictures the whole time, and I'm atonished how
well they capture the place.
I was honored to be the first in Rapha l Hertzog's
series of Debian developer interviews.
My interview
-- the others he's done since seemed better to me.
I was pleasantly surprised to open Linux Weekly News this week
and see an in-depth article
about git-annex. LWN's well-researched content continually
impresses.
Finally, I was indirectly mentioned in November's Science magazine.
I'll leave you to guess which of the articles is the one I influenced.
It's been an intense couple of days out at the Hollow. Did it only start to
snow yesterday? It feels like a long time in winter. Yesterday was the
first day that the solar panels produced no power, it was too cloudy and
snowing most of the time. I cleaned an inch of slushy snow off the panels
to no avail, and wondered if the power would last.
But the wood stove has kept it nice and warm, so yesterday was spent cosily
in the living room enjoying the snowfall, nethack, and podcasts. Also, I'm
very much enjoying cooking on the wood stove. I've never been in a position
to cook on one before; when I lived at Wortroot the stove was in the cabin,
and the cold kitchen in a different building. So cooking on the stove, or
even keeping a kettle on, was mostly only done in
emergencies. Here, I am constantly using it, and the
propane stove is still on its first 20 pound tank. Long slow cooked beany
or roastish stuff does especially well. Yesterday I did a great pork loin
roast with homemade quick sauerkraut.
Today, after cleaning another 3 inches of snow off the solar panels,
and scraping off a layer of ice, I am getting a decent amount of power
for a cloudy day with some snow still falling. Turns out it was good
I cleaned them yesterday after all, since a part I missed has a inch+
layer of hard ice, which I don't dare chip away at for fear of damaging
the panels. I'd not want to live someplace where it snowed a lot with
solar panels that didn't have some kind of a heating system.
I wish I had a camera to show the long walk down the driveway, through
the winter woods, and past the field where the wind blows gusts of
snow into the air. But my cell phone is on a Caribbean cruise.
I have been recording data ever since the fall equinox, and it's almost
to the winter solstice now. Time to geek out with some graphs! Solar
production has surely been falling off with the waning days, but it
seems like it will get through the shortest day with enough, and
from then on, no worries.
![]() |
![]() |
Last week I attended the WebKitGTK+ 2010 hackfest. It was a great opportunity to meet up with the other developers, discuss some plans for the future, hack away at WebKitGTK+. But, most importantly, play Street Figher 2 =). Thanks to Collabora and Igalia for sponsoring the hackfest, Igalia for hosting and organizing it (well done!), and the GNOME foundation for having sponsored my trip to Coru a!
Unlike last year we didn t find any big design issues hurting our work (page cache, I m looking at you!) on new futures. I also didn t have any huge plans for new API, although we did manage to get some new stuff in there, like the plugins management API Xan created, and the further work done by Dan in soup. This meant, from my point of view the hackfest has been a great oportunity to look at refactorings that we could do to further simplify understanding the code, changing it, and even sharing it =). Besides pushing the debian packaging of the 1.3.x series a bit further.
Coru a was great as always, and I enjoyed going around, eating and hacking there, although I got a cold on the last days which kinda hindered my ability to stare at the screen for too long, some times. Now that I m at the hot brazilian summer again I ll hopefully get better soon =)
Cheers \o/
I seem to have a sweet spot for having troubles with printers in stressy times. For restarting a stopped specific queue under CUPS it is easiest to specify:
cupsenable <queuename>The symmetric command for stopping is cupsdisable.
we release when it's readyand
good things come to those who wait. Julien Cristau is no exception. After a freeze period used to improve the quality of his research work bringing down to 0 the number of release critical bugs affecting it, Julien has just released his PhD thesis titled Jeux et automates sur les ordres:
Congrats, Doctor!
PS earlier on today, Julien has promised that,
as a gift to the Debian project for his new title, he will fix 50
Squeeze RC bugs by the end of the week. \o/
So, last week I bricked a device and I think I can fix it over a RS-232 cable from a borrowed Windows computer. However, I don t have the right cable in my office and the Windows computers I can borrow no longer have old-style serial ports. So I had two choices:
Someone recently pointed me to some economic/statistical models that were designed for eviews (a proprietary tool). They were looking for help converting the model into a format that could work with gretl (the Gnu Regression, Econometrics and Time-series Library). I'm afraid i'm an economics dunce, and i have no experience with this stuff. Any pointers?Tags: conversion, economics, gretl
as pointed out by Tolimar the
number of RC bugs is decreasing. here's the list of my small contributions
(which includes also one bug I've caused *cough*).
Sometimes, free software isn't better than proprietary, it's true - and one of the principal reasons is that the majority of free software does not use the full power of the freedom of the software. Far too many free software projects are single-developer projects. Many single-developer projects at SourceForge or Savannah and elsewhere have a single maintainer for the distribution providing the packages too and some (including nearly all of my own) have one person doing both jobs. In other words, there is no collaboration upstream or in packaging, so there is little or no benefit to the code of being free software...
I have an essay in the latest Free Software Foundation's bulletin
which FSF members should be receiving this week. I've also republished
the article on my website as When Free Software Isn't Better. The
article confronts the fact that free software is sometimes not as high
quality or featureful as proprietary alternatives and that most free
software projects aren't particularly collaborative. It reflects on
what these facts mean for free software and for open source.
The Bulletin goes out to all FSF associate members. You should
join to get a copy mailed to you in the future -- but mostly you
should join because doing so supports the work of the foundation.
Next.