Archive for category nwu
Autoconf and Python: checking for modules
Posted by stephan in foss, free software, nwu, observations on August 31, 2008
I am currently writing a Python application that makes use of GNU Autotools as build system and noticed that determining whether a specific Python module is installed is not that easy and no usable Autoconf macro exists. So I came up with my own solution, which I would like to share with you.
The AC_CHECK_PYTHON_MODULE macro takes two arguments: The module name and optionally the variable name holding version information. This way it is not only possible to determine whether a module is installed (ie. loads in Python) on the current system, but also retrieve version information from that module.
The following examples checks whether the Crypto module is installed and retrieves its version information from Crypto.__version__:
AC_CHECK_PYTHON_MODULE(Crypto, __version__)
The macro itself does never report and error, but rather only a found/not found result. Error checking is up to the user and can be done via these two Autoconf variables:
- PYTHON_<MODULE_NAME>
- PYTHON_<MODULE_NAME>_VERSION
PYTHON_<MODULE_NAME> is set to “1″ if the module is present and “0″ if not present.
PYTHON_<MODULE_NAME>_VERSION is only set when the version variable argument has been set and contains the version information of the module, if the module been found. If the module is not present this variable is also set to “0″.
The version variable argument is optional as I wrote, so the following invocation works too and only checks whether the distutils module is present:
AC_CHECK_PYTHON_MODULE(distutils)
As I wrote earlier in this article I would like to share this macro with you. You can download it here.
nwu development news #0
Posted by stephan in free software, nwu on January 16, 2008
So, today I am starting off with a new story series. The nwu development news.
Now what is this series about? Well, to make a long story short, it is about what has recently changed in nwu’s codebase and how nwu is coming along.
Just a sidenote, the first story in this series is of course number 0, as real programmers start counting at 0.
For those of you who are now wondering what nwu is or could be, I did write about nwu on this weblog already and the ‘nwu – an introduction’ post should give you a good idea of what it is.
So, what has changed recently? Basically I merged my changes back into trunk, which means that most of these things are going to be used now. This means that the application framework, the scheduler, the APT “Packages” file parser, support for gzip compression in both the SecureXMLRPC client and server and the brand-new RPC framework are either already being used, or are going to be used soon.
Except for the RPC framework, which would need to be adapted, and the application framework, which depends on nwu.common.config, all these pieces of code also work stand-alone and can be used in other python applications too.
Using parts of nwu in your project
Posted by stephan in free software, nwu on January 13, 2008
As I promised I am writing about nwu again. But instead of reporting on recent development efforts I would rather like to point something else out today: The nwu.common Python module contains code which can be used stand-alone in your applications. Some of the functions the module provides could come in handy, so I thought it was a good idea to let you know.
This article is going to explain the stand-alone nwu.common.* modules and their function.
nwu – an introduction
Posted by stephan in free software, nwu on January 13, 2008
This article should give you a brief overview of what network-wide updates, one of my projects, is about.
Network wide updates, or nwu, is a free software package licensed under the GPL (version 3 or later). It allows an administrator to remotely install software on and roll out security upgrades to managed computers. It is targeted at GNU/Linux systems using the Advanced Packaging Tool (APT) for package management and thus should run fine on all GNU/Linux distributions based on Debian GNU/Linux (such as gNewSense and all Ubuntu flavors).
