portfwd.spec 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. ##
  2. ## portfwd.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: portfwd
  27. Summary: TCP/UDP Port Forwarding Daemon
  28. URL: http://portfwd.sf.net/
  29. Vendor: Everton da Silva Marques
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [EVAL]
  32. Group: Network
  33. License: GPL
  34. Version: 0.26rc3
  35. Release: 20021204
  36. # list of sources
  37. Source0: http://osdn.dl.sourceforge.net/sourceforge/portfwd/portfwd-%{version}.tar.gz
  38. Source1: portfwd.cfg
  39. Source2: rc.portfwd
  40. Source3: fsl.portfwd
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 20021204, fsl, gcc, make, flex
  45. PreReq: OpenPKG, openpkg >= 20021204, fsl
  46. AutoReq: no
  47. AutoReqProv: no
  48. %description
  49. Portfwd is a port forwarding daemon which forwards incoming TCP
  50. connections and/or UDP datagrams to remote hosts. There is support for
  51. FTP forwarding, transparent proxy, DNS on demand, simple round-robin
  52. load-balacing, external destination selectors and other minor features.
  53. %prep
  54. %setup -q
  55. rm -f config/install-sh
  56. rm -f config/missing
  57. echo "#!/bin/sh" >config/install-sh
  58. echo "#!/bin/sh" >config/missing
  59. chmod a+x config/missing config/install-sh
  60. %build
  61. CC="%{l_cc}" \
  62. CXX="%{l_cxx}" \
  63. CFLAGS="%{l_cflags -O}" \
  64. CXXFLAGS="%{l_cxxflags -O}" \
  65. CPPFLAGS="%{l_cppflags}" \
  66. LDFLAGS="%{l_ldflags} `%{l_prefix}/bin/fsl-config --all --ldflags --libs`" \
  67. ./configure \
  68. --prefix=%{l_prefix} \
  69. --sysconfdir=%{l_prefix}/etc/portfwd
  70. %{l_make} %{l_mflags -O}
  71. %install
  72. rm -rf $RPM_BUILD_ROOT
  73. %{l_shtool} mkdir -f -p -m 755 \
  74. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  75. $RPM_BUILD_ROOT%{l_prefix}/etc/portfwd \
  76. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  77. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl \
  78. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  79. $RPM_BUILD_ROOT%{l_prefix}/man/man5
  80. %{l_shtool} install -c -s -m 755 \
  81. src/portfwd $RPM_BUILD_ROOT%{l_prefix}/sbin/
  82. %{l_shtool} install -c -m 644 \
  83. doc/portfwd.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  84. %{l_shtool} install -c -m 644 \
  85. -e 's;conf.txt;portfwd.txt;g' \
  86. doc/portfwd.cfg.5 $RPM_BUILD_ROOT%{l_prefix}/man/man5/
  87. %{l_shtool} install -c -m 644 \
  88. -e 's;@l_nusr@;%{l_nusr};g' \
  89. -e 's;@l_ngrp@;%{l_ngrp};g' \
  90. %{SOURCE portfwd.cfg} $RPM_BUILD_ROOT%{l_prefix}/etc/portfwd/
  91. %{l_shtool} install -c -m 644 \
  92. doc/conf.txt $RPM_BUILD_ROOT%{l_prefix}/etc/portfwd/portfwd.txt
  93. %{l_shtool} install -c -m 644 \
  94. -e 's;@l_prefix@;%{l_prefix};g' \
  95. %{SOURCE rc.portfwd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  96. %{l_shtool} install -c -m 644 \
  97. -e 's;@l_prefix@;%{l_prefix};g' \
  98. %{SOURCE fsl.portfwd} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  99. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  100. %{l_files_std} \
  101. '%config %{l_prefix}/etc/portfwd/portfwd.cfg' \
  102. '%config %{l_prefix}/etc/fsl/fsl.portfwd' \
  103. '%not %dir %{l_prefix}/etc/fsl'
  104. %files -f files
  105. %clean
  106. rm -rf $RPM_BUILD_ROOT