1 %define zope_subname zopeedit
2 Summary: Client-side helper application for ExternalEditor Zope product
3 Summary(pl): Aplikacja kliencka dla ExternalEditor, produktu Zope
4 Name: Zope-%{zope_subname}
8 Group: Development/Tools
9 Source0: http://zope.org/Members/Caseman/ExternalEditor/%{version}/%{zope_subname}-%{version}-src.tgz
10 # Source0-md5: 8ecc65067d32ac961476f924fa3e8b5b
11 URL: http://zope.org/Members/Caseman/ExternalEditor/
12 BuildRequires: python >= 2.2
13 Requires(post,postun): grep
14 Requires(postun): fileutils
15 %pyrequires_eq python-modules
16 Requires: python-tkinter
18 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21 Client-side helper application for ExternalEditor Zope product
24 Aplikacja kliencka dla ExternalEditor, produktu Zope
27 %setup -q -n %{zope_subname}-%{version}-src
30 rm -rf $RPM_BUILD_ROOT
31 install -d $RPM_BUILD_ROOT{%{_datadir}/%{zope_subname},%{_mandir}/man1,%{_bindir}}
33 install man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
34 cp -af {Plugins,version.txt,%{zope_subname}.py} $RPM_BUILD_ROOT%{_datadir}/%{zope_subname}
36 %py_comp $RPM_BUILD_ROOT%{_datadir}/%{zope_subname}
37 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/%{zope_subname}
39 cat >$RPM_BUILD_ROOT%{_bindir}/%{zope_subname} <<EOF
42 exec %{_bindir}/python %{_datadir}/%{zope_subname}/%{zope_subname}.pyo \$*
45 # sometimes .py needed
46 # rm -f $RPM_BUILD_ROOT%{_datadir}/%{zope_subname}/*.py
47 # rm -f $RPM_BUILD_ROOT%{_datadir}/%{zope_subname}/Plugins/*.py
50 rm -rf $RPM_BUILD_ROOT
53 if ! grep -qs zopeedit /etc/mailcap ; then
55 echo "application/x-zope-edit; /usr/bin/zopeedit %%s ; test=test -x /usr/bin/zopeedit" >> /etc/mailcap
59 if [ "$1" = "0" ]; then
60 if grep -qs zopeedit /etc/mailcap ; then
62 grep -v '^application/x-zope-edit; /usr/bin/zopeedit %%s ; test=test -x /usr/bin/zopeedit$' /etc/mailcap >> /etc/mailcap_new
63 mv -f /etc/mailcap_new /etc/mailcap
68 %defattr(644,root,root,755)
69 %doc CHANGES.txt INSTALL-UNIX.txt README.txt
70 %attr(755,root,root) %{_bindir}/%{zope_subname}
71 %{_datadir}/%{zope_subname}