summaryrefslogtreecommitdiffstats
path: root/zope/F-13/zope.spec
blob: 9c480dae0ea2629c63714a3c50815b41ffa0301b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
%define python_minver 2.4.3

%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

%define zope_user      zope
%define zope_group     %{zope_user}

%define zope_home      %{_libdir}/zope
%define software_home  %{zope_home}/lib/python
%define instance_home  %{_localstatedir}/lib/zope

%define zopectl        %{_bindir}/zopectl
%define runzope        %{_bindir}/runzope

Name:    zope
Summary: Web application server for flexible content management applications
Version: 2.10.9
Release: 1%{?dist}
License: ZPL
Group: 	 System Environment/Daemons
URL:     http://www.zope.org/
Source0: http://www.zope.org/Products/Zope/%{version}/Zope-%{version}-final.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Source1: zope.init.in
Source2: zope.sysconfig.in
Source3: zope.zopectl.in
Source4: zope-README.Fedora
Source5: zope.logrotate.in
Source6: zope.logrotate.cron.in
Patch0: zope-2.10.4-config.patch
Patch1: zope-2.10.8-configure.patch

BuildRequires: python-devel >= %{python_minver}, python >= %{python_minver} 
Requires:      python >= %{python_minver}, libxml2-python, python-elementtree

Requires(pre): /usr/sbin/useradd
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig, /sbin/service

%description
Zope is an application server framework that enables developers to quickly
build web applications such as intranets, portals, and content management
systems.

Zope, by default, will listen on port 8080.

%prep
%setup -q -n Zope-%{version}-final
%patch0 -p0
%patch1 -p1

chmod -x skel/import/README.txt
install -pm 644 %{SOURCE4} README.Fedora
install -pm 644 %{SOURCE5} skel/etc/logrotate.conf.in


%build
rm -rf $RPM_BUILD_ROOT # Configure checks for it
./configure \
  --prefix=$RPM_BUILD_ROOT%{zope_home} \
#  --with-python=%{_bindir}/python
#  --no-compile

make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT

# Create all required additional directories
for dir in %{zope_home} %{software_home} %{instance_home}/{Products,bin,var} \
    %{_sysconfdir}/sysconfig %{_bindir}; do
    install -d $RPM_BUILD_ROOT$dir
done


install -D -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/zope
install -D -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/zope
install -D -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/zopectl
install -D -m 755 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/zope-logrotate
perl -pi -e 's,<<SYSCONFDIR>>,%{_sysconfdir},g;
             s,<<BINDIR>>,%{_bindir},g;
             s,<<LOCALSTATEDIR>>,%{_localstatedir},g;
             s,<<ZOPE_USER>>,%{zope_user},g' \
    $RPM_BUILD_ROOT%{_initrddir}/zope \
    $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/zope \
    $RPM_BUILD_ROOT%{_bindir}/zopectl \
    $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/zope-logrotate \
    README.Fedora skel/etc/zope.conf.in

# Install the skel, translating paths, into the build root
%{__python} "utilities/copyzopeskel.py" \
     --sourcedir="skel" \
     --targetdir="$RPM_BUILD_ROOT%{instance_home}" \
     --replace="INSTANCE_HOME:%{instance_home}" \
     --replace="SOFTWARE_HOME:%{software_home}" \
     --replace="ZOPE_HOME:%{zope_home}" \
     --replace="PYTHON:%{__python}" \

# Actually copy all the other files over
make install

chmod 750 $RPM_BUILD_ROOT%{instance_home}

# Fix permissions, must have changed in the upstream tar
chmod 755 $RPM_BUILD_ROOT%{instance_home}/bin/zopectl
chmod 755 $RPM_BUILD_ROOT%{instance_home}/bin/runzope

# Set needed permissions
# We might go as far as to only allow zope r/w to the .pyc files
for dir in %{instance_home}/{Products,log,lib,var}; do
    chmod 775 $RPM_BUILD_ROOT$dir
done

chmod 755 $RPM_BUILD_ROOT%{zope_home}

# included in %%doc
rm -rf $RPM_BUILD_ROOT%{zope_home}/doc

# write version.txt
echo "Zope %{version}-%{release}" > \
    "$RPM_BUILD_ROOT%{software_home}/version.txt"

# write zope.pth
install -d $RPM_BUILD_ROOT%{python_sitearch}
echo "%{software_home}" > \
    "$RPM_BUILD_ROOT%{python_sitearch}/zope.pth"

# Compile .pyc
%{__python} -c "import compileall; \
    compileall.compile_dir(\"$RPM_BUILD_ROOT%{zope_home}\", \
    ddir=\"%{zope_home}\", force=1)"



%clean
rm -rf $RPM_BUILD_ROOT


%pre
%{_sbindir}/useradd -c "Zope user" -s /bin/false -r -d %{zope_home} \
    %{zope_user} 2>/dev/null || :


%post
# add zope init to runlevels
/sbin/chkconfig --add zope


%preun
if [ $1 -eq 0 ]; then
  /sbin/service zope stop >/dev/null 2>&1
  /sbin/chkconfig --del zope
fi



%files 
%defattr(-, root, root, -)
%doc doc/* README.Fedora ZopePublicLicense.txt
%config(noreplace) %{_sysconfdir}/sysconfig/zope
%config %{_initrddir}/zope
%config %{_sysconfdir}/cron.daily/zope-logrotate
%attr(0755, root, root) %{_bindir}/zopectl
%dir %{zope_home}
%{zope_home}/bin
%{zope_home}/lib
%dir %{zope_home}/skel
%{zope_home}/skel/bin
%{zope_home}/skel/Extensions
%{zope_home}/skel/import
%{zope_home}/skel/log
%{zope_home}/skel/lib
%{zope_home}/skel/Products
%{zope_home}/skel/README.txt
%{zope_home}/skel/var
%config %{zope_home}/skel/etc
%attr(-, root, %{zope_group}) %{instance_home}/*
%{python_sitearch}/zope.pth


%changelog
* Thu Aug 6 2009 Jonathan Steffan <jon a fedoraunity.org> 2.10.9-1
- Update to 2.10.9
- Fix CVE-2009-0669 (BZ#513428)
- Fix CVE-2009-0668 (BZ#513422)

* Mon May 25 2009 Jonathan Steffan <jon a fedoraunity.org> 2.10.8-1
- Update to 2.10.8

* Sat Oct 25 2008 Jonathan Steffan <jon a fedoraunity.org> 2.10.7-1
- Update to 2.10.7

* Sun May 11 2008 Jonathan Steffan <jon a fedoraunity.org> 2.10.6-1
- Update to 2.10.6
- Add a patch to allow python 2.4.3

* Thu Nov 8 2007 Jonathan Steffan <jon a fedoraunity.org> 2.10.5-2
- Update permissions for zopectl and runzope

* Sat Nov 3 2007 Jonathan Steffan <jon a fedoraunity.org> 2.10.5-1
- Update to zope 2.10.5

* Mon Sep 3 2007 Jonathan Steffan <jon a fedoraunity.org> 2.10.4-3
- Updated Requires for libxml2-python and python-elementtree

* Tue Aug 14 2007 Jonathan Steffan <jon a fedoraunity.org> 2.10.4-2
- Added config patch

* Wed Aug 1 2007 Jonathan Steffan <jon a fedoraunity.org> 2.10.4-1
- Initial Package