ntp.spec 5.0 KB

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