]> git.pld-linux.org Git - packages/Zope-zopeedit.git/blob - Zope-zopeedit.spec
- added %postun section
[packages/Zope-zopeedit.git] / Zope-zopeedit.spec
1 %include        /usr/lib/rpm/macros.python
2 %define         zope_subname    zopeedit
3 Summary:        Client-side helper application for ExternalEditor Zope product
4 Summary(pl):    Aplikacja kliencka dla ExternalEditor, produktu Zope
5 Name:           Zope-%{zope_subname}
6 Version:        0.7
7 Release:        3
8 License:        ZPL 2.0
9 Group:          Development/Tools
10 Source0:        http://zope.org/Members/Caseman/ExternalEditor/%{version}/%{zope_subname}-%{version}-src.tgz
11 # Source0-md5:  87fe890a7f7c2506db16142bc4789b38
12 URL:            http://zope.org/Members/Caseman/ExternalEditor/
13 BuildRequires:  python >= 2.2
14 %pyrequires_eq  python-modules
15 Requires:       python-tkinter
16 BuildArch:      noarch
17 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18
19 %description
20 Client-side helper application for ExternalEditor Zope product
21
22 %description -l pl
23 Aplikacja kliencka dla ExternalEditor, produktu Zope
24
25 %prep
26 %setup -q -n %{zope_subname}-%{version}-src
27
28 %install
29 rm -rf $RPM_BUILD_ROOT
30 install -d $RPM_BUILD_ROOT{%{_datadir}/%{zope_subname},%{_mandir}/man1,%{_bindir}}
31
32 install man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
33 cp -af {Plugins,%{zope_subname}.py} $RPM_BUILD_ROOT%{_datadir}/%{zope_subname}
34
35 %py_comp $RPM_BUILD_ROOT%{_datadir}/%{zope_subname}
36 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/%{zope_subname}
37
38 cat >$RPM_BUILD_ROOT%{_bindir}/%{zope_subname} <<EOF
39 #!/bin/sh
40
41 exec %{_bindir}/python %{_datadir}/%{zope_subname}/%{zope_subname}.pyo \$*
42 EOF
43
44 # sometimes .py needed
45 # rm -f $RPM_BUILD_ROOT%{_datadir}/%{zope_subname}/*.py
46 # rm -f $RPM_BUILD_ROOT%{_datadir}/%{zope_subname}/Plugins/*.py
47
48 %clean
49 rm -rf $RPM_BUILD_ROOT
50
51 %post
52 if ! grep -q zopeedit /etc/mailcap ; then
53         echo "application/x-zope-edit; /usr/bin/zopeedit %%s ; test=test -x /usr/bin/zopeedit" >> /etc/mailcap
54 fi
55
56 %postun
57 if grep -q zopeedit /etc/mailcap ; then
58         sed -e 's@application/x-zope-edit; /usr/bin/zopeedit %%s ; test=test -x /usr/bin/zopeedit@@g' /etc/mailcap >> /etc/mailcap_new
59         mv -f /etc/mailcap_new /etc/mailcap 
60 fi
61
62 %files
63 %defattr(644,root,root,755)
64 %doc CHANGES.txt INSTALL-UNIX.txt LICENSE.txt README.txt
65 %attr(755,root,root) %{_bindir}/%{zope_subname}
66 %{_datadir}/%{zope_subname}
67 %{_mandir}/man1/*
This page took 0.066728 seconds and 4 git commands to generate.