minicom.spec 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. ##
  2. ## minicom.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: minicom
  27. Summary: Serial Line Terminal Program
  28. URL: http://www.netsonic.fi/~walker/minicom.html
  29. Vendor: Jukka Lahtinen
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [BASE]
  32. Group: Communication
  33. License: BSD
  34. Version: 2.00.0
  35. Release: 20021111
  36. # list of sources
  37. Source0: http://www.netsonic.fi/~walker/minicom-%{version}.src.tar.gz
  38. Source1: getopt.c
  39. Source2: getopt.h
  40. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20020206, lrzsz, make
  44. PreReq: OpenPKG, openpkg >= 20020206, lrzsz
  45. AutoReq: no
  46. AutoReqProv: no
  47. %description
  48. Minicom is a terminal program for serial line communications.
  49. %prep
  50. %setup -q
  51. # patch sources to use a stand-alone glibc getopt_long
  52. # and make sure the commands are really linked against it.
  53. cp %{SOURCE getopt.c} lib/getopt_long.c
  54. cp %{SOURCE getopt.h} lib/
  55. %{l_shtool} subst \
  56. -e 's;^\(minicom_LDADD = @INTLLIBS@\);\1 $(LDADD);' \
  57. -e 's;^\(runscript_LDADD = @INTLLIBS@\);\1 $(LDADD);' \
  58. src/Makefile.in
  59. %build
  60. # determine default serial device
  61. device="/dev/modem"
  62. case "%{l_target}" in
  63. *-freebsd* ) device=/dev/cuaa0 ;;
  64. *-linux* ) device=/dev/ttyS0 ;;
  65. *-solaris* ) device=/dev/cua/a ;;
  66. esac
  67. # configure sources
  68. CC="%{l_cc}" \
  69. CFLAGS="%{l_cflags -O}" \
  70. ./configure \
  71. --prefix=%{l_prefix} \
  72. --sysconfdir=%{l_prefix}/etc/minicom \
  73. --enable-dfl-port=$device \
  74. --disable-nls
  75. # build programs
  76. %{l_make} %{l_mflags -O}
  77. %install
  78. rm -rf $RPM_BUILD_ROOT
  79. # pre-create installation area
  80. %{l_shtool} mkdir -f -p -m 755 \
  81. $RPM_BUILD_ROOT%{l_prefix}/bin \
  82. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  83. $RPM_BUILD_ROOT%{l_prefix}/etc/minicom \
  84. $RPM_BUILD_ROOT%{l_prefix}/share/minicom
  85. # install programs
  86. %{l_make} %{l_mflags} install \
  87. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  88. exec_prefix=$RPM_BUILD_ROOT%{l_prefix}
  89. # add configuration files
  90. %{l_shtool} install -c -m 644 \
  91. -e 's;^ALL;#ALL;' \
  92. doc/minicom.users $RPM_BUILD_ROOT%{l_prefix}/etc/minicom/
  93. echo "root" >>$RPM_BUILD_ROOT%{l_prefix}/etc/minicom/minicom.users
  94. %{l_shtool} install -c -m 644 \
  95. doc/minirc.dfl $RPM_BUILD_ROOT%{l_prefix}/etc/minicom/
  96. # strip binaries
  97. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  98. # determine installation files
  99. attr="4755,uucp,%{l_mgrp}"
  100. case "%{l_target}" in
  101. *-freebsd* ) attr="6755,uucp,dialer" ;;
  102. *-linux* ) attr="2755,%{l_musr},`ls -l /dev/ttyS0 | awk '{print $4;}'`" ;;
  103. *-solaris* ) attr="4755,uucp,%{l_mgrp}" ;;
  104. esac
  105. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  106. %{l_files_std} \
  107. "%attr($attr) %{l_prefix}/bin/minicom"
  108. %files -f files
  109. %clean
  110. rm -rf $RPM_BUILD_ROOT