File Terminal.spec of Package Terminal

# spec file for package Terminal
# Copyright (c) 2012 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

Name:           Terminal
Version:        0.4.8
Release:        0
Summary:        Terminal Emulator for the Xfce Desktop Environment
License:        GPL-2.0+
Group:          System/X11/Terminals
Source1:        %name-rpmlintrc
# PATCH-FIX-UPSTREAM Terminal-0.4.8-fix-help.patch -- Fix help by making sure there is no trailing '#' in URLs which make exo-helper-1 choke
Patch0:         Terminal-0.4.8-fix-help.patch
BuildRequires:  fdupes
BuildRequires:  intltool
BuildRequires:  update-desktop-files
BuildRequires:  xfce4-dev-tools
BuildRequires:  pkgconfig(dbus-glib-1)
BuildRequires:  pkgconfig(exo-1)
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(vte)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Recommends:     %{name}-lang = %{version}
Recommends:     %{name}-doc = %{version}

Terminal is a lightweight and easy to use terminal emulator for the Xfce
desktop environment. Its major features include a simple configuration
interface, the ability to use multiple tabs with terminals within a single
window, the possibility to have a pseudo-transparent terminal background, and a
compact mode where both the menubar and the window decorations are hidden which
helps to save space on the desktop.

%package doc
Summary:        Documentation for Terminal
Group:          Documentation/HTML
BuildArch:      noarch
Requires:       %{name} = %{version}

%description doc
This package contains the documentation for Terminal.


%setup -q
%patch0 -p1

%configure --docdir=%{_datadir}/xfce4/Terminal/html
make %{?_smp_mflags} V=1


%suse_update_desktop_file -i Terminal System TerminalEmulator Utility

rm %{buildroot}%{_datadir}/pixmaps/terminal.xpm

# create terminal -> Terminal compatibility symlinks
for manpage in %{buildroot}%{_mandir}/*/man1/Terminal.1* \
        %{buildroot}%{_mandir}/man1/Terminal.1*; do
    ( cd "${manpage%/*}" && \
        ln -sf "${manpage##*/}" \
        "$(printf "%s\n" "${manpage##*/}" | tr [:upper:] [:lower:])" )

rm -rf %{buildroot}%{_datadir}/locale/{ast,kk,tl_PH,ur_PK}

# create a list of localized man directories, these need to be owned
    printf '%%%%defattr(-,root,root)\n'
    cd '%{buildroot}'
    for dir in ".%{_mandir}/"*; do
        [ -d "${dir}" ] || continue
        case ${dir##*/} in
            man*)   continue ;;
            *)      lang="${dir##*/}"
                    printf "%%%%dir %%%%lang(%%s) %%s\n" "${lang}" "${dir#.}"
                    for subdir in "${dir}/"*; do
                        [ -d "${subdir}" ] || continue
                        printf "%%%%dir %%%%lang(%%s) %%s\n" "${lang}" \
) >> %{name}.lang
%find_lang %{name} --with-man %{?no_lang_C}
%find_lang terminal %{name}.lang --with-man %{?no_lang_C}

%fdupes %{buildroot}/%{_mandir}

rm -rf %{buildroot}



%dir %{_datadir}/Terminal
%dir %{_datadir}/gnome-control-center
%dir %{_datadir}/gnome-control-center/default-apps
%doc %{_mandir}/man1/[Tt]erminal.1*

%files doc
%dir %{_datadir}/xfce4
%dir %{_datadir}/xfce4/Terminal
%doc %{_datadir}/xfce4/Terminal/html/

%files lang -f %{name}.lang