- removed %%include /usr/lib/rpm/macros.python
[packages/Zope-TimerService.git] / Zope-TimerService.spec
1 # WARNING: not working propertly - Zope 2.7 not started 
2 #
3 %define         zope_subname    TimerService
4 %define         module timerserver
5 Summary:        Support module for Zope-Scheduler
6 Summary(pl):    Modu³ wspomagaj±cy dla Zope-Scheduler
7 Name:           Zope-%{zope_subname}
8 Version:        0.2
9 Release:        0.1
10 License:        GPL
11 Group:          Libraries/Python
12 Source0:        http://dev.legco.biz/downloads/%{zope_subname}-%{version}.tar.gz
13 # Source0-md5:  5fb0fce2b90f69478a9370b313a45aa9
14 Source1:        Zope-timerserver_remover
15 URL:            http://dev.legco.biz/products/timerservice/
16 %pyrequires_eq  python-modules
17 Requires:       Zope
18 Requires:       perl-modules
19 Requires(post,postun):  /usr/sbin/installzopeproduct
20 BuildArch:      noarch
21 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22
23 %description
24 Support module for Zope-Scheduler.
25
26 %description -l pl
27 Modu³ wspomagaj±cy dla Zope-Scheduler.
28
29 %prep
30 %setup -q -c
31
32 %build
33 CFLAGS="%{rpmcflags}"
34 export CFLAGS
35 cd %{zope_subname}/timerserver
36 python setup.py build_ext
37
38 %install
39 rm -rf $RPM_BUILD_ROOT
40
41 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
42 install -d $RPM_BUILD_ROOT%{py_sitedir}
43 install -d $RPM_BUILD_ROOT%{_sbindir}
44 install %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/Zope-timerserver_remover
45
46 cp -af %{zope_subname}/timerserver $RPM_BUILD_ROOT%{py_sitedir}/%{module}
47 cp -af %{zope_subname}/{zpt,*.py,version.txt} $RPM_BUILD_ROOT%{_datadir}/%{name}
48
49 #cd $RPM_BUILD_ROOT%{_datadir}/%{name}/%{module}
50 #
51 #python setup.py install \
52 #        --root=$RPM_BUILD_ROOT \
53 #        --optimize=2
54 #rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/timerserver
55
56 %py_comp $RPM_BUILD_ROOT%{_datadir}/%{name}
57 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/%{name}
58 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/%{module}
59 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/%{module}
60
61 %clean
62 rm -rf $RPM_BUILD_ROOT
63
64 %post
65 /usr/sbin/installzopeproduct %{_datadir}/%{name} %{zope_subname}
66
67 ln -s %{py_sitedir}/%{module} /usr/lib/zope/lib/python/timerserver
68
69 echo "%import timerserver" >> /etc/zope/main/zope.conf
70 echo "<timer-server>" >> /etc/zope/main/zope.conf
71 echo "</timer-server>" >> /etc/zope/main/zope.conf
72
73 if [ -f /var/lock/subsys/zope ]; then
74         /etc/rc.d/init.d/zope restart >&2
75 fi
76
77 %preun
78 /usr/sbin/Zope-timerserver_remover
79
80 %postun
81 if [ "$1" = "0" ]; then
82         /usr/sbin/installzopeproduct -d %{zope_subname}
83         if [ -f /var/lock/subsys/zope ]; then
84             /etc/rc.d/init.d/zope restart >&2
85         fi
86 fi
87
88 %files
89 %defattr(644,root,root,755)
90 %attr(755,root,root) %{_sbindir}/Zope-timerserver_remover
91 %doc %{zope_subname}/{CREDITS.txt,INSTALL.txt}
92 %{_datadir}/%{name}
93 %{py_sitedir}/%{module}
This page took 0.044191 seconds and 3 git commands to generate.