07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The interpretation of such a rule is as follows: if one of the files of sources is<br />

more recent than the target file, then the target needs to be generated, using<br />

command1 and command2.<br />

Note that the command lines must start with a tab character; also note that<br />

when a command line starts with a dash character (-), failure of the command<br />

does not interrupt the whole process.<br />

The rules file usually contains a set of rules used to configure, build and install the software<br />

in a dedicated subdirectory (named after the generated binary package). The contents of this<br />

subdirectory is then archived within the Debian package as if it were the root of the filesystem.<br />

In our case, files will be installed in the debian/falcot-data/usr/share/falcot-data/<br />

subdirectory, so that installing the generated package will deploy the files under /usr/share/<br />

falcot-data/. The rules file is used as a Makefile, with a few standard targets (including<br />

clean and binary, used respectively to clean the source directory and generate the binary package).<br />

Although this file is the heart of the process, it increasingly contains only the bare minimum for<br />

running a standard set of commands provided by the debhelper tool. Such is the case for files<br />

generated by dh_make. To install our files, we simply configure the behavior of the dh_install<br />

command by creating the following debian/falcot-data.install file:<br />

data/* usr/share/falcot-data/<br />

At this point, the package can be created. We will however add a lick of paint. Since the administrators<br />

want the documents to be easily accessed from the Help menus of graphical desktop<br />

environment, we create an entry in the Debian menu system. This is simply done by renaming<br />

the debian/menu.ex without its extension and editing it as follows:<br />

?package(falcot-data):needs=X11|wm section=Help\<br />

title="Internal Falcot Corp Documentation" \<br />

command="/usr/bin/x-www-browser /usr/share/falcot-data/index.html"<br />

?package(falcot-data):needs=text section=Help\<br />

title="Internal Falcot Corp Documentation" \<br />

command="/usr/bin/www-browser /usr/share/falcot-data/index.html"<br />

Example 15.6<br />

The menu file<br />

The needs field, when set to X11|wm indicates that this entry only makes sense in a graphical<br />

interface. It will therefore only be integrated into the menus of the graphical (X11) applications<br />

and window managers (hence the wm). The section field states where in the menu the entry<br />

should be displayed. In our case, the entry will be in the Help menu. The title field contains the<br />

text that will be displayed in the menu. Finally, the command field describes the command to<br />

run when the user selects the menu entry.<br />

Chapter 15 — Creating a Debian Package<br />

419

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!