]>
Commit | Line | Data |
---|---|---|
8ba5753d | 1 | %include /usr/lib/rpm/macros.python |
2 | %define zope_subname zopeedit | |
3 | Summary: Client-side helper application for ExternalEditor Zope product | |
d6b25d12 | 4 | Summary(pl): Aplikacja kliencka dla ExternalEditor, produktu Zope |
8ba5753d | 5 | Name: Zope-%{zope_subname} |
1f215146 | 6 | Version: 0.7.2 |
7 | Release: 1 | |
8ba5753d | 8 | License: ZPL 2.0 |
9 | Group: Development/Tools | |
10 | Source0: http://zope.org/Members/Caseman/ExternalEditor/%{version}/%{zope_subname}-%{version}-src.tgz | |
1f215146 | 11 | # Source0-md5: e2e9be6e50a67b401e346a5097fcb7fa |
8ba5753d | 12 | URL: http://zope.org/Members/Caseman/ExternalEditor/ |
13 | BuildRequires: python >= 2.2 | |
d9f7891a JB |
14 | Requires(post,postun): grep |
15 | Requires(postun): fileutils | |
8ba5753d | 16 | %pyrequires_eq python-modules |
17 | Requires: python-tkinter | |
8ba5753d | 18 | BuildArch: noarch |
19 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
20 | ||
21 | %description | |
22 | Client-side helper application for ExternalEditor Zope product | |
23 | ||
24 | %description -l pl | |
0ed72d96 | 25 | Aplikacja kliencka dla ExternalEditor, produktu Zope |
8ba5753d | 26 | |
27 | %prep | |
28 | %setup -q -n %{zope_subname}-%{version}-src | |
29 | ||
30 | %install | |
31 | rm -rf $RPM_BUILD_ROOT | |
32 | install -d $RPM_BUILD_ROOT{%{_datadir}/%{zope_subname},%{_mandir}/man1,%{_bindir}} | |
33 | ||
34 | install man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
35 | cp -af {Plugins,%{zope_subname}.py} $RPM_BUILD_ROOT%{_datadir}/%{zope_subname} | |
36 | ||
37 | %py_comp $RPM_BUILD_ROOT%{_datadir}/%{zope_subname} | |
38 | %py_ocomp $RPM_BUILD_ROOT%{_datadir}/%{zope_subname} | |
39 | ||
40 | cat >$RPM_BUILD_ROOT%{_bindir}/%{zope_subname} <<EOF | |
41 | #!/bin/sh | |
42 | ||
43 | exec %{_bindir}/python %{_datadir}/%{zope_subname}/%{zope_subname}.pyo \$* | |
44 | EOF | |
45 | ||
46 | # sometimes .py needed | |
47 | # rm -f $RPM_BUILD_ROOT%{_datadir}/%{zope_subname}/*.py | |
48 | # rm -f $RPM_BUILD_ROOT%{_datadir}/%{zope_subname}/Plugins/*.py | |
49 | ||
50 | %clean | |
51 | rm -rf $RPM_BUILD_ROOT | |
52 | ||
53 | %post | |
d9f7891a JB |
54 | if ! grep -qs zopeedit /etc/mailcap ; then |
55 | umask 022 | |
8ba5753d | 56 | echo "application/x-zope-edit; /usr/bin/zopeedit %%s ; test=test -x /usr/bin/zopeedit" >> /etc/mailcap |
57 | fi | |
58 | ||
59 | %postun | |
d9f7891a JB |
60 | if [ "$1" = "0" ]; then |
61 | if grep -qs zopeedit /etc/mailcap ; then | |
62 | umask 022 | |
63 | grep -v '^application/x-zope-edit; /usr/bin/zopeedit %%s ; test=test -x /usr/bin/zopeedit$' /etc/mailcap >> /etc/mailcap_new | |
64 | mv -f /etc/mailcap_new /etc/mailcap | |
65 | fi | |
7b5dc062 | 66 | fi |
8ba5753d | 67 | |
68 | %files | |
69 | %defattr(644,root,root,755) | |
1f215146 | 70 | %doc CHANGES.txt INSTALL-UNIX.txt README.txt |
8ba5753d | 71 | %attr(755,root,root) %{_bindir}/%{zope_subname} |
72 | %{_datadir}/%{zope_subname} | |
73 | %{_mandir}/man1/* |