ntp.spec 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. ##
  2. ## ntpd.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 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 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.1c
  35. Release: 20030709
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: ftp://ftp.udel.edu/pub/ntp/ntp4/ntp-%{version}-rc3.tar.gz
  40. Source1: ntp-doc.tar.gz
  41. Source2: ntp.conf
  42. Source3: rc.ntp
  43. Source4: fsl.ntp
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20030415
  48. PreReq: OpenPKG, openpkg >= 20030415
  49. %if "%{with_fsl}" == "yes"
  50. BuildPreReq: fsl
  51. PreReq: fsl
  52. %endif
  53. AutoReq: no
  54. AutoReqProv: no
  55. %description
  56. The Network Time Protocol (NTP) is used to synchronize the time
  57. of a computer client or server to another server or reference
  58. time source, such as a radio or satellite receiver or modem. It
  59. provides accuracies typically within a millisecond on LANs and
  60. up to a few tens of milliseconds on WANs relative to Coordinated
  61. Universal Time (UTC) via a Global Positioning Service (GPS)
  62. receiver, for example. Typical NTP configurations utilize multiple
  63. redundant servers and diverse network paths in order to achieve high
  64. accuracy and reliability. Some configurations include cryptographic
  65. authentication to prevent accidental or malicious protocol attacks
  66. and some provide automatic server discovery using IP multicast.
  67. %prep
  68. %setup0 -q -c
  69. %setup1 -q -T -D -a 1
  70. %build
  71. ( cd ntp-%{version}-rc3
  72. CC="%{l_cc}" \
  73. CFLAGS="%{l_cflags -O}" \
  74. LDFLAGS="%{l_fsl_ldflags}" \
  75. LIBS="%{l_fsl_libs}" \
  76. ./configure \
  77. --prefix=%{l_prefix}
  78. %{l_shtool} subst \
  79. -e 's;\(CONFIG_FILE[^"]*"\)/etc/ntp.conf;\1%{l_prefix}/etc/ntp/ntp.conf;' \
  80. include/ntp_config.h ntpdate/ntptime_config.c
  81. %{l_make} %{l_mflags -O}
  82. )
  83. %install
  84. rm -rf $RPM_BUILD_ROOT
  85. ( cd ntp-%{version}-rc3
  86. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  87. )
  88. ( cd ntp-doc
  89. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man5
  90. %{l_shtool} install -c -m 644 *.5 $RPM_BUILD_ROOT%{l_prefix}/man/man5/
  91. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man8
  92. %{l_shtool} install -c -m 644 *.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  93. )
  94. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/ntp
  95. %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
  96. %{SOURCE ntp.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/ntp/
  97. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/ntp/ntpd.stat
  98. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  99. # install run-command script
  100. %{l_shtool} mkdir -f -p -m 755 \
  101. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  102. %{l_shtool} install -c -m 755 \
  103. -e 's;@l_prefix@;%{l_prefix};g' \
  104. -e 's;@l_mgrp@;%{l_mgrp};g' \
  105. -e 's;@l_musr@;%{l_musr};g' \
  106. -e 's;@l_susr@;%{l_susr};g' \
  107. %{SOURCE rc.ntp} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  108. # install OSSP fsl configuration
  109. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  110. %{l_shtool} install -c -m 644 \
  111. -e 's;@l_prefix@;%{l_prefix};g' \
  112. %{SOURCE fsl.ntp} \
  113. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  114. # determine installation files
  115. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  116. %{l_files_std} \
  117. '%not %dir %{l_prefix}/etc/fsl' \
  118. '%config %{l_prefix}/etc/fsl/fsl.ntp' \
  119. '%config %{l_prefix}/etc/ntp/ntp.conf'
  120. %files -f files
  121. %clean
  122. rm -rf $RPM_BUILD_ROOT