hexer.spec 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. ##
  2. ## hexer.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: hexer
  27. Summary: Vi-style Hexadecimal Binary Editor
  28. URL: -
  29. Vendor: Sascha Demetrio
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [PLUS]
  32. Group: Editor
  33. License: BSD
  34. Version: 0.1.4c
  35. Release: 20030918
  36. # list of sources
  37. Source0: ftp://ftp.netsw.org/system/tools/fileutils/edit/hexer-%{version}.tar.gz
  38. Patch0: hexer.patch
  39. # build information
  40. Prefix: %{l_prefix}
  41. BuildRoot: %{l_buildroot}
  42. BuildPreReq: OpenPKG, openpkg >= 20030909
  43. PreReq: OpenPKG, openpkg >= 20030909
  44. AutoReq: no
  45. AutoReqProv: no
  46. %description
  47. Hexer is a Vi-style hexadecimal editor for editing binary files.
  48. %prep
  49. %setup -q
  50. %patch -p0
  51. %build
  52. # choose platform specific configuration file
  53. # and always rely on having an ISO C compiler
  54. ext=any
  55. case "%{l_platform -t}" in
  56. *-freebsd* ) ext=bsd ;;
  57. *-linux* ) ext=linux ;;
  58. *-sunos* ) ext=sunos ;;
  59. esac
  60. %{l_shtool} install \
  61. -e 's;\(USE_STDARG\).*;\1 1;' \
  62. config.$ext config.h
  63. # determine available terminal library
  64. # kludge: determine whether vendor termcap, termlib or curses library exists
  65. # reason: some brain-dead platforms (like SuSE, etc) have no termcap library installed.
  66. termlib=""
  67. echo "int main(int argc, char *argv[]) { return 0; }" >dummy.c
  68. for lib in termcap termlib curses ncurses; do
  69. rc=0; %{l_cc} -o dummy dummy.c -l$lib >/dev/null 2>&1 || rc=1
  70. if [ $rc -eq 0 ]; then termlib="-l$lib"; break; fi
  71. done
  72. [ ".$termlib" = . ] && exit 1
  73. # build package
  74. %{l_make} %{l_mflags} \
  75. CC="%{l_cc}" \
  76. CFLAGS="%{l_cflags -O} \$(DEFINES)" \
  77. TERMCAP="$termlib -lm"
  78. %install
  79. rm -rf $RPM_BUILD_ROOT
  80. # install package
  81. %{l_shtool} mkdir -f -p -m 755 \
  82. $RPM_BUILD_ROOT%{l_prefix}/bin \
  83. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  84. %{l_shtool} install -c -s -m 755 \
  85. hexer $RPM_BUILD_ROOT%{l_prefix}/bin/
  86. %{l_shtool} install -c -m 644 \
  87. hexer.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  88. # determine installation files
  89. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  90. %files -f files
  91. %clean
  92. rm -rf $RPM_BUILD_ROOT