Do you use let's encrypt?





7144 votes ~ 23 comments

 

XML Logo

Posted by fsateler on Fri 11 Nov 2011 at 03:36
Today I was removing KDE from my laptop, when I realized that kde-window-manager would not go away (even when it was automatically installed) since it provides x-window-manager, which is needed by gdm. I manually removed it, but that got me thinking that maybe I had other packages that were in this situation. So I picked aptitude and tried to build some search-fu. Here is the resulting query:
aptitude search '?for x:
?x:installed
?x:automatic
?x:provides(?virtual ?reverse-depends(?installed))
?not(?x:reverse-depends(?installed(?depends(?=x))))'


Now, lets go over the query. The first part ?for x: allows us to refer to the package currently being matched. See the documentation for details. We'll see later why we need this. Basically we are saying: give me all packages x that match the following pattern. The second and third parts are trivial: we only want automatically installed packages.
The fourth part, ?x:provides(?virtual ?reverse-depends(?installed)) was easy: find all packages that provide a virtual package that is depended upon by some other installed package.
The fifth and final part, ?not(?x:reverse-depends(?installed(?depends(?=x)))) is why we needed the bound variable x. We want to filter out (hence the ?not) the packages that have some reverse dependency that depends directly on the package x. That way, in my case, metacity won't show up since gnome-core directly depends on it and is installed.

Unfortunately, this query doesn't grok alternative dependencies. For example, if gnome-core depended on metacity | x-window-manager then this query wouldn't show metacity, since it is depended upon by a package. If someone can make this query understand that so that it only eliminates packages directly depended upon with no alternatives dependencies, please let me know!

 

Posted by fsateler on Sat 18 Dec 2010 at 15:21
Tags: , ,
It seems the current trend is to use short-form dh. Some people have even thought that dh has superseded CDBS. Since I prefer CDBS for my own packaging, I will say that no, CDBS is not being deprecated and in fact has been active. Packaging with CDBS is very simple. I'll try to explain how it works, and how to package with it. This may turn into a blog post series, but I won't promise anything.

CDBS is a set of makefiles that do several tasks that are common while packaging software, so that you don't have to repeat them over and over on each package. The makefiles are classified into 2 groups: classes and rules. Classes implement the rules required for building and installing software. These are classes because they can and do inherit from others. For example, there is the makefile class, and the autotools, qmake and cmake classes inherit from it, and the gnome and kde (which is for kde 3) classes inherits from the autotools class. Rules implement several other general purpose rules that don't depend on the toolchain used to build the package. For example, there is the debhelper rules file, which takes care of creating the debian package using the usual dh_* commands. There are several rules files which do all sorts of useful stuff, from running license checks to downloading new upstream releases. If this post transforms into a series, we may look into some of them. For now, I'll demonstrate how to use CDBS to package some simple software (only the debian/rules file, of course).

The first task while running creating debian/rules is determining which build system the software uses. I will use qutecsound package as a guide. So, first things first, we start using CDBS!
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/qmake.mk


Now this would be all that is required if qutecsound where a standard qmake package where nothing needs to be customized. Alas, this is not the case. First, there are some variables that need to be passed to qmake to appropriately configure the build. Also, the projects .pro file is not standard-named. How do we fix this? The CDBS way of overriding this kind of behavior is through the use of variables. Since we are using the qmake class, we will be overriding variables named DEB_QMAKE_*:
DEB_QMAKE_CONFIG_VAL += build64
DEB_QMAKE_ARGS = qcs.pro


We add a configuration value (because CDBS is setting other config values), and we set the extra arguments to qmake.

Now, there is a problem: the resulting binary is not created with the name we want. How do we change that? We could patch the source to avoid that, but it is far easier to add a rule to the makefile to do that. We will modify the build to rename the file at the end (and then clean it up on clean because the upstream makefile will not spot it):
build/qutecsound::
[ -f bin/qutecsound ] || mv bin/qutecsound-d bin/qutecsound

clean::
rm -f bin/qutecsound


So what did we just do? We extended the build and clean rules with extra stuff to do. In CDBS each package listed in debian/control gets a build/package rule (and several others at different stages of the build) so that one can add stuff specific to each package (this will be much more useful when dpkg finally learns about build-arch and build-indep).

For the final touch, we want to do a few more things. First, we want to ensure that we are using QT4's qmake, because the build will fail if QT3's is used. Second, since I created a manpage for the command, I want to install it. Finally, we want to use parallel building when the user has specified it, to build the project faster. How to do that? Again, via variables:
QMAKE = qmake-qt4
DEB_BUILD_PARALLEL = 1
DEB_INSTALL_MANPAGES_qutecsound = debian/qutecsound.1


CDBS creates several variables for each of the packages listed in debian/control, so we can customize each package build. In our case, this variable is passed to dh_installman from the debhelper rules file (CDBS will invoke the debhelper tools once for each binary package).

After all this we now have the complete debian/rules of a relatively simple package. How does it look like? Like this:
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/qmake.mk

QMAKE = qmake-qt4
DEB_QMAKE_CONFIG_VAL += build64
DEB_QMAKE_ARGS = qcs.pro
DEB_BUILD_PARALLEL = 1

DEB_INSTALL_MANPAGES_qutecsound = debian/qutecsound.1

build/qutecsound::
[ -f bin/qutecsound ] || mv bin/qutecsound-d bin/qutecsound

clean::
rm -f bin/qutecsound

 

Posted by fsateler on Tue 24 Aug 2010 at 02:13
Tags: none.

 

Posted by fsateler on Wed 30 Apr 2008 at 23:23
Tags: ,

Use this aptitude line to find out about all packages that are:

  1. Automatically installed
  2. No package depends on it (ie, they are in your computer because someone recommended it).

aptitude search '?and( ?automatic(?reverse-recommends(?installed)), ?not(?automatic(?reverse-depends(?installed))) )'

 

Posted by fsateler on Sun 2 Dec 2007 at 22:59
Tags: none.
I've finally gotten around to getting my own domain name (DDNS) and setting up a 24/7 server at home. I installed a postfix mail server, but every now and then I get a message like this after trying to send e-mail:
host gmail-smtp-in.l.google.com[209.85.163.27] said:
    550-5.7.1 [201.222.xxx.xxx] The IP you're using to send email is not
    authorized  550-5.7.1 to send email directly to our servers. Please use
    550 5.7.1 the SMTP relay at your service provider instead. n29si1594017elf
    (in reply to end of DATA command)

Damn gmail... do I have to change to an ISP that doesn't host that many spammers??

 

Posted by fsateler on Sun 17 Jun 2007 at 00:39
Tags: none.
Today I uploaded my packages for BTG and Rasterbar's libtorrent to BTG's web site. BTG is a BitTorrent client working on top of (evidently) Rasterbar's libtorrent. The cool thing about it is that it works in a client-server model: there is a daemon, and there are 4 clients you can use to connect to it. This makes it very interesting for use in a home network: leave bittorrent running in your headless server, and connect to it via one of the interfaces: cli, ncurses, gtk and web-based.
What makes this double-interesting is that these are my first library and multi-binary packages, and that I setup a non-trivial signed repository on btg's ftp site. The public key is public_key.asc visible in the repository's root, and has an md5sum of 00f252f6c6da68f32972750db70ff262.

Now the only thing left is to get someone to sponsor it into Debian.


In an utterly, completely unrelated note, I can put html when in BBCode mode in here... which is really cool! Now I can use html and don't worry about those tedious <br/>

 

Posted by fsateler on Mon 14 May 2007 at 20:11
Tags: none.
This was funny. While browsing OSWeekly suddenly a popup asked me to find out more about the Linux Operating System using Microsoft Live search.
Kind of ironic, isn't it?

 

Posted by fsateler on Fri 6 Apr 2007 at 21:21
Tags: none.
I've been thinking of writing apt-listreadme. It is basically the same as apt-listchanges, but it would list readmes instead of the changelogs. So it would have to extract both debian and upstream's readmes (obviusly this could be configured), display them (through less, a web browser) and/or mail them to someone. I have to consider also if it makes sense to write a new program instead of adding to apt-listchanges (which seems much more logical).
The idea is that whenever installing *new* packages, the readme should be shown, as I usually never read them and it is useful to read them. Obviously they shouldn't be displayed when upgrading or reinstalling a package.

 

Posted by fsateler on Tue 3 Apr 2007 at 01:53
Tags: none.
I've recently been given a new keyboard, an EZKey EZ-7000. This looks like a nice keyboard (yeah I like lots of buttons), but I haven't got it working completely yet. I managed to get most buttons working, but I seem to have lost the function keys (fortunately I still have F1 and F7 (actually F6 sends a F7), so I can switch to at least one console and back to X). I've been trying to find out how to map the keyboard keys to X keys, and haven't had any luck. It seems like xkb is the way to go, although it seems like it might be a full year before I even understand what the hell I am supposed to modify/create to get it working.

PS: I just now discovered that this keyboard wasn't that good after all: to make some "shortcuts" it assigned several keys different values than usual: so pressing F2 will get a CTRL+N sent instead, which is the default for bold typeface in windows+spanish (which is the drawing on top of the key), pressing F7 will send CTRZ+Z, which is the undo combo... damn keyboard, I think I'll have to ditch it unless I somehow manage to override the behaviour.

 

Posted by fsateler on Tue 20 Mar 2007 at 21:33
So I finally got around to installing Windows (I haven't had Windows installed in about a year). Since I already had a working Debian install, I just installed Windows on an empty partition. I usually do it the other way around, but of course I wasn't going to reinstall Debian to use my usual approach. After the windows install, I found myself without grub in the MBR. This was totally expected, and one of the reasons I usually install Windows first. Recovering the MBR was far simpler than expected. I just popped in the Debian Etch installer, right after boot got to a terminal (Alt+F2), and did the following
mkdir /mnt/temp
mount /dev/sda1 /mnt/temp
mount --bind /dev /mnt/temp/dev
mount --bind /proc /mnt/temp/proc
mount --bind /sys /mnt/temp/sys
chroot /mnt/temp
grub
When grub loads, I then did the following:
root (hd0,0)
install /boot/grub/stage1 (hd0) /boot/grub/stage2
Then rebooted, and got a grub console instead of my usual grub screen. No problem: just do
configfile (hd0,0)/boot/grub/menu.lst
and the usual interface is up.
After my desktop loaded, I found the grub-install command that would do a better install than me:
grub-install /dev/sda
And then I had a completely normal boot screen. I just had to add the new Windows entry to menu.lst and I was set.
So there goes the ancient fear that installwing Windows after Linux is a pain. There are, of course, cases in which it is a pain (I remember once windows messed with my partition table and linux wouldn't boot), but this time I had absolutely no problems.

--
Felipe Sateler