Blob Blame History Raw
%global module_name ibus_cangjie

Name:             ibus-cangjie
Summary:          IBus engine to input Cangjie and Quick
Version:          2.1
Release:          1%{?dist}
License:          GPLv3+
URL:              http://cangjians.github.io/projects/%{name}
Source0:          http://cangjians.github.io/downloads/%{name}/%{name}-%{version}.tar.xz

BuildArch:        noarch

BuildRequires:    desktop-file-utils
BuildRequires:    ibus-devel
BuildRequires:    intltool
BuildRequires:    python3-devel

# For the unit tests
BuildRequires:    python3-cangjie >= 1.1
BuildRequires:    python3-gobject

Requires:         python3-canberra
Requires:         python3-cangjie >= 1.1
Requires:         python3-gobject

%description
IBus engine for users of the Cangjie and Quick input methods.

It is primarily intended to Hong Kong people who want to input Traditional
Chinese, as they are (by far) the majority of Cangjie and Quick users.

However, it should work for others as well (e.g to input Simplified Chinese).


%prep
%setup -q


%build
%configure
make %{?_smp_mflags}


%install
make install DESTDIR=%{buildroot} INSTALL="install -p"

%find_lang %{name}


%check
make check

# Upstream doesn't validate their desktop files
desktop-file-validate %{buildroot}/%{_datadir}/applications/ibus-setup-cangjie.desktop
desktop-file-validate %{buildroot}/%{_datadir}/applications/ibus-setup-quick.desktop


%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
    /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
fi

%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :


%files -f %{name}.lang
%doc AUTHORS COPYING README.md
%{_bindir}/ibus-setup-cangjie
%{python3_sitelib}/%{module_name}
%{_datadir}/applications/ibus-setup-*.desktop
%{_datadir}/%{name}
%{_datadir}/ibus/component/*.xml
%{_datadir}/appdata/*.appdata.xml
%{_datadir}/glib-2.0/schemas/org.cangjians.ibus.*.gschema.xml
%{_datadir}/icons/hicolor/*/intl/*

# Using %%{_prefix}/lib is allowed here because the package is exempt from
# multilib (because it is noarch), see:
#     https://fedoraproject.org/wiki/Packaging:Guidelines#Multilib_Exempt_Locations
%{_prefix}/lib/%{name}


%changelog
* Sun Feb 02 2014 Mathieu Bridon <bochecha@fedoraproject.org> - 2.1-1
- New upstream 2.1 release.

* Tue Dec 24 2013 Mathieu Bridon <bochecha@fedoraproject.org> - 2.0-1
- New upstream 2.0 release.

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Tue May 07 2013 Mathieu Bridon <bochecha@fedoraproject.org> - 1.0-3
- Preserve the file timestamps on installation.

* Mon May 06 2013 Mathieu Bridon <bochecha@fedoraproject.org> - 1.0-2
- Comment on the usage of %%{_prefix}/lib
- Validate the desktop file.

* Thu May 02 2013 Mathieu Bridon <bochecha@fedoraproject.org> - 1.0-1
- Initial package for Fedora.