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

template.spec 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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-inigrep
  37. Summary: INI grepping Shellfu/Bash module
  38. Requires: perl
  39. Requires: shellfu-bash
  40. Requires: shellfu-bash-pretty
  41. Obsoletes: shellfu-bash-extras < 0.10
  42. %description bash-inigrep
  43. This sub-package contains 'inigrep', Shellfu/Bash module for reading
  44. INI-like files.
  45. %package bash-pretty
  46. Summary: Logging Shellfu/Bash module
  47. Requires: shellfu-bash
  48. Requires: shellfu-sh-exit
  49. Requires: shellfu-sh-termcolors
  50. Obsoletes: shellfu-bash-core < 0.10
  51. %description bash-pretty
  52. This sub-package contains 'pretty', universal Shellfu logging module.
  53. %package bash-sfdoc
  54. Summary: Shellfu/Bash module to export docs from Shellfu modules
  55. Requires: perl
  56. Requires: shellfu-bash
  57. Requires: shellfu-bash-pretty
  58. %description bash-sfdoc
  59. This sub-package contains Shellfu/Bash module to export documentation
  60. from other Shellfu modules that follow Shellfu coding style.
  61. %package bash-sfpi
  62. Summary: Shellfu/Bash plugin interface
  63. Requires: shellfu-bash
  64. Requires: shellfu-bash-sfdoc
  65. Requires: shellfu-bash-pretty
  66. %description bash-sfpi
  67. This sub-package contains Shellfu/Bash module to help manage, discover,
  68. select and load other Shellfu modules as plugins.
  69. %package devel
  70. Summary: Essential developer tools
  71. Requires: shellfu-bash-pretty
  72. %description devel
  73. This sub-package contains tools useful mostly for development of shellfu
  74. scripts.
  75. %package sh
  76. Summary: Generic base
  77. Requires: shellfu
  78. %description sh
  79. This sub-package contains POSIX-oriented parts of library infrastructure.
  80. Generic Shellfu modules aiming for POSIX compatibility should depend on this.
  81. %package sh-charmenu
  82. Summary: Shellfu/sh module for building interactive terminal menus
  83. Requires: shellfu-sh
  84. Obsoletes: shellfu-bash-extras < 0.10
  85. %description sh-charmenu
  86. This sub-package contains 'charmenu', a Shellfu/sh module for building
  87. interactive terminal menus
  88. %package sh-coerce
  89. Summary: Shellfu/sh module with data coercion helpers
  90. Requires: perl
  91. %if %{legacy} == "false"
  92. Requires: perl-Term-ANSIColor
  93. %endif
  94. Requires: shellfu-sh
  95. %description sh-coerce
  96. This sub-package contains 'coerce', Shellfu module containing few
  97. data coercion helpers.
  98. %package sh-exit
  99. Summary: Shellfu/sh module for standard exit statuses
  100. Requires: shellfu-sh
  101. Obsoletes: shellfu-bash-core < 0.10
  102. %description sh-exit
  103. This sub-package contains 'exit', Shellfu module containing functions
  104. and variables for standard exit statuses.
  105. %package sh-isa
  106. Summary: Shellfu/sh module with validation helpers
  107. Requires: shellfu-sh
  108. %description sh-isa
  109. This sub-package contains 'isa', Shellfu module containing few
  110. value validation helpers.
  111. %package sh-mdfmt
  112. Summary: Markdown formatting helper
  113. Requires: shellfu-sh
  114. %description sh-mdfmt
  115. This sub-package contains Markdown formatting helper, a function that
  116. helps you generate Markdown paragraph elements from your shell scripts.
  117. %package sh-termcolors
  118. Summary: Shellfu/sh module for terminal color names
  119. Requires: shellfu-sh
  120. Obsoletes: shellfu-bash-core < 0.10
  121. %description sh-termcolors
  122. This sub-package contains 'termcolors', Shellfu module containing most
  123. common ANSI color names.
  124. %prep
  125. %setup -q
  126. /bin/sed -i '/^__COERCE__LEGACY=/s/:-false/:-%{legacy}/' ./src/include-sh/coerce.sh
  127. %build
  128. make %{?_smp_mflags} PREFIX=/usr
  129. %install
  130. %make_install PREFIX=/usr
  131. %check
  132. make test \
  133. PATH=%{buildroot}/%{_bindir}:$PATH \
  134. SHELLFU_INCLUDE=%{buildroot}/%{_datadir}/%{name}/include \
  135. SHELLFU_DIR=%{buildroot}/%{_datadir}/%{name}
  136. %files
  137. %config %{_sysconfdir}/bash_completion.d/%{name}.bash
  138. %dir %{_datadir}/%{name}
  139. %dir %{_docdir}/%{name}
  140. %doc %{_docdir}/%{name}/LICENSE.md
  141. %doc %{_docdir}/%{name}/README.md
  142. %{_bindir}/sfdoc
  143. %{_bindir}/sfpath
  144. %{_datadir}/%{name}/shellfu.sh
  145. %files bash
  146. %dir %{_datadir}/%{name}/include-bash
  147. %files bash-inigrep
  148. %{_datadir}/%{name}/include-bash/inigrep.sh
  149. %files bash-pretty
  150. %{_datadir}/%{name}/include-bash/_pretty_color.sh
  151. %{_datadir}/%{name}/include-bash/_pretty_html.sh
  152. %{_datadir}/%{name}/include-bash/_pretty_journald.sh
  153. %{_datadir}/%{name}/include-bash/_pretty_notify.sh
  154. %{_datadir}/%{name}/include-bash/_pretty_plain.sh
  155. %{_datadir}/%{name}/include-bash/pretty.sh
  156. %files bash-sfdoc
  157. %{_datadir}/%{name}/include-bash/sfdoc.sh
  158. %files bash-sfpi
  159. %{_datadir}/%{name}/include-bash/sfpi.sh
  160. %files devel
  161. %{_bindir}/sfembed
  162. %files sh
  163. %dir %{_datadir}/%{name}/include-sh
  164. %files sh-charmenu
  165. %{_datadir}/%{name}/include-sh/charmenu.sh
  166. %files sh-coerce
  167. %{_datadir}/%{name}/include-sh/coerce.sh
  168. %files sh-exit
  169. %{_datadir}/%{name}/include-sh/exit.sh
  170. %files sh-isa
  171. %{_datadir}/%{name}/include-sh/isa.sh
  172. %files sh-mdfmt
  173. %{_datadir}/%{name}/include-sh/mdfmt.sh
  174. %files sh-termcolors
  175. %{_datadir}/%{name}/include-sh/termcolors.sh
  176. %changelog
  177. # specfile built with MKit __MKIT_SELF_VERSION__