ntp.spec 4.3 KB

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