shell dot on steroids https://pagure.io/shellfu

template.spec 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. %if ( 0%{?rhel} && 0%{?rhel} < 7 ) || ( 0%{?centos} && 0%{?centos} < 7 )
  2. %global pspkg procps
  3. %global legacy true
  4. %else
  5. %global pspkg procps-ng
  6. %global legacy false
  7. %endif
  8. Name: __MKIT_PROJ_PKGNAME__
  9. Version: __MKIT_PROJ_VERSION__
  10. Release: 1%{?dist}
  11. Summary: __MKIT_PROJ_NAME__ - __MKIT_PROJ_TAGLINE__
  12. License: LGPLv2
  13. URL: __MKIT_PROJ_VCS_BROWSER__
  14. Source0: %{name}-%{version}.tar.gz
  15. BuildArch: noarch
  16. BuildRequires: perl
  17. BuildRequires: %{pspkg}
  18. Requires: %{pspkg}
  19. Requires: shellfu-bash-sfdoc
  20. %description
  21. Shellfu is an attempt to add modularity to your shell scripts.
  22. With Shellfu you can develop your shell modules separately from your
  23. scripts, and test, use, explore or study them without need to be aware
  24. of details such as where the actual files are placed.
  25. Shellfu is mostly intended for cases when there's need for non-trivial
  26. amount of reliable body of shell scripts, and access to advanced modular
  27. languages such as Python or Perl is limited.
  28. This sub-package contains only the Shellfu management system but not
  29. actual modules. Use this if you want to write all modules yourself.
  30. %package bash
  31. Summary: Bash-specific base
  32. Requires: shellfu
  33. %description bash
  34. This sub-package contains Bash-specific parts of library infrastructure.
  35. Shellfu modules written for Bash should depend on this.
  36. %package bash-arr
  37. Summary: Array utilities
  38. Requires: shellfu-bash
  39. Requires: shellfu-bash-pretty
  40. Requires: shellfu-sh-isa
  41. %description bash-arr
  42. This sub-package contains 'arr', Shellfu/Bash module with few utilities
  43. for manipulating Bash arrays
  44. %package bash-inigrep
  45. Summary: INI grepping Shellfu/Bash module
  46. Requires: perl
  47. Requires: shellfu-bash
  48. Requires: shellfu-bash-pretty
  49. Obsoletes: shellfu-bash-extras < 0.10
  50. %description bash-inigrep
  51. This sub-package contains 'inigrep', Shellfu/Bash module for reading
  52. INI-like files.
  53. %package bash-pretty
  54. Summary: Logging Shellfu/Bash module
  55. Requires: shellfu-bash
  56. Requires: shellfu-sh-exit
  57. Requires: shellfu-sh-termcolors
  58. Obsoletes: shellfu-bash-core < 0.10
  59. %description bash-pretty
  60. This sub-package contains 'pretty', universal Shellfu logging module.
  61. %package bash-sfdoc
  62. Summary: Shellfu/Bash module to export docs from Shellfu modules
  63. Requires: perl
  64. Requires: shellfu-bash
  65. Requires: shellfu-bash-pretty
  66. %description bash-sfdoc
  67. This sub-package contains Shellfu/Bash module to export documentation
  68. from other Shellfu modules that follow Shellfu coding style.
  69. %package bash-sfpi
  70. Summary: Shellfu/Bash plugin interface
  71. Requires: shellfu-bash
  72. Requires: shellfu-bash-sfdoc
  73. Requires: shellfu-bash-pretty
  74. %description bash-sfpi
  75. This sub-package contains Shellfu/Bash module to help manage, discover,
  76. select and load other Shellfu modules as plugins.
  77. %package devel
  78. Summary: Essential developer tools
  79. Requires: shellfu-bash-pretty
  80. %description devel
  81. This sub-package contains tools useful mostly for development of shellfu
  82. scripts.
  83. %package sh
  84. Summary: Generic base
  85. Requires: shellfu
  86. %description sh
  87. This sub-package contains POSIX-oriented parts of library infrastructure.
  88. Generic Shellfu modules aiming for POSIX compatibility should depend on this.
  89. %package sh-charmenu
  90. Summary: Shellfu/sh module for building interactive terminal menus
  91. Requires: shellfu-sh
  92. Obsoletes: shellfu-bash-extras < 0.10
  93. %description sh-charmenu
  94. This sub-package contains 'charmenu', a Shellfu/sh module for building
  95. interactive terminal menus
  96. %package sh-coerce
  97. Summary: Shellfu/sh module with data coercion helpers
  98. Requires: perl
  99. %if %{legacy} == "false"
  100. Requires: perl-Term-ANSIColor
  101. %endif
  102. Requires: shellfu-sh
  103. %description sh-coerce
  104. This sub-package contains 'coerce', Shellfu module containing few
  105. data coercion helpers.
  106. %package sh-exit
  107. Summary: Shellfu/sh module for standard exit statuses
  108. Requires: shellfu-sh
  109. Obsoletes: shellfu-bash-core < 0.10
  110. %description sh-exit
  111. This sub-package contains 'exit', Shellfu module containing functions
  112. and variables for standard exit statuses.
  113. %package sh-isa
  114. Summary: Shellfu/sh module with validation helpers
  115. Requires: shellfu-sh
  116. %description sh-isa
  117. This sub-package contains 'isa', Shellfu module containing few
  118. value validation helpers.
  119. %package sh-mdfmt
  120. Summary: Markdown formatting helper
  121. Requires: shellfu-sh
  122. %description sh-mdfmt
  123. This sub-package contains Markdown formatting helper, a function that
  124. helps you generate Markdown paragraph elements from your shell scripts.
  125. %package sh-termcolors
  126. Summary: Shellfu/sh module for terminal color names
  127. Requires: shellfu-sh
  128. Obsoletes: shellfu-bash-core < 0.10
  129. %description sh-termcolors
  130. This sub-package contains 'termcolors', Shellfu module containing most
  131. common ANSI color names.
  132. %prep
  133. %setup -q
  134. /bin/sed -i '/^__COERCE__LEGACY=/s/:-false/:-%{legacy}/' ./src/include-sh/coerce.sh
  135. %build
  136. make %{?_smp_mflags} PREFIX=/usr
  137. %install
  138. %make_install PREFIX=/usr
  139. %check
  140. make test \
  141. PATH=%{buildroot}/%{_bindir}:$PATH \
  142. SHELLFU_INCLUDE=%{buildroot}/%{_datadir}/%{name}/include \
  143. SHELLFU_DIR=%{buildroot}/%{_datadir}/%{name}
  144. %files
  145. %config %{_sysconfdir}/bash_completion.d/%{name}.bash
  146. %dir %{_datadir}/%{name}
  147. %dir %{_docdir}/%{name}
  148. %doc %{_docdir}/%{name}/LICENSE.md
  149. %doc %{_docdir}/%{name}/README.md
  150. %{_bindir}/sfdoc
  151. %{_bindir}/sfpath
  152. %{_datadir}/%{name}/shellfu.sh
  153. %files bash
  154. %dir %{_datadir}/%{name}/include-bash
  155. %files bash-arr
  156. %{_datadir}/%{name}/include-bash/arr.sh
  157. %files bash-inigrep
  158. %{_datadir}/%{name}/include-bash/inigrep.sh
  159. %files bash-pretty
  160. %{_datadir}/%{name}/include-bash/_pretty_color.sh
  161. %{_datadir}/%{name}/include-bash/_pretty_forcecolor.sh
  162. %{_datadir}/%{name}/include-bash/_pretty_html.sh
  163. %{_datadir}/%{name}/include-bash/_pretty_journald.sh
  164. %{_datadir}/%{name}/include-bash/_pretty_notify.sh
  165. %{_datadir}/%{name}/include-bash/_pretty_plain.sh
  166. %{_datadir}/%{name}/include-bash/pretty.sh
  167. %files bash-sfdoc
  168. %{_datadir}/%{name}/include-bash/sfdoc.sh
  169. %files bash-sfpi
  170. %{_datadir}/%{name}/include-bash/sfpi.sh
  171. %files devel
  172. %{_bindir}/sfembed
  173. %files sh
  174. %dir %{_datadir}/%{name}/include-sh
  175. %files sh-charmenu
  176. %{_datadir}/%{name}/include-sh/charmenu.sh
  177. %files sh-coerce
  178. %{_datadir}/%{name}/include-sh/coerce.sh
  179. %files sh-exit
  180. %{_datadir}/%{name}/include-sh/exit.sh
  181. %files sh-isa
  182. %{_datadir}/%{name}/include-sh/isa.sh
  183. %files sh-mdfmt
  184. %{_datadir}/%{name}/include-sh/mdfmt.sh
  185. %files sh-termcolors
  186. %{_datadir}/%{name}/include-sh/termcolors.sh
  187. %changelog
  188. # specfile built with MKit __MKIT_MKIT_VERSION__