Added with_appdata macro and removed with_python_pkg macro

This commit is contained in:
Takao Fujiwara 2015-04-22 13:34:05 +09:00
parent 65c8317df7
commit fb0e859e81

View File

@ -3,18 +3,18 @@
%global have_default_layout 1 %global have_default_layout 1
%global have_bridge_hotkey 1 %global have_bridge_hotkey 1
%if (0%{?fedora} > 19 || 0%{?rhel} > 6)
%global with_python_pkg 1
%else
%global with_python_pkg 0
%endif
%if (0%{?fedora} > 19 || 0%{?rhel} > 7) %if (0%{?fedora} > 19 || 0%{?rhel} > 7)
%global with_python3 1 %global with_python3 1
%else %else
%global with_python3 0 %global with_python3 0
%endif %endif
%if (0%{?fedora} > 22 || 0%{?rhel} > 7)
%global with_appdata 1
%else
%global with_appdata 0
%endif
%if %with_python3 %if %with_python3
# for bytecompile in %%{_datadir}/ibus-anthy # for bytecompile in %%{_datadir}/ibus-anthy
%global __python %{__python3} %global __python %{__python3}
@ -55,24 +55,12 @@ BuildRequires: pygobject3-base
Requires: ibus >= %{require_ibus_version} Requires: ibus >= %{require_ibus_version}
Requires: kasumi Requires: kasumi
Requires: anthy Requires: anthy
%if %with_python_pkg
Requires: %{name}-python = %{version}-%{release} Requires: %{name}-python = %{version}-%{release}
%else
Requires: gtk3
%if %with_python3
Requires: python3-cairo
Requires: python3-gobject
%else
Requires: pycairo
Requires: pygobject3
%endif
%endif
%description %description
The Anthy engine for IBus platform. It provides Japanese input method from The Anthy engine for IBus platform. It provides Japanese input method from
a library of the Anthy. a library of the Anthy.
%if %with_python_pkg
%package python %package python
Summary: Anthy Python files for IBus Summary: Anthy Python files for IBus
Group: System Environment/Libraries Group: System Environment/Libraries
@ -89,7 +77,6 @@ Requires: pygobject3
%description python %description python
This package contains the Anthy Python files for IBus This package contains the Anthy Python files for IBus
%endif
%package devel %package devel
Summary: Development tools for IBus Summary: Development tools for IBus
@ -129,6 +116,7 @@ make %{?_smp_mflags}
make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p' make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p'
rm -f $RPM_BUILD_ROOT%{_libdir}/libanthygobject-%{sub_version}.la rm -f $RPM_BUILD_ROOT%{_libdir}/libanthygobject-%{sub_version}.la
%if %with_appdata
# Register as an AppStream component to be visible in the software center # Register as an AppStream component to be visible in the software center
# #
# NOTE: It would be *awesome* if this file was maintained by the upstream # NOTE: It would be *awesome* if this file was maintained by the upstream
@ -160,6 +148,7 @@ cat > $RPM_BUILD_ROOT%{_datadir}/appdata/anthy.appdata.xml <<EOF
<update_contact><!-- upstream-contact_at_email.com --></update_contact> <update_contact><!-- upstream-contact_at_email.com --></update_contact>
</component> </component>
EOF EOF
%endif
%find_lang %{name} %find_lang %{name}
@ -190,26 +179,19 @@ touch --no-create %{_datadir}/icons/hicolor || :
# dir {python2_sitearch}/ibus # dir {python2_sitearch}/ibus
%{_libdir}/libanthygobject-%{sub_version}.so.* %{_libdir}/libanthygobject-%{sub_version}.so.*
%{_libdir}/girepository-1.0/Anthy*.typelib %{_libdir}/girepository-1.0/Anthy*.typelib
%if %with_python_pkg
%dir %{_datadir}/ibus-anthy %dir %{_datadir}/ibus-anthy
%{_datadir}/ibus-anthy/dicts %{_datadir}/ibus-anthy/dicts
%else
%{_libexecdir}/ibus-*-anthy
%{_datadir}/applications/ibus-setup-anthy.desktop
%{_datadir}/ibus-anthy
%{_datadir}/ibus/component/*
%endif
%{_datadir}/icons/hicolor/scalable/apps/ibus-anthy.svg %{_datadir}/icons/hicolor/scalable/apps/ibus-anthy.svg
%if %with_python_pkg
%files python %files python
%{_libexecdir}/ibus-*-anthy %{_libexecdir}/ibus-*-anthy
%if %with_appdata
%{_datadir}/appdata/*.appdata.xml %{_datadir}/appdata/*.appdata.xml
%endif
%{_datadir}/applications/ibus-setup-anthy.desktop %{_datadir}/applications/ibus-setup-anthy.desktop
%{_datadir}/ibus-anthy/engine %{_datadir}/ibus-anthy/engine
%{_datadir}/ibus-anthy/setup %{_datadir}/ibus-anthy/setup
%{_datadir}/ibus/component/* %{_datadir}/ibus/component/*
%endif
%files devel %files devel
%{_datadir}/gir-1.0/Anthy*.gir %{_datadir}/gir-1.0/Anthy*.gir
@ -219,6 +201,7 @@ touch --no-create %{_datadir}/icons/hicolor || :
%changelog %changelog
* Wed Apr 22 2015 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.6-6 * Wed Apr 22 2015 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.6-6
- Resolved #1214092 Updated ibus-anthy-HEAD.patch - Resolved #1214092 Updated ibus-anthy-HEAD.patch
- Added with_appdata macro and removed with_python_pkg macro
* Wed Mar 25 2015 Richard Hughes <rhughes@redhat.com> - 1.5.6-5 * Wed Mar 25 2015 Richard Hughes <rhughes@redhat.com> - 1.5.6-5
- Add the AppData file to the right built RPM, in this case we have to install - Add the AppData file to the right built RPM, in this case we have to install