spegla.spec 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. ##
  2. ## spegla.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: spegla
  27. Summary: FTP Mirroring Tool
  28. URL: ftp://subzero.campus.luth.se/pub/spegla/
  29. Vendor: Jens A Nilsson
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [EVAL]
  32. Group: Network
  33. License: BSD
  34. Version: 1.1p4
  35. Release: 20031103
  36. # package options
  37. %option with_ipv6 no
  38. # list of sources
  39. Source0: ftp://subzero.campus.luth.se/pub/spegla/spegla-%{version}.tar.gz
  40. Source1: spegla.conf
  41. Source2: spegla-mirror
  42. Source3: rc.spegla
  43. Patch0: spegla.patch
  44. Patch1: http://www.imasy.or.jp/~ume/ipv6/spegla-1.1p4-ipv6-20020129.diff.gz
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20030909
  49. PreReq: OpenPKG, openpkg >= 20030909
  50. AutoReq: no
  51. AutoReqProv: no
  52. %description
  53. Spegla is fast mirroring tool for the File Transfer Protocol (FTP).
  54. %prep
  55. %setup -q
  56. %patch0 -p0
  57. %patch1 -p0
  58. %build
  59. cp Makefile.linux Makefile
  60. %{l_shtool} subst \
  61. -e 's;gcc;$(CC);' \
  62. -e 's;^\(OBJS[ ]*=\);\1 regex/regcomp.o regex/regerror.o regex/regexec.o regex/regfree.o;' \
  63. Makefile
  64. for name in regex/regcomp regex/regerror regex/regexec regex/regfree; do
  65. echo "$name.o: $name.c" >>Makefile
  66. echo " \$(CC) \$(CFLAGS) -o $name.o $name.c \$(DEFS)" >>Makefile
  67. done
  68. CC="%{l_cc}"
  69. CFLAGS="%{l_cflags -O} -c"
  70. %if "%{with_ipv6}" == "yes"
  71. DEFS="-DINET6"
  72. %else
  73. DEFS=""
  74. %endif
  75. LDFLAGS=""
  76. case "%{l_platform -t}" in
  77. *-freebsd* ) DEFS="$DEFS -DFREEBSD"; LDFLAGS="$LDFLAGS -lcompat" ;;
  78. *-linux* ) DEFS="$DEFS -DLINUX" ;;
  79. *-sunos* ) DEFS="$DEFS -DSolaris -DMTYPES -DNOCDEFS -DPROGNAME=\\\"spegla\\\"" ;;
  80. esac
  81. %{l_make} %{l_mflags -O} \
  82. CC="$CC" CFLAGS="$CFLAGS" DEFS="$DEFS" LDFLAGS="$LDFLAGS"
  83. %install
  84. rm -rf $RPM_BUILD_ROOT
  85. %{l_shtool} mkdir -f -p -m 755 \
  86. $RPM_BUILD_ROOT%{l_prefix}/bin \
  87. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  88. $RPM_BUILD_ROOT%{l_prefix}/etc/spegla \
  89. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  90. $RPM_BUILD_ROOT%{l_prefix}/var/spegla/pkg
  91. %{l_shtool} install -c -s -m 755 \
  92. spegla $RPM_BUILD_ROOT%{l_prefix}/bin/
  93. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  94. %{SOURCE spegla-mirror} $RPM_BUILD_ROOT%{l_prefix}/bin/
  95. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  96. %{SOURCE spegla.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/spegla/
  97. %{l_shtool} install -c -m 644 \
  98. spegla.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  99. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  100. %{SOURCE rc.spegla} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  101. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  102. '%config %{l_prefix}/etc/spegla/*'
  103. %files -f files
  104. %clean
  105. rm -rf $RPM_BUILD_ROOT