Blob Blame History Raw
# get python version
%global py_ver %(if [ -f "%{__python}" ]; then %{__python} -c "import sys; sys.stdout.write(sys.version[:3])"; else echo 0; fi;)
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

Name:           cherrytree
Version:        0.36.0
Release:        2%{?dist}
Summary:        Hierarchical note taking application

Group:          Applications/Productivity
License:        GPLv3+
URL:            http://www.giuspen.com/cherrytree/
Source0:        http://www.giuspen.com/software/%{name}-%{version}.tar.xz

BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  desktop-file-utils
BuildRequires:  gettext
# for py_byte_compile
BuildRequires:  python%{python3_pkgversion}-devel
Requires:       python(abi) = %{py_ver}
Requires:       pygtk2
Requires:       pygobject2
Requires:       pygtksourceview
Requires:       python-enchant
Requires:       dbus-python
Requires:       python-appindicator
Requires:       /usr/bin/7za

%description
CherryTree is a hierarchical note taking application, featuring rich text and
syntax highlighting, storing all the data (including images) in a single XML
file with extension ".ctd".


%prep
%setup -q


%build
%{__python} setup.py build

%install
%{__python} setup.py install -O1 --root %{buildroot}

%py_byte_compile %{__python} %{buildroot}%{_datadir}/%{name}

desktop-file-validate %{buildroot}/%{_datadir}/applications/cherrytree.desktop

# don't include useless egg
rm -rf %{buildroot}%{python_sitelib}

# these are no longer in use
rm -rf %{buildroot}%{_datadir}/application-registry/
rm -rf %{buildroot}%{_datadir}/mime-info/

%find_lang %{name}


%post
update-desktop-database &> /dev/null || :
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
touch --no-create %{_datadir}/mime/packages &>/dev/null || :

%postun
update-desktop-database &> /dev/null || :
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
    update-mime-database %{_datadir}/mime &> /dev/null || :
fi

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :


%files -f %{name}.lang
%doc changelog.txt license.txt pygtkspellcheck
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/%{name}/
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/mime/packages/%{name}.xml
%{_mandir}/man1/*.1*
%{_datadir}/appdata/*


%changelog
* Fri Dec 04 2015 Oliver Haessler <oliver@redhat.com> - 0.36.0-2
- changed BR: python3-devel to use the python3_pkgversion macro to build on EPEL7

* Thu Dec  3 2015 Robin Lee <cheeselee@fedoraproject.org> - 0.36.0-1
- BR: python3-devel to get py_byte_compile macro

* Mon Nov 23 2015 Pavel Kovar <kovar.pavel@gmail.com> - 0.36.0-1
- Update to 0.36.0
- Requires python-appindicator
- py_byte_compile step added
- desktop-file-validate added

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

* Sun Oct 26 2014 Robin Lee <cheeselee@fedoraproject.org> - 0.35.2-1
- Update to 0.35.2

* Sun Oct 12 2014 Robin Lee <cheeselee@fedoraproject.org> - 0.35.1-1
- Update to 0.35.1

* Tue Sep 09 2014 Rex Dieter <rdieter@fedoraproject.org> 0.33.4-2
- update mime scriptlet

* Sun Jun  8 2014 Robin Lee <cheeselee@fedoraproject.org> - 0.33.4-1
- Update to 0.33.4

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

* Sat Feb  1 2014 Robin Lee <cheeselee@fedoraproject.org> - 0.32-1
- Update to 0.32.0

* Fri Sep 27 2013 Robin Lee <cheeselee@fedoraproject.org> - 0.30.5-1
- Update to 0.30.5, license changed to GPLv3+
- Requires python-enchant

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

* Wed May 29 2013 Robin Lee <cheeselee@fedoraproject.org> - 0.29.4-1
- Update to 0.29.4

* Fri Feb  8 2013 Robin Lee <cheeselee@fedoraproject.org> - 0.29.2-1
- Update to 0.29.2

* Sat Jan 12 2013 Robin Lee <cheeselee@fedoraproject.org> - 0.29-1
- Update to 0.29

* Wed Dec 19 2012 Robin Lee <cheeselee@fedoraproject.org> - 0.28.5-1
- Update to 0.28.5

* Thu Oct 11 2012 Robin Lee <cheeselee@fedoraproject.org> - 0.28-1
- Update to 0.28 (#859463, #860086, #861571, #861780)

* Sat Sep 29 2012 ZhiQiang Fan <mr.zqfan@gmail.com> - 0.27.1-1
- Update to 0.27.1 (#834037)

* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.26.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Wed Jun 13 2012 Robin Lee <cheeselee@fedoraproject.org> - 0.26.2-1
- Update to 0.26.2

* Sun May 27 2012 Robin Lee <cheeselee@fedoraproject.org> - 0.26-1
- Update to 0.26

* Sun Mar  4 2012 Robin Lee <cheeselee@fedoraproject.org> - 0.25.4-1
- Update to 0.25.4

* Sat Feb 18 2012 Robin Lee <cheeselee@fedoraproject.org> - 0.25.3-1
- Update to 0.25.3

* Wed Jan 25 2012 Robin Lee <cheeselee@fedoraproject.org> - 0.25.2-1
- Update to 0.25.2

* Sun Jan 22 2012 Robin Lee <cheeselee@fedoraproject.org> - 0.25.1-1
- Update to 0.25.1

* Mon Jan 16 2012 Robin Lee <cheeselee@fedoraproject.org> - 0.25-1
- Update to 0.25

* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.24-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Sat Dec 31 2011 Robin Lee <cheeselee@fedoraproject.org> - 0.24-1
- Update to 0.24

* Thu Nov  3 2011 Robin Lee <cheeselee@fedoraproject.org> - 0.23.1-1
- Update to 0.23.1
- Add manuall python(abi) requirement

* Thu Jun 23 2011 Christoph Wickert <cwickert@fedoraproject.org> - 0.22.1-1
- Update to 0.22.1

* Mon Apr 25 2011 Christoph Wickert <cwickert@fedoraproject.org> - 0.21-1
- Update to 0.21

* Tue Mar 08 2011 Christoph Wickert <cwickert@fedoraproject.org> - 0.20.1-1
- Update to 0.20.1

* Tue Mar 08 2011 Christoph Wickert <cwickert@fedoraproject.org> - 0.20.1-1
- Update to 0.20

* Sat Jan 22 2011 Christoph Wickert <cwickert@fedoraproject.org> - 0.19.3-2
- Omit %%{_datadir}/application-registry/ and %%{_datadir}/mime-info/

* Fri Jan 21 2011 Christoph Wickert <cwickert@fedoraproject.org> - 0.19.3-2
- Remove useless egg and manually add python(abi) requirement

* Mon Jan 17 2011 Christoph Wickert <cwickert@fedoraproject.org> - 0.19.3-1
- Update to 0.19.3

* Sat Jan 15 2011 Christoph Wickert <cwickert@fedoraproject.org> - 0.19.2-1
- Update to 0.19.2
- Drop cherrytree.glade.h again
- Make sure cherrytree.desktop is not executable

* Tue Jan 11 2011 Christoph Wickert <cwickert@fedoraproject.org> - 0.19.1-1
- Update to 0.19.1
- Use setup.py instead of manual installation
- BR python2-devel instead of python-devel

* Tue Jan 04 2011 Christoph Wickert <cwickert@fedoraproject.org> - 0.19-2
- Drop cherrytree.glade.h

* Mon Jan 03 2011 Christoph Wickert <cwickert@fedoraproject.org> - 0.19-1
- Update to 0.19

* Wed Dec 29 2010 Christoph Wickert <cwickert@fedoraproject.org> - 0.18.1-1
- Update to 0.18.1

* Mon Dec 20 2010 Christoph Wickert <cwickert@fedoraproject.org> - 0.17.1-1
- Inital package