tftp.spec 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. ##
  2. ## tftp.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: tftp
  27. Summary: TFTP Client and Server
  28. URL: http://www.kernel.org/pub/software/network/tftp/
  29. Vendor: H. Peter Anvin
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [PLUS]
  32. Group: Networtk
  33. License: GPL
  34. Version: 0.34
  35. Release: 20030708
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: http://www.kernel.org/pub/software/network/tftp/tftp-hpa-%{version}.tar.gz
  40. Source1: tftpd.remap
  41. Source2: rc.tftp
  42. Source3: fsl.tftp
  43. Patch0: tftp.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20030415, make, gcc
  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. This is a portable client and server for the Trivial File Transfer
  57. Protocol (TFTP).
  58. %prep
  59. %setup -q -n tftp-hpa-%{version}
  60. %patch -p0
  61. %build
  62. CC="%{l_cc}" \
  63. CFLAGS="%{l_cflags -O} -DPID_FILE='\"%{l_prefix}/var/tftp/tftpd.pid\"'" \
  64. CPPFLAGS="%{l_cppflags}" \
  65. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  66. LIBS="%{l_fsl_libs}" \
  67. ./configure \
  68. --prefix=%{l_prefix} \
  69. --without-tcpwrappers \
  70. --without-readline
  71. %{l_make} %{l_mflags -O}
  72. %install
  73. rm -rf $RPM_BUILD_ROOT
  74. %{l_shtool} mkdir -f -p -m 755 \
  75. $RPM_BUILD_ROOT%{l_prefix}/var/tftp \
  76. $RPM_BUILD_ROOT%{l_prefix}/etc/tftp \
  77. $RPM_BUILD_ROOT%{l_prefix}/var/tftp
  78. %{l_make} %{l_mflags} install \
  79. INSTALL="%{l_shtool} install -c" \
  80. INSTALLROOT=$RPM_BUILD_ROOT
  81. %{l_shtool} install -c -m 644 \
  82. -e 's;@l_prefix@;%{l_prefix};g' \
  83. %{SOURCE tftpd.remap} $RPM_BUILD_ROOT%{l_prefix}/etc/tftp/
  84. mv $RPM_BUILD_ROOT%{l_prefix}/man/man8/in.tftpd.8 \
  85. $RPM_BUILD_ROOT%{l_prefix}/man/man8/tftpd.8
  86. mv $RPM_BUILD_ROOT%{l_prefix}/sbin/in.tftpd \
  87. $RPM_BUILD_ROOT%{l_prefix}/sbin/tftpd
  88. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  89. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  90. # install run-command script
  91. %{l_shtool} mkdir -f -p -m 755 \
  92. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  93. %{l_shtool} install -c -m 755 \
  94. -e 's;@l_prefix@;%{l_prefix};g' \
  95. -e 's;@l_susr@;%{l_susr};g' \
  96. -e 's;@l_rusr@;%{l_rusr};g' \
  97. -e 's;@l_rgrp@;%{l_rgrp};g' \
  98. %{SOURCE rc.tftp} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  99. # install OSSP fsl configuration
  100. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  101. %{l_shtool} install -c -m 644 \
  102. -e 's;@l_prefix@;%{l_prefix};g' \
  103. %{SOURCE fsl.tftp} \
  104. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  105. # determine installation files
  106. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  107. %{l_files_std} \
  108. '%not %dir %{l_prefix}/etc/fsl' \
  109. '%config %{l_prefix}/etc/fsl/fsl.tftp' \
  110. '%config %{l_prefix}/etc/tftp/*'
  111. %files -f files
  112. %clean
  113. rm -rf $RPM_BUILD_ROOT