Archive pour November 2006

rpm install/uninstall scripts [FR]

Wednesday 15 November 2006
  • %pre : Ce script s’exécute juste avant l’installation du paquetage sur le système.
  • %post : Ce script s’exécute juste après l’installation du paquetage sur le système.
  • %preun : Ce script s’exécute juste avant la désinstallation du paquetage sur le système.
  • %postun : Ce script s’exécute juste après la désinstallation du paquetage sur le système.

Valeurs des paramètres passés aux scripts pre et post

Paramètre Script         %pre     %post    %preun     %postun
Première installation      1          1       N/C         N/C
Mise à jour                2          2        1           1
Désinstallation           N/C        N/C       0           0

Cela permettra au programmeur de prévoir des comportements différents à ses scripts selon qu’il s’agisse d’une installation ou d’une mise à jour.

  • Pour des scripts d’installation (%post, %pre) si $1 == "1" alors il s’agit d’une installation fraîche.
  • Pour des scripts de désinstallation (%postun, %preun), si $1 == "0", alors il s’agit d’une désinstallation complète, sinon il s’agit soit d’une mise à jour soit d’une installation avec ––force du même paquet.

Pour tester cette situation, la déclaration suivant est utilisée:

if [ $1 = 0 ]; then
// Do stuff specific to uninstalls
if [ $1 = 1 ]; then
// Do stuff specific to upgrades

Add your savers to gnome-screensaver

Wednesday 15 November 2006

The method is nearly the same as for the new menu entries: this time you need to create a .desktop file in $HOME/.local/share/applications/screensavers.

Here is an example to have a specific image for the floaters screensaver:

$ mkdir -p  $HOME/.local/share/applications/screensavers
$ cd $HOME/.local/share/applications/screensavers
$ vi my-floaters.desktop

The my-floaters.desktop is :

[Desktop Entry]
Name=Floating Tux
Comment=Floating Tux around the screen
Exec=floaters /home/rpmfarm/Images/SVG/tux.svg

gnome-screensaver is then adding the new entry in the screensaver list:

here is  a screendump of my gnome-screensaver-preferences gnome-screensaver-preferences.

Add you own entries in the system menus

Wednesday 15 November 2006

Very easy in fact (you just need to know how :smile: )…

The solution is to create a personal .desktop file in your account:

mkdir -p  $HOME/.local/share/applications
cd  $HOME/.local/share/applications

When you are here, you can create the .desktop file (use the provided existing file as an example. They live in /usr/share/applications/).

Here is an example how to add a GoogleEarth entry in the Network sub-menu:

[Desktop Entry]
Name=Google Earth
GenericName=3D planet viewer
Comment=Explore, search and discover the planet
Exec=/opt/google-earth/googleearth %f

compiz 2 - The return

Wednesday 15 November 2006

OK, finally I found some informations (look at my previous post on compiz) for the <Super> key:
it’s the so-called Windows key !

This key is not available on the IBM Thinkpad T30, but a small trick with xmodmap is shown below which transformed the <Browser Navigation Keys> to <Super_L> and <Super_R>:

(Look at the keyboard image here: IBMThinkpad T30 keyboard view)

xmodmap -e "keycode 234 = Super_L"
xmodmap -e "keycode 233 = Super_R"

Get the list of available packages

Tuesday 14 November 2006

If, as me, you created your yum repo directory as explained in The Unofficial Fedora FAQ (btw it is still missing for Fedora Core 6), you can use this simple command to get the list of available RPM packages on all repositories :

yum --noplugins --enablerepo=rpmfarm --enablerepo=livna --enablerepo=flash --enablerepo=kde-redhat --enablerepo=atrpms --enablerepo=freshrpms list all > yumlist-fc6.txt

framebuffer for grub

Tuesday 14 November 2006

When setting up grub you can specify the framebuffer configuration (vga= parameter) as an option in grub (and then you’ll see the famous tux logo).

Example of /boot/grub/menu.lst:

title Fedora Core (2.6.18-1.2849.fc6)
root (hd0,1)
kernel /vmlinuz-2.6.18-1.2849.fc6 ro root=LABEL=/ rhgb quiet resume2=swap:/dev/hda7 vga=0x317
initrd /initrd-2.6.18-1.2849.fc6.img

Now the value for vga parameter can be set, based on this table:

____| 640x480  800x600  1024x768
256 |  0x301    0x303    0x305
32k |  0x310    0x313    0x316
64k |  0x311    0x314    0x317
16M |  0x312    0x315    0x318

rpm building as a normal user

Tuesday 14 November 2006

As a RPM should never be build as root, you can follow those simple steps to setup a build environment for a normal user:

  • Install rpmdevtools;
  • Launch rpmdev-setuptree;
  • This will create the following directories in $HOME:
    |-- BUILD
    |-- RPMS
    |-- SOURCES
    |-- SPECS
    `-- SRPMS
  • and setup your ~/.rpmmacros file.
  • then you can add you stuff in this file, for example for getting rid of the debuginfo package and signing your builds (see the links page for this):
    %debug_package %{nil}
    %_signature gpg
    %_gpg_name  Eric Lassauge
  • As an other example, here is my typical build script for building from a spec file and tarball:
    rpmbuild --sign --clean --target=i686 -ba --define "disttag ${disttag}" --define "repotag ${repotag}" $*


Thursday 9 November 2006

Now that you know that it’s so beautiful you need to use it on your machine !
On my laptop (IBM Thinkpad T30 with an ATI Radeon Mobility 7500) it was not working with the default Xorg configuration: the DefaultDepth has to be changed to 16 (not 24) in the /etc/X11/xorg.conf in the "Screen" section to make it work !

Now it’s working perfectly except for the water plugin which generates the
compiz: water: GL_ARB_fragment_program is missing error message.

If you search for the key and button mappings for the compiz plugins, have a look here: (btw from the default water configuration the <Control><Super> key sequence should be used to start the plugin… But what is the <Super> key, specially on the Thinkpad ? Please let me know :roll: ).

The configuration of the various plugins must be done either with gconftool-2 or with the graphical tool gconf-editor (install the gconf-editor RPM, which is apparently not installed by the default installation process, if you need it).

Mount Windows share

Thursday 9 November 2006

As the smbmount command was deleted, here is an example how to mount a Windows share from network on a linux machine:

  1. mkdir /mnt/cifs
  2. mount -t cifs '\\windows_server\share_name' /mnt/cifs -o username=windows_user_name,workgroup=workgroup_name,rw,iocharset=utf8,uid=500,gid=500
  3. Here the uid and gid are those you want to use on the linux machine;
  4. You will be then prompted with the windows password of windows_user_name from workgroup_name.

Setting a local repository for yum

Thursday 9 November 2006

Here is the content of my farm.repo file (in /etc/yum.repos.d/) on my development machine (compare it with the file provided in

name=RPMfarm  for Fedora Core $releasever - $basearch - Base

name=RPMfarm for Fedora Core $releasever - $basearch - Source