configuration.xhtml   [plain text]


<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>The Evolution of Finger: configuration and packaging of the finger service</title>
  </head>
<body>

<h1>The Evolution of Finger: configuration and packaging of the finger service</h1>

<h2>Introduction</h2>

<p> This is the eleventh part of the Twisted tutorial <a
href="index.xhtml">Twisted from Scratch, or The Evolution of Finger</a>.</p>

<p>In this part, we make it easier for non-programmers to configure a finger
server, and show how to package it in the .deb and RPM package formats.</p>

<h2>Plugins</h2>

<p>So far, the user had to be somewhat of a programmer to be able to configure
stuff. Maybe we can eliminate even that? Move old code to finger/__init__.py and...</p>
<p>
Full source code for finger module here: <a class="py-listing" href="listings/finger/finger/finger.py">finger module</a>
</p>

<a href="listings/finger/finger/tap.py" class="py-listing">finger/tap.py</a>

<p>And register it all:</p>

<a href="listings/finger/finger/plugins.tml" class="py-listing">finger/plugins.tml</a>

<p>And now, the following works</p>

<pre class="shell">
% mktap finger --file=/etc/users --ircnick=fingerbot
% sudo twistd -nf finger.tap
</pre>

<h2>OS Integration</h2>

<p>If we already have the <q>finger</q> package installed in
PYTHONPATH (e.g.  we added it to site-packages), we can achieve easy
integration:</p>

<h3>Debian</h3>

<pre class="shell">
% tap2deb --unsigned -m "Foo &lt;foo@example.com&gt;" --type=python finger.tac
% sudo dpkg -i .build/*.deb
</pre>

<h3>Red Hat / Mandrake</h3>

<pre class="shell">
% tap2rpm --type=python finger.tac #[maybe other options needed]
% sudo rpm -i .build/*.rpm
</pre>

<p>Will properly register the tap/tac, init.d scripts, etc. for the given file.</p>

<p>If it doesn't work on your favorite OS: patches accepted!</p>
</body>
</html>