minicom.spec 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. ##
  2. ## minicom.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2002 Ralf S. Engelschall <rse@engelschall.com>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: minicom
  26. Summary: Serial Line Terminal Program
  27. URL: http://www.netsonic.fi/~walker/minicom.html
  28. Vendor: Jukka Lahtinen
  29. Packager: The OpenPKG Project
  30. Distribution: OpenPKG [BASE]
  31. Group: Communication
  32. License: BSD
  33. Version: 2.00.0
  34. Release: 20021111
  35. # list of sources
  36. Source0: http://www.netsonic.fi/~walker/minicom-%{version}.src.tar.gz
  37. Source1: getopt.c
  38. Source2: getopt.h
  39. # build information
  40. Prefix: %{l_prefix}
  41. BuildRoot: %{l_buildroot}
  42. BuildPreReq: OpenPKG, openpkg >= 20020206, lrzsz, make
  43. PreReq: OpenPKG, openpkg >= 20020206, lrzsz
  44. AutoReq: no
  45. AutoReqProv: no
  46. %description
  47. Minicom is a terminal program for serial line communications.
  48. %prep
  49. %setup -q
  50. # patch sources to use a stand-alone glibc getopt_long
  51. # and make sure the commands are really linked against it.
  52. cp %{SOURCE getopt.c} lib/getopt_long.c
  53. cp %{SOURCE getopt.h} lib/
  54. %{l_shtool} subst \
  55. -e 's;^\(minicom_LDADD = @INTLLIBS@\);\1 $(LDADD);' \
  56. -e 's;^\(runscript_LDADD = @INTLLIBS@\);\1 $(LDADD);' \
  57. src/Makefile.in
  58. %build
  59. # determine default serial device
  60. device="/dev/modem"
  61. case "%{l_target}" in
  62. *-freebsd* ) device=/dev/cuaa0 ;;
  63. *-linux* ) device=/dev/ttyS0 ;;
  64. *-solaris* ) device=/dev/cua/a ;;
  65. esac
  66. # configure sources
  67. CC="%{l_cc}" \
  68. CFLAGS="%{l_cflags -O}" \
  69. ./configure \
  70. --prefix=%{l_prefix} \
  71. --sysconfdir=%{l_prefix}/etc/minicom \
  72. --enable-dfl-port=$device \
  73. --disable-nls
  74. # build programs
  75. %{l_make} %{l_mflags -O}
  76. %install
  77. rm -rf $RPM_BUILD_ROOT
  78. # pre-create installation area
  79. %{l_shtool} mkdir -f -p -m 755 \
  80. $RPM_BUILD_ROOT%{l_prefix}/bin \
  81. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  82. $RPM_BUILD_ROOT%{l_prefix}/etc/minicom \
  83. $RPM_BUILD_ROOT%{l_prefix}/share/minicom
  84. # install programs
  85. %{l_make} %{l_mflags} install \
  86. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  87. exec_prefix=$RPM_BUILD_ROOT%{l_prefix}
  88. # add configuration files
  89. %{l_shtool} install -c -m 644 \
  90. -e 's;^ALL;#ALL;' \
  91. doc/minicom.users $RPM_BUILD_ROOT%{l_prefix}/etc/minicom/
  92. echo "root" >>$RPM_BUILD_ROOT%{l_prefix}/etc/minicom/minicom.users
  93. %{l_shtool} install -c -m 644 \
  94. doc/minirc.dfl $RPM_BUILD_ROOT%{l_prefix}/etc/minicom/
  95. # strip binaries
  96. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  97. # determine installation files
  98. attr="4755,uucp,%{l_mgrp}"
  99. case "%{l_target}" in
  100. *-freebsd* ) attr="6755,uucp,dialer" ;;
  101. *-linux* ) attr="2755,%{l_musr},`ls -l /dev/ttyS0 | awk '{print $4;}'`" ;;
  102. *-solaris* ) attr="4755,uucp,%{l_mgrp}" ;;
  103. esac
  104. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  105. %{l_files_std} \
  106. "%attr($attr) %{l_prefix}/bin/minicom"
  107. %files -f files
  108. %clean
  109. rm -rf $RPM_BUILD_ROOT