desktop-file-utils/desktop-file-utils.spec

97 lines
3.3 KiB
RPMSpec

#
# spec file for package desktop-file-utils (Version 0.17)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: desktop-file-utils
Version: 0.17
Release: 1
License: GPLv2+
Summary: Utilities for Manipulating Desktop Files
Url: http://www.freedesktop.org/wiki/Software/desktop-file-utils
Group: Development/Tools/Other
Source0: %{name}-%{version}.tar.bz2
Source1: SuSEconfig.desktop-file-utils
# PATCH-FEATURE-OPENSUSE desktop-file-utils-suse-keys.patch vuntz@opensuse.org -- Handle SUSE-specific keys in validator. This is not strictly necessary, since they are prefixed with X-, but we can verify that the value has the right type.
Patch0: desktop-file-utils-suse-keys.patch
BuildRequires: glib2-devel
BuildRequires: pkg-config
PreReq: /bin/rm
PreReq: /bin/rmdir
Requires: aaa_base
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This packages contains a couple of command line utilities for
working with desktop files.
More information about desktop files can be found at:
http://freedesktop.org/wiki/Specifications/desktop-entry-spec
%prep
%setup -q
%patch0
%build
%configure \
--with-lispdir=%{_datadir}/emacs/site-lisp
%__make %{?_smp_mflags}
%install
%makeinstall
# we don't want to buildrequire emacs, but recent automake make it
# impossible to install a lisp file without emacs installed. So we
# manually do it.
test ! -f %{buildroot}%{_datadir}/emacs/site-lisp/desktop-entry-mode.el
install -D -m644 misc/desktop-entry-mode.el %{buildroot}%{_datadir}/emacs/site-lisp/desktop-entry-mode.el
# SuSEconfig script
mkdir -p %{buildroot}/sbin/conf.d
install %{S:1} %{buildroot}/sbin/conf.d
# Create ghosts based on default $XDG_DATA_DIRS:
mkdir -p %{buildroot}%{_datadir}/applications
touch %{buildroot}%{_datadir}/applications/mimeinfo.cache
%clean
rm -rf %{buildroot}
%postun
# It is not allowed by FHS to own this file in RPM package, but we can
# purge it. Removal on update can be ignored, SuSEconfig will create it
# again, if needed.
if [ -d /usr/local/share/applications ] ; then
rm -f /usr/local/share/applications/mimeinfo.cache
rmdir --ignore-fail-on-non-empty /usr/local/share/applications
fi
%files
%defattr(-, root, root)
%doc AUTHORS COPYING ChangeLog NEWS README
%{_bindir}/desktop-file-install
%{_bindir}/desktop-file-validate
%{_bindir}/update-desktop-database
%ghost %{_datadir}/applications/mimeinfo.cache
%{_mandir}/man1/desktop-file-install.1*
%{_mandir}/man1/desktop-file-validate.1*
%{_mandir}/man1/update-desktop-database.1*
# Own directories to not require emacs installed.
%dir %{_datadir}/emacs
%dir %{_datadir}/emacs/site-lisp
%{_datadir}/emacs/site-lisp/*.el*
/sbin/conf.d/SuSEconfig.*
%changelog