openpkg-registry.spec 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. ##
  2. ## openpkg-registry.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: openpkg-registry
  26. Summary: OpenPKG Registry
  27. URL: http://www.openpkg.org/
  28. Vendor: OpenPKG
  29. Packager: OpenPKG Foundation e.V.
  30. Distribution: OpenPKG Community
  31. Class: PLUS
  32. Group: Bootstrapping
  33. License: BSD-style
  34. Version: 1.1.3
  35. Release: 20070824
  36. # package options
  37. %option with_client yes
  38. %option with_server no
  39. # list of sources
  40. Source0: ftp://ftp.openpkg.org/sources/CPY/openpkg-registry/openpkg-registry-%{version}.tar.gz
  41. Source1: rc.openpkg-registry
  42. Patch0: openpkg-registry.patch
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20060823
  47. PreReq: OpenPKG, openpkg >= 20060823
  48. %if "%{with_server}" == "yes"
  49. PreReq: perl-dbi::with_dbd_sqlite, perl-dbi::with_dbd_pgsql
  50. PreReq: postgresql
  51. PreReq: apache-perl
  52. PreReq: perl-www >= perl-www-5.8.7-20051031
  53. PreReq: perl-xml
  54. PreReq: cfg, cfg::with_perl = yes
  55. PreReq: uuid, uuid::with_perl = yes
  56. # PreReq: ase FIXME production
  57. %endif
  58. AutoReq: no
  59. AutoReqProv: no
  60. %description
  61. This package contains client and server parts to build a registry
  62. %track
  63. prog openpkg-registry = {
  64. version = %{version}
  65. url = ftp://ftp.openpkg.org/sources/CPY/openpkg-registry/
  66. regex = openpkg-registry-(__VER__)\.tar\.gz
  67. }
  68. %prep
  69. %setup
  70. %patch -p0
  71. %build
  72. %install
  73. rm -rf $RPM_BUILD_ROOT
  74. %{l_shtool} mkdir -f -p -m 755 \
  75. $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg-tools
  76. %if "%{with_client}" == "yes"
  77. %{l_shtool} mkdir -f -p -m 755 \
  78. $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg
  79. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  80. register.sh rpm.sh \
  81. $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg-tools/
  82. touch \
  83. $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.conf \
  84. $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.prep \
  85. $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.tran \
  86. $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.util
  87. chmod 644 \
  88. $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.conf \
  89. $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.prep \
  90. $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.tran \
  91. $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.util
  92. %endif
  93. %if "%{with_server}" == "yes"
  94. %{l_shtool} mkdir -f -p -m 755 \
  95. $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg-registry \
  96. $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg-registry \
  97. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  98. $RPM_BUILD_ROOT%{l_prefix}/cgi/openpkg-registry \
  99. $RPM_BUILD_ROOT%{l_prefix}/var/openpkg-registry/db \
  100. $RPM_BUILD_ROOT%{l_prefix}/var/openpkg-registry/ui \
  101. $RPM_BUILD_ROOT%{l_prefix}/man/man8
  102. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  103. registry.pm \
  104. $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg-registry/
  105. %{l_shtool} install -c -m 640 %{l_value -s -a} \
  106. registry.cfg *.dat \
  107. $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg-registry/
  108. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  109. registry-db.pl \
  110. $RPM_BUILD_ROOT%{l_prefix}/sbin/registry-db
  111. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  112. registry-ui.pl ase.pm \
  113. $RPM_BUILD_ROOT%{l_prefix}/cgi/openpkg-registry/
  114. %{l_shtool} install -c -m 644 \
  115. *.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  116. # install run-command script
  117. %{l_shtool} mkdir -f -p -m 755 \
  118. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  119. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  120. %{SOURCE rc.openpkg-registry} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  121. %endif
  122. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  123. %{l_files_std} \
  124. %if "%{with_server}" == "yes"
  125. '%attr(700,%{l_rusr},%{l_rgrp}) %dir %{l_prefix}/var/openpkg-registry/db' \
  126. '%attr(775,%{l_musr},%{l_ngrp}) %dir %{l_prefix}/var/openpkg-registry/ui' \
  127. '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/etc/openpkg-registry/*' \
  128. %endif
  129. '%ghost %{l_prefix}/etc/openpkg/register.conf' \
  130. '%ghost %{l_prefix}/etc/openpkg/register.prep' \
  131. '%ghost %{l_prefix}/etc/openpkg/register.tran' \
  132. '%ghost %{l_prefix}/etc/openpkg/register.util'
  133. %files -f files
  134. %clean
  135. rm -rf $RPM_BUILD_ROOT
  136. %if "%{with_server}" == "yes"
  137. %post
  138. if [ $1 -eq 1 ]; then
  139. # display final hints on initial installation
  140. ( echo "1. To complete this installation of OpenPKG Registry please configure it,"
  141. echo " start PostgreSQL and initialize the OpenPKG Registry database like this:"
  142. echo " \$ vi $RPM_INSTALL_PREFIX/etc/openpkg-registry/registry.cfg"
  143. echo " # $RPM_INSTALL_PREFIX/bin/openpkg rc postgresql start"
  144. echo " \$ $RPM_INSTALL_PREFIX/sbin/registry-db setup"
  145. echo ""
  146. echo "2. After this postinstallation, adjust config and start Apache like this:"
  147. echo " # vi $RPM_INSTALL_PREFIX/etc/apache/apache.conf"
  148. echo " # $RPM_INSTALL_PREFIX/bin/openpkg rc apache start"
  149. echo " and connect with a browser to:"
  150. echo " http://127.0.0.1:80/openpkg-cgi/openpkg-registry/registry-ui.pl"
  151. ) | %{l_rpmtool} msg -b -t notice
  152. fi
  153. if [ $1 -eq 2 ]; then
  154. # display final hints on update installation
  155. ( echo "Please perform an OpenPKG Registry database upgrade by running"
  156. echo " \$ $RPM_INSTALL_PREFIX/sbin/registry-db setup"
  157. ) | %{l_rpmtool} msg -b -t notice
  158. fi
  159. exit 0
  160. %endif