minicom.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. ##
  2. ## minicom.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 Ralf S. Engelschall <http://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 version
  25. %define V_major 2.2
  26. %define V_minor rc2
  27. %define V_subdir 1721
  28. # package information
  29. Name: minicom
  30. Summary: Serial Line Terminal Program
  31. URL: http://alioth.debian.org/projects/minicom/
  32. Vendor: Jukka Lahtinen
  33. Packager: OpenPKG Foundation e.V.
  34. Distribution: OpenPKG Community
  35. Class: BASE
  36. Group: Communication
  37. License: BSD
  38. Version: %{V_major}%{V_minor}
  39. Release: 20061016
  40. # list of sources
  41. Source0: http://alioth.debian.org/download.php/%{V_subdir}/minicom-%{V_major}-%{V_minor}.tar.gz
  42. Patch0: minicom.patch
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20040130, lrzsz, make
  47. PreReq: OpenPKG, openpkg >= 20040130, lrzsz
  48. BuildPreReq: ncurses
  49. PreReq: ncurses
  50. AutoReq: no
  51. AutoReqProv: no
  52. %description
  53. Minicom is a menu driven communication program for serial line
  54. communications. It emulates ANSI and VT102 terminals, has a dialing
  55. directory and automatic ZMODEM download support.
  56. %track
  57. prog minicom = {
  58. version = %{V_major}-%{V_minor}
  59. url = http://alioth.debian.org/project/showfiles.php?group_id=30018&release_id=96
  60. regex = minicom-(__VER__)\.tar\.gz
  61. }
  62. prog minicom:subdir = {
  63. version = %{V_subdir}
  64. url = http://alioth.debian.org/project/showfiles.php?group_id=30018&release_id=96
  65. regex = /(\d+)/minicom-__VER__\.tar\.gz
  66. }
  67. %prep
  68. %setup -q -n minicom-%{V_major}-%{V_minor}
  69. %patch -p0
  70. %{l_shtool} subst \
  71. -e 's;wprintf;minicom_wprintf;g' \
  72. `find src -name "*.[ch]" -print`
  73. %build
  74. # determine default serial device
  75. device="/dev/modem"
  76. lockdir="/var/lock"
  77. case "%{l_platform -t}" in
  78. *-freebsd* ) device=/dev/cuaa0; lockdir=/var/spool/lock ;;
  79. *-linux* ) device=/dev/ttyS0; lockdir=/var/lock ;;
  80. *-sunos* ) device=/dev/cua/a; lockdir=/var/spool/locks ;;
  81. *-darwin* ) device=/dev/cu.modem; lockdir=/var/tmp ;;
  82. esac
  83. # configure sources
  84. CC="%{l_cc}" \
  85. CFLAGS="%{l_cflags -O}" \
  86. CPPFLAGS="%{l_cppflags ncurses .}" \
  87. LDFLAGS="%{l_ldflags}" \
  88. ./configure \
  89. --prefix=%{l_prefix} \
  90. --sysconfdir=%{l_prefix}/etc/minicom \
  91. --enable-lock-dir=$lockdir \
  92. --enable-dfl-port=$device \
  93. --enable-dfl-baud=9600 \
  94. --disable-nls
  95. # build programs
  96. %{l_make} %{l_mflags -O}
  97. %install
  98. rm -rf $RPM_BUILD_ROOT
  99. # pre-create installation area
  100. %{l_shtool} mkdir -f -p -m 755 \
  101. $RPM_BUILD_ROOT%{l_prefix}/bin \
  102. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  103. $RPM_BUILD_ROOT%{l_prefix}/etc/minicom \
  104. $RPM_BUILD_ROOT%{l_prefix}/share/minicom
  105. # install programs
  106. %{l_make} %{l_mflags} install \
  107. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  108. exec_prefix=$RPM_BUILD_ROOT%{l_prefix}
  109. # add configuration files
  110. %{l_shtool} install -c -m 644 \
  111. -e 's;^ALL;#ALL;' \
  112. doc/minicom.users $RPM_BUILD_ROOT%{l_prefix}/etc/minicom/
  113. echo "root" >>$RPM_BUILD_ROOT%{l_prefix}/etc/minicom/minicom.users
  114. ( echo "pu baudrate 9600"
  115. echo "pu bits 8"
  116. echo "pu parity N"
  117. echo "pu stopbits 1"
  118. echo "pu minit ^M"
  119. echo "pu mreset ^M"
  120. echo "pu mhangup ^M"
  121. ) >minirc.dfl
  122. %{l_shtool} install -c -m 644 \
  123. minirc.dfl $RPM_BUILD_ROOT%{l_prefix}/etc/minicom/
  124. # strip binaries
  125. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  126. # determine installation files
  127. attr_cfg="644,uucp,%{l_mgrp}"
  128. attr_dev="4755,uucp,%{l_mgrp}"
  129. case "%{l_platform -t}" in
  130. *-freebsd* )
  131. attr_cfg="644,uucp,%{l_mgrp}"
  132. attr_dev="6755,uucp,dialer"
  133. ;;
  134. *-linux* )
  135. attr_cfg="644,%{l_musr},%{l_mgrp}"
  136. attr_dev="2755,%{l_musr},`ls -l /dev/ttyS0 | awk '{print $4;}'`"
  137. ;;
  138. *-sunos* )
  139. attr_cfg="644,uucp,%{l_mgrp}"
  140. attr_dev="4755,uucp,%{l_mgrp}"
  141. ;;
  142. *-darwin* )
  143. attr_cfg="644,%{l_musr},%{l_mgrp}"
  144. attr_dev="2755,%{l_musr},wheel"
  145. ;;
  146. esac
  147. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  148. %{l_files_std} \
  149. "%config %{l_prefix}/etc/minicom/*" \
  150. "%config %attr($attr_cfg) %{l_prefix}/etc/minicom/minirc.dfl" \
  151. "%attr($attr_dev) %{l_prefix}/bin/minicom"
  152. %files -f files
  153. %clean
  154. rm -rf $RPM_BUILD_ROOT