Difference between revisions of "GNOME package guidelines"

From ArchWiki
Jump to: navigation, search
m (" don't " -> " do not ")
(added links to related articles with Template:Package Guidelines)
Line 1: Line 1:
 
[[Category: Package development (English)]]
 
[[Category: Package development (English)]]
 
 
{{i18n|Gnome package guidelines}}
 
{{i18n|Gnome package guidelines}}
  
The GNOME packages on Arch Linux follow a certain schema.
+
{{Article summary start}}
 +
{{Article summary text|Writing [[PKGBUILD]]s for [[GNOME]] applications. These are applications using {{Pkg|gconf}}, {{Pkg|gsettings}}, {{Pkg|highcolor-icon-theme}} and [http://www.freedesktop.org Freedesktop.org] [[Wikipedia:File_shortcut#Unix|.desktop files]], with {{Ic|Mime-Type}} entry.}}
 +
{{Package Guidelines}}
 +
{{Article summary end}}
  
==Gnome profile initialization==
+
The Gnome packages on Arch Linux follow a certain schema.
  
 +
== Gnome profile initialization ==
 
There is no gnome profile initialization anymore. The old line below should be stripped from any PKGBUILD:
 
There is no gnome profile initialization anymore. The old line below should be stripped from any PKGBUILD:
[ -z "$GNOMEDIR" ] && . /etc/profile.d/gnome.sh
+
{{Bc|[ -z "$GNOMEDIR" ] && . /etc/profile.d/gnome.sh}}
 
+
==GConf schemas==
+
  
 +
== GConf schemas ==
 
Many GNOME packages install GConf schemas. These schemas get installed in the system GConf database, which has to be avoided.
 
Many GNOME packages install GConf schemas. These schemas get installed in the system GConf database, which has to be avoided.
Some packages provide a --disable-schemas-install switch for ./configure, which hardly ever works. Therefore, gconftool-2 has a variable called <code>GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL</code>, whenever this is set, gconftool-2 won't update any databases.
+
Some packages provide a {{Ic|--disable-schemas-install}} switch for '''./configure''', which hardly ever works. Therefore, gconftool-2 has a variable called {{Ic|GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL}}, whenever this is set, gconftool-2 won't update any databases.
 +
 
 
When creating packages that install schema files, use
 
When creating packages that install schema files, use
make GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR=${pkgdir} install
+
 
 +
{{Bc|1=make GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR=${pkgdir} install}}
 +
 
 
for the package installation step in the PKGBUILD.
 
for the package installation step in the PKGBUILD.
  
GConf schemas need to be installed and removed in the .install file using pre_remove, pre_upgrade and post_upgrade and post_install. Use gconf-merge-schemas to merge several schemas into one package specific file, install or uninstall them with <code>usr/sbin/gconfpkg --(un)install $pkgname</code>.
+
GConf schemas need to be installed and removed in the {{Ic|.install}} file using {{Ic|pre_remove}}, {{Ic|pre_upgrade}} and {{Ic|post_upgrade}} and {{Ic|post_install}}. Use '''gconf-merge-schemas''' to merge several schemas into one package specific file, install or uninstall them with {{Ic|usr/sbin/gconfpkg --''(un)''install $pkgname}}
The usage of gconfpkg requres a dependency on gconf>=2.18.0.1-4 (or gconfmm>=2.20.0).
+
The usage of '''gconfpkg''' requres a dependency on {{Pkg|gconf}}>=2.18.0.1-4 (or {{Pkg|gconfmm}}>=2.20.0).
  
==GSettings schemas==
+
== GSettings schemas ==
 
The GConf schemas will be replaced by GSettings schemas in the near future, but some applications (e.g. Empathy) already using it. GSettings uses dconf as backend, so all packages that contain GSettings schemas require dconf as dependency. When a new GSettings schema installed on the system, the GSettings database should be recompiled, but not when packaging.
 
The GConf schemas will be replaced by GSettings schemas in the near future, but some applications (e.g. Empathy) already using it. GSettings uses dconf as backend, so all packages that contain GSettings schemas require dconf as dependency. When a new GSettings schema installed on the system, the GSettings database should be recompiled, but not when packaging.
To avoid recompiling GSettings database on packaging, use the <code>--disable-schemas-compile</code> switch for ./configure. To recompile it on install, add the following line to the .install file using post_install, post_upgrade and post_remove:
+
To avoid recompiling GSettings database on packaging, use the {{Ic|--disable-schemas-compile}} switch for '''./configure'''. To recompile it on install, add the following line to the .install file using post_install, post_upgrade and post_remove:
 
  glib-compile-schemas usr/share/glib-2.0/schemas
 
  glib-compile-schemas usr/share/glib-2.0/schemas
  
==Scrollkeeper documentation==
+
== Scrollkeeper documentation ==
Starting from GNOME 2.20 there's no need to handle scrollkeeper anymore, as rarian reads OMF files directly. Scrollkeeper-update is a dummy these days. The only required thing now is to makedepend on gnome-doc-utils>=0.11.2.
+
Starting from GNOME 2.20 there's no need to handle scrollkeeper anymore, as rarian reads OMF files directly. Scrollkeeper-update is a dummy these days. The only required thing now is to makedepend on {{Pkg|gnome-doc-utils}}>=0.11.2.
  
==.desktop files==
+
== .desktop files ==
Many packages install Freedesktop.org compatible .desktop files and register MimeType entries in them. Running <code>update-desktop-database -q</code> in post_install() and post_remove() is recommended (package should depend on desktop-file-utils in this case).
+
Many packages install Freedesktop.org compatible {{Ic|.desktop}} files and register MimeType entries in them. Running {{Ic|update-desktop-database -q}} in {{Ic|post_install}} and {{Ic|post_remove}} is recommended (package should depend on {{Pkg|desktop-file-utils}} in this case).
  
==GTK Icon cache==
+
== GTK Icon cache ==
Quite some packages install icons in the hicolor icon theme. These packages should depend on hicolor-icon-theme and should have <code>gtk-update-icon-cache -q -t -f usr/share/icons/hicolor</code> (WITHOUT leading slash) in the post_install, post_upgrade and post_remove function.
+
Quite some packages install icons in the hicolor icon theme. These packages should depend on {{Pkg|hicolor-icon-theme}} and should have {{Ic|gtk-update-icon-cache -q -t -f usr/share/icons/hicolor}} (WITHOUT leading slash) in the {{Ic|post_install}}, {{Ic|post_upgrade}} and {{Ic|post_remove}} function.
  
==.install files==
+
== .install files ==
For many gnome packages, all .install files look almost exactly the same. The gedit package contains a very generic install file:
+
For many gnome packages, all .install files look almost exactly the same. The {{Pkg|gedit}} package contains a very generic install file:
 
http://projects.archlinux.org/svntogit/packages.git/tree/gedit/repos/extra-i686/gedit.install
 
http://projects.archlinux.org/svntogit/packages.git/tree/gedit/repos/extra-i686/gedit.install
  
Basically, the only thing that has to be changed is the pkgname variable on top of the .install file. As long as pacman doesn't supply us with the pkgname variable, we need to supply it in the .install file.
+
Basically, the only thing that has to be changed is the {{Ic|pkgname}} variable on top of the {{Ic|.install}} file. As long as pacman doesn't supply us with the {{Ic|pkgname}} variable, we need to supply it in the {{Ic|.install}} file.
When packages do not have gconf .schemas, hicolor icon files, or .desktop files, remove the parts that handle those subjects.
+
When packages do not have gconf schemas, hicolor icon files, or {{Ic|.desktop}} files, remove the parts that handle those subjects.
  
==Example==
+
== Example ==
For an example of above rules, take a look at the gedit PKGBUILD and the .install file supplied above:
+
For an example of above rules, take a look at the gedit PKGBUILD and the {{Ic|.install}} file supplied above:
http://projects.archlinux.org/svntogit/packages.git/tree/gedit/repos/extra-i686/
+
https://projects.archlinux.org/svntogit/packages.git/tree/gedit/repos/extra-i686/

Revision as of 02:42, 6 March 2012

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Summary help replacing me
Writing PKGBUILDs for GNOME applications. These are applications using gconf, gsettings, highcolor-icon-theme and Freedesktop.org .desktop files, with Mime-Type entry.

Template:Package Guidelines

The Gnome packages on Arch Linux follow a certain schema.

Gnome profile initialization

There is no gnome profile initialization anymore. The old line below should be stripped from any PKGBUILD:

[ -z "$GNOMEDIR" ] && . /etc/profile.d/gnome.sh

GConf schemas

Many GNOME packages install GConf schemas. These schemas get installed in the system GConf database, which has to be avoided. Some packages provide a --disable-schemas-install switch for ./configure, which hardly ever works. Therefore, gconftool-2 has a variable called GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL, whenever this is set, gconftool-2 won't update any databases.

When creating packages that install schema files, use

make GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR=${pkgdir} install

for the package installation step in the PKGBUILD.

GConf schemas need to be installed and removed in the .install file using pre_remove, pre_upgrade and post_upgrade and post_install. Use gconf-merge-schemas to merge several schemas into one package specific file, install or uninstall them with usr/sbin/gconfpkg --(un)install $pkgname The usage of gconfpkg requres a dependency on gconf>=2.18.0.1-4 (or gconfmm>=2.20.0).

GSettings schemas

The GConf schemas will be replaced by GSettings schemas in the near future, but some applications (e.g. Empathy) already using it. GSettings uses dconf as backend, so all packages that contain GSettings schemas require dconf as dependency. When a new GSettings schema installed on the system, the GSettings database should be recompiled, but not when packaging. To avoid recompiling GSettings database on packaging, use the --disable-schemas-compile switch for ./configure. To recompile it on install, add the following line to the .install file using post_install, post_upgrade and post_remove:

glib-compile-schemas usr/share/glib-2.0/schemas

Scrollkeeper documentation

Starting from GNOME 2.20 there's no need to handle scrollkeeper anymore, as rarian reads OMF files directly. Scrollkeeper-update is a dummy these days. The only required thing now is to makedepend on gnome-doc-utils>=0.11.2.

.desktop files

Many packages install Freedesktop.org compatible .desktop files and register MimeType entries in them. Running update-desktop-database -q in post_install and post_remove is recommended (package should depend on desktop-file-utils in this case).

GTK Icon cache

Quite some packages install icons in the hicolor icon theme. These packages should depend on hicolor-icon-theme and should have gtk-update-icon-cache -q -t -f usr/share/icons/hicolor (WITHOUT leading slash) in the post_install, post_upgrade and post_remove function.

.install files

For many gnome packages, all .install files look almost exactly the same. The gedit package contains a very generic install file: http://projects.archlinux.org/svntogit/packages.git/tree/gedit/repos/extra-i686/gedit.install

Basically, the only thing that has to be changed is the pkgname variable on top of the .install file. As long as pacman doesn't supply us with the pkgname variable, we need to supply it in the .install file. When packages do not have gconf schemas, hicolor icon files, or .desktop files, remove the parts that handle those subjects.

Example

For an example of above rules, take a look at the gedit PKGBUILD and the .install file supplied above: https://projects.archlinux.org/svntogit/packages.git/tree/gedit/repos/extra-i686/