Este contenido no está disponible en el idioma seleccionado.
4.3. Extending the ruby193 and ruby200 Software Collections
In Red Hat Software Collections 1.2 Beta, it is possible to extend the ruby193 and ruby200 Software Collections by adding dependent packages. The Ruby on Rails 4.0 (ror40) Software Collection, which is built on top of Ruby 2.0.0 provided by the ruby200 Software Collection, is one example of such an extension.
This section provides detailed information about the ror40 metapackage and the ror40-rubygem-bcrypt-ruby package, which are both part of the ror40 Software Collection.
4.3.1. The ror40 Software Collection Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
This section contains a commented example of the Ruby on Rails 4.0 metapackage for the ror40 Software Collection. The ror40 Software Collection depends on the ror200 Software Collection.
Note the following in the ror40 Software Collection spec file example:
- The ror40 Software Collection spec file has the following build dependencies set:
BuildRequires: %{scl_prefix_ruby}scldevel BuildRequires: %{scl_prefix_ruby}rubygems-devel
BuildRequires: %{scl_prefix_ruby}scldevel BuildRequires: %{scl_prefix_ruby}rubygems-devel
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This expands to, for example, ruby200-scldevel and ruby200-rubygems-devel.The ruby200-scldevel subpackage contains two important macros,%scl_ruby
and%scl_prefix_ruby
. The ruby200-scldevel subpackage should be available in the build root. It specifies which of the available Ruby Software Collections you want to use. You can also replace it with the ruby193-scldevel subpackage.Note that the%scl_ruby
and%scl_prefix_ruby
macros are also defined at the top of the spec file. Although the definitions are not required, they provide a visual hint that the ror40 Software Collection has been designed to be built on top of the ruby200 Software Collection. They also serve as a fallback value. - The ror40-runtime subpackage must depend on the runtime subpackage of the Software Collection it depends on. This dependency is specified as follows:
%package runtime Requires: %{scl_prefix_ruby}runtime
%package runtime Requires: %{scl_prefix_ruby}runtime
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This expands to ruby200-runtime in the case of the ruby200 Software Collection, and to ruby193-runtime in the case when the package is built against the ruby193 Software Collection. - The ror40-build subpackage must depend on the scldevel subpackage of the Software Collection it depends on. This is to ensure that all other packages of this Software Collection will have the same macros defined, thus it is built against the same Ruby version.
%package build Requires: %{scl_prefix_ruby}scldevel
%package build Requires: %{scl_prefix_ruby}scldevel
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the case of the ruby200 Software Collection, this expands to ruby200-scldevel. - The
enable
scriptlet for the ror40 Software Collection contains the following line:. scl_source enable %{scl_ruby}
. scl_source enable %{scl_ruby}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note the dot at the beginning of the line. This line makes the Ruby Software Collection start implicitly when the ror40 Software Collection is started so that the user can only typescl enable ror40 command
instead ofscl enable ruby200 ror40 command
to run command in the Software Collection environment. - The ror40-scldevel subpackage is provided so that it is available in case you need it to build a Software Collection which extends the ror40 Software Collection. The package provides the
%{scl_ror}
and%{scl_prefix_ror}
macros, which can be used to extend the ror40 Software Collection. - Because the ror40 Software Collection's gems are installed in a separate root directory structure, you need to ensure that the correct ownership for the rubygems directories is set. This is done by using a snippet to generate a file list rubygems_filesystem.list.You are advised to set the runtime package to own all directories which would, if located in the root file system, be owned by another package. One example of such directories in the case of the ror40 Software Collection is the Rubygem directory structure.