- Prev
- Users' Guide
- Next

# Appendix F. Sample spec file for desktop menu package

The following spec file is an example of how you could package a desktop entry (`.directory`) file and a desktop menu (`.menu`) file in an RPM package for shipping. Refer to Section 4.8.1.3, “Desktop menu entries for documents” for the structure of these files.
This example assumes a desktop entry file named `menu-example.directory`, a desktop menu file named `menu-example.menu`, and a readme file named `README` are located in a directory named `menu-example-0` that is archived as `menu-example-0.tgz`.
When built, this results in a package named menu-example.

    Name:		menu-example
    Version:	0
    Release:	8%{?dist}.t1
    Summary:	Example of how to do a documentation menu package
    Group:		Development/Tools
    License:	GPLv2+
    URL:		http://engineering.redhat.com
    Source0:	%{name}-%{version}.tgz
    BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
    BuildArch:      noarch

    %description
    Example of how to do a documentation menu package

    %prep
    %setup -q

    %build

    %install
    rm -rf %{buildroot}
    mkdir -p $RPM_BUILD_ROOT%{_datadir}/desktop-directories
    mkdir -p $RPM_BUILD_ROOT/etc/xdg/menus/settings-merged

    install -m644 menu-example.directory $RPM_BUILD_ROOT%{_datadir}/desktop-directories/menu-example.directory
    install -m644 menu-example.menu $RPM_BUILD_ROOT%{_sysconfdir}/xdg/menus/settings-merged/menu-example.menu

    %{_fixperms} $RPM_BUILD_ROOT/*

    %clean
    rm -rf %{buildroot}

    %files
    %defattr(-,root,root,-)
    %doc README
    %{_datadir}/desktop-directories/menu-example.directory
    %config(noreplace) %{_sysconfdir}/xdg/menus/settings-merged/menu-example.menu

    %changelog
    * Tue Nov 23 2010 Jeff Fearn <jfearn@redhat.com> 0-8
    - Creation

- PrevAppendix E. Contents of the website dump file
- Up
- Home
- NextAppendix G. Language codes