Blob Blame History Raw
%global module_name ibus_cangjie

Name:             ibus-cangjie
Summary:          IBus engine to input Cangjie and Quick
Version:          2.4
Release:          2%{?dist}
License:          GPLv3+
URL:              http://cangjians.github.io/projects/%{name}
Source0:          https://github.com/Cangjians/%{name}/releases/download/v%{version}/%{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.2
BuildRequires:    python3-gobject

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

# Splitting the packages for Fedora 21+
Obsoletes: ibus-cangjie < 2.2-4

%description
Common files needed by the IBus engines for users of the Cangjie and Quick
input methods.


%package engine-cangjie
Summary:          Cangjie input method for IBus
Requires:         %{name} = %{version}-%{release}

# Splitting the packages for Fedora 21+
Obsoletes: ibus-cangjie < 2.2-4

%description engine-cangjie
IBus engine for users of the Cangjie input method.

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

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


%package engine-quick
Summary:          Quick (Simplified Cangjie) input method for IBus
Requires:         %{name} = %{version}-%{release}

# Splitting the packages for Fedora 21+
Obsoletes: ibus-cangjie < 2.2-4

%description engine-quick
IBus engine for users of the Quick (Simplified Cangjie) input method.

It is primarily intended to Hong Kong people who want to input Traditional
Chinese, as they are (by far) the majority of 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 README.md
%license COPYING
%{_bindir}/ibus-setup-cangjie
%{python3_sitelib}/%{module_name}
%{_datadir}/%{name}
%{_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}

%files engine-cangjie
%{_datadir}/applications/ibus-setup-cangjie.desktop
%{_datadir}/appdata/cangjie.appdata.xml
%{_datadir}/ibus/component/cangjie.xml

%files engine-quick
%{_datadir}/applications/ibus-setup-quick.desktop
%{_datadir}/appdata/quick.appdata.xml
%{_datadir}/ibus/component/quick.xml


%changelog
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun Mar 29 2015 Mathieu Bridon <bochecha@daitauha.fr> - 2.4-1
- Update to 2.4.

* Wed Mar 04 2015 Mathieu Bridon <bochecha@daitauha.fr> - 2.3-1
- Update to 2.3.

* Thu Jul 10 2014 Mathieu Bridon <bochecha@fedoraproject.org> - 2.2-4
- Split the engines into their own subpackages.
  This makes much more sense for users of a graphical package manager (like
  GNOME Software): installing one installs just that, and more importantly
  removing an engine doesn't remove the other one.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Fri Apr 25 2014 Mathieu Bridon <bochecha@fedoraproject.org> - 2.2-1
- New upstream 2.2 release.

* 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.