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

template.spec 6.4KB

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