diff --git a/.gitignore b/.gitignore index e69de29..9fcae31 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/mcomix-0.94.tar.bz2 diff --git a/mcomix.spec b/mcomix.spec new file mode 100644 index 0000000..c167174 --- /dev/null +++ b/mcomix.spec @@ -0,0 +1,166 @@ +Name: mcomix +Version: 0.94 +Release: 2%{?dist} +Summary: User-friendly, customizable image viewer for comic books + +Group: Amusements/Graphics +URL: http://mcomix.sourceforge.net/ +# Version info: mcomix/mcomixstarter.py +License: GPLv2+ +Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2 +# Fedora specific: on Fedora's rpmbuild the following patch +# is needed +Patch0: mcomix-0.92-fedora-rpmbuild-gtk.patch +# Fedora specific(?): patch to search default localedir for gettext files +Patch1: mcomix-0.94-gettext-system-install.patch + +BuildArch: noarch +BuildRequires: gettext +BuildRequires: pygtk2 +BuildRequires: python-imaging +BuildRequires: python-setuptools +BuildRequires: desktop-file-utils +# The following BR is really needed for gconf2 macros +BuildRequires: GConf2 +Requires: pygtk2 +Requires: python-imaging +Requires(pre): GConf2 +Requires(preun): GConf2 +Requires(post): GConf2 + +%description +MComix is a user-friendly, customizable image viewer. It is specifically +designed to handle comic books, but also serves as a generic viewer. It +reads images in ZIP, RAR, 7Zip or tar archives as well as plain image files. It +is written in Python and uses GTK+ through the PyGTK bindings. + +%prep +%setup -q +%patch0 -p1 -b .rpmbuild +%patch1 -p1 -b .gettext + +%build +# save timestamps +sed -i -e 's|shutil.copy|shutil.copy2|' mcomix/main.py + +# Rename: comicthumb -> mcomicthumb +find . -name comicthumb\* | while read f +do + mv $f $(echo $f | sed -e 's|comicthumb|mcomicthumb|') +done +grep -rl comicthumb . | xargs sed -i -e 's|comicthumb|mcomicthumb|g' + +# Rename: application-x-foo.png -> application-x-mcomix-foo.png +for f in mime/icons/*/application-x-*.png +do + mv $f $(echo $f | sed -e 's|application-x|application-x-%{name}|') +done +grep -rl application-x . | while read f +do + sed -i -e 's|application-x|application-x-%{name}|' $f +done +sed -i -e \ + 's|/application@x|/application@x-%{name}|' \ + ./mime/comicbook.schemas + +# embed Fedora EVR +sed -i -e "/^VERSION/s|^\(.*\)$|\1\nVERSION_fedora = '%{version}-%{release}'|" \ + mcomix/constants.py +sed -i -e "s|constants\.VERSION|constants.VERSION_fedora|" \ + mcomix/about_dialog.py + +for dir in mcomix/messages/*/LC*/ +do + msgfmt --statistics -o $dir/mcomix.mo $dir/mcomix.po || \ + rm -f $dir/mcomix.mo +done + +%install +python setup.py \ + install \ + --root $RPM_BUILD_ROOT + +# Fix rpmlint on the following file on %%install, +# not on %%prep, %%build +sed -i -e '\@^#!.*%{_bindir}/env@d' \ + $RPM_BUILD_ROOT%{python_sitelib}/%{name}/mcomixstarter.py + +desktop-file-install \ + --delete-original \ + --remove-category Application \ + --dir $RPM_BUILD_ROOT%{_datadir}/applications/ \ + $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop + +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gconf/schemas +install -cpm 644 ./mime/comicbook.schemas \ + $RPM_BUILD_ROOT%{_sysconfdir}/gconf/schemas/%{name}.schemas + +# gettext catalog files +mkdir -p $RPM_BUILD_ROOT%{_datadir}/locale/ +mv $RPM_BUILD_ROOT%{python_sitelib}/%{name}/messages/*/ \ + $RPM_BUILD_ROOT%{_datadir}/locale/ + +%find_lang %{name} + +%pre +%gconf_schema_prepare %{name} +exit 0 + +%post +%gconf_schema_upgrade %{name} + +touch --no-create %{_datadir}/icons/hicolor + +update-desktop-database &> /dev/null +update-mime-database %{_datadir}/mime &> /dev/null + +exit 0 + +%preun +%gconf_schema_remove %{name} +exit 0 + +%postun +update-desktop-database &> /dev/null +update-mime-database %{_datadir}/mime &> /dev/null + +[ $1 -eq 0 ] || exit 0 +touch --no-create %{_datadir}/icons/hicolor +%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor + +exit 0 + +%posttrans +%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor +exit 0 + +%files -f %{name}.lang +%defattr(-,root,root,-) +%doc COPYING ChangeLog README + +%{_sysconfdir}/gconf/schemas/%{name}.schemas + +%{_bindir}/%{name} +%{python_sitelib}/%{name}/ +%{python_sitelib}/%{name}-%{version}-py*.egg-info/ + +%{_datadir}/applications/%{name}.desktop +%{_datadir}/mime/packages/%{name}.xml + +%{_mandir}/man1/mcomix.1* +%{_mandir}/man1/mcomicthumb.1* + +%{_datadir}/icons/hicolor/*/apps/%{name}* +%{_datadir}/icons/hicolor/*/mimetypes/application-x-*.png + + +%changelog +* Thu Oct 27 2011 Mamoru Tasaka - 0.94-2 +- Fix rpmlint issue + +* Mon Oct 10 2011 Mamoru Tasaka - 0.94-1 +- 0.94 + +* Sun Aug 28 2011 Mamoru Tasaka - 0.92-1 +- Initial package + diff --git a/sources b/sources index e69de29..560215f 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +46a1e9f7c99ebb29325c9925069fa6ea mcomix-0.94.tar.bz2