zope.spec 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. ##
  2. ## zope.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package version
  26. %define V_major 2.7.2
  27. %define V_minor 0
  28. # package information
  29. Name: zope
  30. Summary: Content Management System and Application Server
  31. URL: http://zope.org/
  32. Vendor: Zope Corporation
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG
  35. Class: PLUS
  36. Group: Web
  37. License: Zope Public License
  38. Version: %{V_major}.%{V_minor}
  39. Release: 20040806
  40. # list of sources
  41. Source0: http://zope.org/Products/Zope/%{V_major}/Zope-%{V_major}-%{V_minor}.tgz
  42. Source1: rc.zope
  43. Source2: zoperun
  44. Source3: zopectl
  45. Source4: zope.conf
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20040130
  50. PreReq: OpenPKG, openpkg >= 20040130
  51. BuildPreReq: python >= 2.3.3
  52. PreReq: python >= 2.3.3
  53. BuildPreReq: make
  54. AutoReq: no
  55. AutoReqProv: no
  56. %description
  57. Zope is the leading Open Source web application server. Zope enables
  58. teams to collaborate in the creation and management of dynamic
  59. web-based business applications such as intranets and portals.
  60. Zope makes it easy to build features such as site search, news,
  61. personalization, and e-commerce into your web applications.
  62. %track
  63. prog zope = {
  64. version = %{V_major}-%{V_minor}
  65. url = http://zope.org/Products/Zope/
  66. regex = Zope-(\d+\.\d+\.\d+(-\d+)?)\.tgz
  67. }
  68. %prep
  69. %setup -q -n Zope-%{V_major}-%{V_minor}
  70. %build
  71. # build package
  72. CC="%{l_cc}" \
  73. CFLAGS="%{l_cflags -O}" \
  74. ./configure \
  75. --with-python=%{l_prefix}/bin/python
  76. %{l_make} %{l_mflags}
  77. %install
  78. rm -rf $RPM_BUILD_ROOT
  79. # install package
  80. INSTALL_FLAGS="--install-purelib=$RPM_BUILD_ROOT%{l_prefix}/lib/zope"
  81. INSTALL_FLAGS="$INSTALL_FLAGS --install-platlib=$RPM_BUILD_ROOT%{l_prefix}/lib/zope"
  82. INSTALL_FLAGS="$INSTALL_FLAGS --install-data=$RPM_BUILD_ROOT%{l_prefix}/lib/zope"
  83. INSTALL_FLAGS="$INSTALL_FLAGS --install-headers=$RPM_BUILD_ROOT%{l_prefix}/include"
  84. INSTALL_FLAGS="$INSTALL_FLAGS --install-scripts=$RPM_BUILD_ROOT%{l_prefix}/libexec/zope"
  85. INSTALL_FLAGS="$INSTALL_FLAGS --no-compile"
  86. %{l_make} %{l_mflags} install \
  87. PREFIX=%{l_prefix} \
  88. INSTALL_FLAGS="$INSTALL_FLAGS"
  89. # install addon utilities
  90. %{l_shtool} mkdir -f -p -m 755 \
  91. $RPM_BUILD_ROOT%{l_prefix}/bin
  92. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  93. %{SOURCE zopectl} $RPM_BUILD_ROOT%{l_prefix}/bin/
  94. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  95. %{SOURCE zoperun} $RPM_BUILD_ROOT%{l_prefix}/bin/
  96. # install configuration
  97. %{l_shtool} mkdir -f -p -m 755 \
  98. $RPM_BUILD_ROOT%{l_prefix}/etc/zope
  99. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  100. %{SOURCE zope.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/zope/
  101. # create Zope instance home
  102. %{l_shtool} mkdir -f -p -m 755 \
  103. $RPM_BUILD_ROOT%{l_prefix}/var/zope \
  104. $RPM_BUILD_ROOT%{l_prefix}/var/zope/import \
  105. $RPM_BUILD_ROOT%{l_prefix}/var/zope/log \
  106. $RPM_BUILD_ROOT%{l_prefix}/var/zope/var \
  107. $RPM_BUILD_ROOT%{l_prefix}/var/zope/Products \
  108. $RPM_BUILD_ROOT%{l_prefix}/var/zope/Extensions
  109. # strip down and adjust installation
  110. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/README.txt
  111. rm -rf $RPM_BUILD_ROOT%{l_prefix}/skel
  112. %{l_shtool} mkdir -f -p -m 755 \
  113. $RPM_BUILD_ROOT%{l_prefix}/share/zope
  114. mv $RPM_BUILD_ROOT%{l_prefix}/doc \
  115. $RPM_BUILD_ROOT%{l_prefix}/share/zope/doc
  116. mv $RPM_BUILD_ROOT%{l_prefix}/import \
  117. $RPM_BUILD_ROOT%{l_prefix}/share/zope/import
  118. # install run-command script
  119. %{l_shtool} mkdir -f -p -m 755 \
  120. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  121. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  122. %{SOURCE rc.zope} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  123. # determine installation files
  124. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  125. %{l_files_std} \
  126. '%config %{l_prefix}/etc/zope/zope.conf' \
  127. '%attr(700,%{l_rusr},%{l_rgrp}) %dir %{l_prefix}/var/zope/log' \
  128. '%attr(700,%{l_rusr},%{l_rgrp}) %dir %{l_prefix}/var/zope/var' \
  129. '%doc %{l_prefix}/share/zope/doc/*.txt'
  130. %files -f files
  131. %clean
  132. rm -rf $RPM_BUILD_ROOT
  133. %post
  134. # compile python modules in place after installation
  135. echo "Compiling Python modules. Just be patient." |\
  136. %{l_rpmtool} msg -b -t info
  137. ( cd $RPM_INSTALL_PREFIX/lib/zope
  138. find . -name "*.pyc" | xargs rm -f || true
  139. $RPM_INSTALL_PREFIX/bin/python \
  140. $RPM_INSTALL_PREFIX/libexec/zope/compilezpy.py
  141. ) >/dev/null 2>&1 || true
  142. # give information about next steps
  143. if [ $1 -eq 1 ]; then
  144. ( echo "You have successfully installed Zope. In order to use it, you first"
  145. echo "have to create a management user by running the following command"
  146. echo "(before starting up Zope):"
  147. echo " \$ $RPM_INSTALL_PREFIX/bin/zopectl adduser <user> <password>"
  148. echo "After this you can startup Zope with"
  149. echo " \$ $RPM_INSTALL_PREFIX/etc/rc zope start"
  150. echo "and connect to it through the URL:"
  151. echo " http://localhost:8080/"
  152. echo "Use the created <user> and <password> to login to its management"
  153. echo "interface in order to configure Zope to your particular needs."
  154. ) | %{l_rpmtool} msg -b -t notice
  155. fi
  156. %preun
  157. [ $1 -eq 0 ] || exit 0
  158. # stop service
  159. %{l_rc} zope stop 2>/dev/null
  160. # remove compiled python modules
  161. ( cd $RPM_INSTALL_PREFIX/lib/zope
  162. find . -name "*.pyc" | xargs rm -f || true
  163. ) || true
  164. # remove log files
  165. rm -rf $RPM_INSTALL_PREFIX/var/zope/var/* >/dev/null 2>&1 || true
  166. rm -rf $RPM_INSTALL_PREFIX/var/zope/log/* >/dev/null 2>&1 || true
  167. exit 0