Blob Blame History Raw
Name:           mintlocale
Version:        1.4.4
Release:        3%{?dist}
Summary:        Language selection tool

License:        GPLv2+
URL:            https://github.com/linuxmint/%{name}
Source0:        %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        org.mintlocale.policy

# Revert https://github.com/linuxmint/mintlocale/commit/0206bbf7c12058999e701bb11f9012be54da2cbb
# Using non utf8 breaks gnome apps
Patch0:         show_utf8_only.patch
Patch1:         fix-bad-decode.patch

BuildArch:      noarch

BuildRequires:  desktop-file-utils

Requires:       accountsservice
Requires:       %{name}-set-default-locale = %{version}-%{release}
Requires:       xapps

%description
Language selection tool for Cinnamon.

%package set-default-locale
Summary:        Language selection tool

%description set-default-locale
Language selection tool for Cinnamon.


%prep
%autosetup -p 1

for f in $(%{_bindir}/find . -name '*.py' -type f) ; do
  %{__sed} -e 's!/usr/share/linuxmint/locale!/usr/share/locale!g' \
    -e's!gksu!pkexec!' < ${f} > ${f}.new
  /bin/touch -r ${f}.new ${f}
  %{__mv} -f ${f}.new ${f}
done

%if (0%{?rhel} && 0%{?rhel} >= 7)
for f in $(%{__grep} -Rl '#!.*python3') ; do
  %{__sed} -e 's~#!.*python3~#!/usr/bin/python2~g' < ${f} > ${f}.new
  /bin/touch -r ${f}.new ${f}
  mode="$(%{_bindir}/stat -c '%a' ${f})"
  %{__mv} -f ${f}.new ${f}
  %{__chmod} -c ${mode} ${f}
done
%endif # (0%%{?rhel} && 0%%{?rhel} >= 7)


%build
echo 'nothing to build'


%install
%{__cp} -pr .%{_prefix} %{buildroot}
%{__rm} %{buildroot}%{_bindir}/add-remove-locales \
  %{buildroot}%{_datadir}/applications/%{name}-im.desktop \
  %{buildroot}%{_prefix}/lib/linuxmint/mintlocale/synaptic-install-packages \
  %{buildroot}%{_prefix}/lib/linuxmint/mintlocale/add.py \
  %{buildroot}%{_prefix}/lib/linuxmint/mintlocale/install_remove.py

# install policy file
%{__install} -Dpm 0644 %{SOURCE1} \
  %{buildroot}%{_datadir}/polkit-1/actions/org.%{name}.policy

%{__chmod} -c 0755 %{buildroot}%{_prefix}/lib/linuxmint/mintlocale/mintlocale.py

echo 'LANG=$locale' > %{buildroot}%{_datadir}/linuxmint/mintlocale/templates/default_locale.template

%{_bindir}/desktop-file-install \
  --add-only-show-in=X-Cinnamon \
  --delete-original \
  --dir %{buildroot}%{_datadir}/applications \
  %{buildroot}%{_datadir}/applications/%{name}.desktop


%files
%doc debian/changelog
%license COPYING debian/copyright
%{_bindir}/%{name}
%{_prefix}/lib/linuxmint/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/linuxmint
%{_datadir}/polkit-1/actions/org.%{name}.policy

%files set-default-locale
%{_bindir}/set-default-locale


%changelog
* Mon Jul 13 2020 Pat Riehecky <riehecky@fnal.gov> - 1.4.4-3
- Fix decoding issue 1541089

* Thu Nov 29 2018 Pat Riehecky <riehecky@fnal.gov> - 1.4.4-2
- Return to EPEL7

* Fri Oct 27 2017 Leigh Scott <leigh123linux@googlemail.com> - 1.4.4-1
- New upstream release

* Mon Sep 11 2017 Björn Esser <besser82@fedoraproject.org> - 1.4.2-11
- Require xapps for iso-flag-png

* Thu Aug 31 2017 Björn Esser <besser82@fedoraproject.org> - 1.4.2-10
- Preserve mode of files when changing hashbang

* Thu Aug 31 2017 Björn Esser <besser82@fedoraproject.org> - 1.4.2-9
- Fix regex for EPEL

* Thu Aug 31 2017 Björn Esser <besser82@fedoraproject.org> - 1.4.2-8
- Fix hashbang in regex

* Tue Aug 29 2017 Björn Esser <besser82@fedoraproject.org> - 1.4.2-7
- Use Python2 on EPEL <= 7

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Tue May 09 2017 Leigh Scott <leigh123linux@googlemail.com> - 1.4.2-5
- Remove the add and remove bits

* Tue May 09 2017 Leigh Scott <leigh123linux@googlemail.com> - 1.4.2-4
- Split package (bz 1449122)
- Remove python3-devel build requires

* Tue May 09 2017 Leigh Scott <leigh123linux@googlemail.com> - 1.4.2-3
- Show UTF8 Lang only

* Sun May 07 2017 Björn Esser <besser82@fedoraproject.org> - 1.4.2-2
- Fix template for system locale

* Sun May 07 2017 Björn Esser <besser82@fedoraproject.org> - 1.4.2-1
- New upstream release

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.6-0.9.gitfb4118d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Apr 28 2016 Leigh Scott <leigh123linux@googlemail.com> - 1.1.6-0.8.gitfb4118d
- rebuilt for bz 1292296

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.6-0.7.gitfb4118d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Sep 09 2015 Leigh Scott <leigh123linux@googlemail.com> - 1.1.6-0.6.gitfb4118d
- fix some deprecation warnings

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.6-0.5.gitfb4118d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Nov 08 2014 Leigh Scott <leigh123linux@googlemail.com> - 1.1.6-0.4.gitfb4118d
- fix locale path

* Fri Jun 27 2014 Leigh Scott <leigh123linux@googlemail.com> - 1.1.6-0.3.gitfb4118d
- only show in cinnamon menu

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

* Tue May 27 2014 Leigh Scott <leigh123linux@googlemail.com> - 1.1.6-0.1.gitfb4118d
- update to the latest git snapshot

* Sat May 10 2014 Leigh Scott <leigh123linux@googlemail.com> - 1.1-4
- fix system wide settings

* Sat May 03 2014 Leigh Scott <leigh123linux@googlemail.com> - 1.1-3
- more fixes

* Sat May 03 2014 Leigh Scott <leigh123linux@googlemail.com> - 1.1-2
- fix ui so it looks better
- add pkexec support for setting system
  locale (needs group adm,sudo,wheel to show)

* Mon Apr 14 2014 Leigh Scott <leigh123linux@googlemail.com> - 1.1-1
- Inital build