ntp.spec 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. ##
  2. ## ntpd.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2002 Ralf S. Engelschall <rse@engelschall.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 information
  26. Name: ntp
  27. Summary: Network Time Protocol (NTP) Daemon
  28. URL: http://www.ntp.org/
  29. Vendor: David L. Mills
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [REL]
  32. Group: Net
  33. License: BSD-style
  34. Version: 4.1.1
  35. Release: 20020229
  36. # list of sources
  37. Source0: http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-%{version}.tar.gz
  38. Source1: ntp-doc.tar.gz
  39. Source2: ntp.conf
  40. Source3: rc.ntp
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 20020206
  45. PreReq: OpenPKG, openpkg >= 20020206
  46. AutoReq: no
  47. AutoReqProv: no
  48. %description
  49. The Network Time Protocol (NTP) is used to synchronize the time
  50. of a computer client or server to another server or reference
  51. time source, such as a radio or satellite receiver or modem. It
  52. provides accuracies typically within a millisecond on LANs and
  53. up to a few tens of milliseconds on WANs relative to Coordinated
  54. Universal Time (UTC) via a Global Positioning Service (GPS)
  55. receiver, for example. Typical NTP configurations utilize multiple
  56. redundant servers and diverse network paths in order to achieve high
  57. accuracy and reliability. Some configurations include cryptographic
  58. authentication to prevent accidental or malicious protocol attacks
  59. and some provide automatic server discovery using IP multicast.
  60. %prep
  61. %setup0 -q -c
  62. %setup1 -q -T -D -a 1
  63. %build
  64. ( cd ntp-%{version}
  65. CC="%{l_cc}" \
  66. CFLAGS="%{l_cflags -O}" \
  67. ./configure \
  68. --prefix=%{l_prefix}
  69. %{l_shtool} subst \
  70. -e 's;\(CONFIG_FILE[^"]*"\)/etc/ntp.conf;\1%{l_prefix}/etc/ntp/ntp.conf;' \
  71. include/ntp_config.h ntpdate/ntptime_config.c
  72. %{l_make} %{l_mflags -O}
  73. )
  74. %install
  75. rm -rf $RPM_BUILD_ROOT
  76. ( cd ntp-%{version}
  77. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  78. )
  79. ( cd ntp-doc
  80. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man5
  81. %{l_shtool} install -c -m 644 *.5 $RPM_BUILD_ROOT%{l_prefix}/man/man5/
  82. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man8
  83. %{l_shtool} install -c -m 644 *.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  84. )
  85. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/ntp
  86. %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
  87. %{SOURCE ntp.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/ntp/
  88. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  89. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  90. -e 's;@l_musr@;%{l_musr};g' -e 's;@l_mgrp@;%{l_mgrp};g' \
  91. %{SOURCE rc.ntp} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  92. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/ntp/ntpd.stat
  93. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  94. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  95. '%config %{l_prefix}/etc/ntp/ntp.conf'
  96. %files -f files
  97. %clean
  98. rm -rf $RPM_BUILD_ROOT