sks.spec 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. ##
  2. ## sks.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 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: sks
  26. Summary: OpenPGP Key Server
  27. URL: http://www.nongnu.org/sks/
  28. Vendor: Yaron Minsky
  29. Packager: OpenPKG Foundation e.V.
  30. Distribution: OpenPKG Community
  31. Class: EVAL
  32. Group: Cryptography
  33. License: GPL
  34. Version: 1.0.10
  35. Release: 20061101
  36. # list of sources
  37. Source0: http://download.savannah.gnu.org/releases/sks/sks-%{version}.tgz
  38. Source1: rc.sks
  39. Source2: sks-setup
  40. Source3: sks-load
  41. Source4: sks.html
  42. Patch0: sks.patch
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20040130, ocaml, gcc, make, perl
  47. PreReq: OpenPKG, openpkg >= 20040130
  48. BuildPreReq: db
  49. PreReq: db
  50. AutoReq: no
  51. AutoReqProv: no
  52. %description
  53. SKS is a new OpenPGP keyserver whose goal is to provide easy
  54. to deploy, decentralized, and highly reliable synchronization.
  55. That means that a key submitted to one SKS server will quickly
  56. be distributed to all key servers, and even wildly out-of-date
  57. servers, or servers that experience spotty connectivity, can fully
  58. synchronize with rest of the system.
  59. SKS uses a highly efficient and reliable reconciliation algorithm;
  60. follows RFC2440 and RFC2440bis carefully, supports (unlike PKS)
  61. new and old style packets, photoID packets, multiple subkeys, and
  62. pretty much everything allowed by the RFCs; is fully compatible with
  63. the PKS system (can both send and receive syncs from PKS servers,
  64. ensuring seamless connectivity), provides a simple configuration:
  65. each host just needs a (partial) list of the other participating key
  66. servers; and supports HKP/web-based querying.
  67. %track
  68. prog sks = {
  69. version = %{version}
  70. url = http://download.savannah.gnu.org/releases/sks/
  71. regex = sks-(__VER__)\.tgz
  72. }
  73. %prep
  74. %setup -q
  75. %patch -p0
  76. %build
  77. %{l_make} %{l_mflags} \
  78. BDBINCLUDE="%{l_cppflags}" \
  79. BDBLIB="%{l_ldflags}" \
  80. LIBDB="-ldb" \
  81. MANDIR="%{l_prefix}/man"
  82. %install
  83. rm -rf $RPM_BUILD_ROOT
  84. %{l_shtool} mkdir -f -p -m 755 \
  85. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  86. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  87. $RPM_BUILD_ROOT%{l_prefix}/share/sks \
  88. $RPM_BUILD_ROOT%{l_prefix}/var/sks
  89. %{l_shtool} install -c -s -m 755 \
  90. sks sks_add_mail $RPM_BUILD_ROOT%{l_prefix}/sbin/
  91. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  92. %{SOURCE sks-setup} %{SOURCE sks-load} \
  93. $RPM_BUILD_ROOT%{l_prefix}/sbin/
  94. %{l_shtool} install -c -m 755 \
  95. -e 's;/bin/bash;%{l_bash};g' \
  96. -e 's; sks ; %{l_prefix}/sbin/sks ;g' \
  97. sks_build.sh $RPM_BUILD_ROOT%{l_prefix}/sbin/sks_build
  98. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  99. %{SOURCE rc.sks} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  100. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  101. %{SOURCE sks.html} $RPM_BUILD_ROOT%{l_prefix}/share/sks/
  102. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  103. %{l_files_std} \
  104. '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/sks'
  105. %files -f files
  106. %clean
  107. rm -rf $RPM_BUILD_ROOT
  108. %post
  109. # on initial install, create database
  110. if [ $1 -eq 1 ]; then
  111. su %{l_rusr} -c "$RPM_INSTALL_PREFIX/sbin/sks-setup"
  112. ( echo "SKS database initialized. Now you can startup SKS with"
  113. echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc sks start"
  114. echo "and for instance lookup the OpenPKG OpenPGP keys under"
  115. echo " http://localhost:11371/pks/lookup?op=index&search=openpkg"
  116. echo "or access the SKS internal statistic page under"
  117. echo " http://localhost:11371/pks/lookup?op=stats"
  118. echo "If you want to load a full dump of all keys in the existing"
  119. echo "SKS key servers, run the following command to download and"
  120. echo "merge all their latest dumps into your local database:"
  121. echo " su %{l_rusr} -c $RPM_INSTALL_PREFIX/sbin/sks-load"
  122. ) | %{l_rpmtool} msg -b -t notice
  123. fi
  124. # after upgrade, restart service
  125. [ $1 -eq 2 ] || exit 0
  126. eval `%{l_rc} sks status 2>/dev/null`
  127. [ ".$sks_active" = .yes ] && %{l_rc} sks restart
  128. exit 0
  129. %preun
  130. # before erase, stop service and remove log files
  131. [ $1 -eq 0 ] || exit 0
  132. %{l_rc} sks stop 2>/dev/null
  133. rm -rf $RPM_INSTALL_PREFIX/var/sks/* >/dev/null 2>&1 || true
  134. exit 0