README.md in gem2rpm-0.11.3 vs README.md in gem2rpm-1.0.0
- old
+ new
@@ -13,11 +13,11 @@
```
or download gem2rpm from Fedora repositories as RPM package:
```
-# yum install rubygem-gem2rpm
+# dnf install rubygem-gem2rpm
```
## Usage
Run `gem2rpm --help` to see all of the options.
@@ -39,12 +39,11 @@
```
$ gem2rpm --fetch GEM
```
-This will print an rpm spec file based on the information contained in the gem's spec file. In general, it is necessary to edit the generated spec file because the gem is missing some important information that is
-customarily provided in rpm's, most notably the license and the changelog.
+This will print an rpm spec file based on the information contained in the gem's spec file. In general, it is necessary to edit the generated spec file because the gem is missing some important information that is customarily provided in rpm's, most notably the license and the changelog.
Rather than editing the generated specfile, edit the template from which
the specfile is generated. This will make it easier to update the RPM when a new version of the Gem becomes available.
@@ -69,23 +68,29 @@
$ gem2rpm --templates
```
## Templates
-The template is a standard ERB file that comes with three main variables:
+The template is a standard ERB file that comes with several variables:
- `package` - the `Gem::Package` for the gem
- `spec` - the `Gem::Specification` for the gem (the same as `format.spec`)
- `config` - the `Gem2Rpm::Configuration` that can redefine default macros or rules used in `spec` template helpers
+- `runtime_dependencies` - the `Gem2Rpm::RpmDependencyList` providing list of package runtime dependencies
+- `development_dependencies` - the `Gem2Rpm::RpmDependencyList` providing list of package development dependencies
+- `tests` - the `Gem2Rpm::TestSuite` providing list of test frameworks allowing their execution
+- `files` - the `Gem2Rpm::RpmFileList` providing unfiltered list of files in package
+- `main_files` - the `Gem2Rpm::RpmFileList` providing list of files suitable for main package
+- `doc_files` - the `Gem2Rpm::RpmFileList` providing list of files suitable for -doc subpackage
The following variables still work, but are now deprecated:
- `format` - The `Gem::Format` for the gem. Please note that this is kept just for compatibility reasons, since RubyGems 2.0 removed this class.
### Template Configuration
-To make the templates lighter and more complete, Gem2Rpm introduced in version 0.11.0 new configurable `spec` helpers such as `spec.main_file_entries` or `spec.doc_file_entries` that can be further configured via local `config` variable as follows:
+To make the templates lighter and more complete, Gem2Rpm introduced in version 0.11.0 new configurable template variables such as `main_files` or `doc_files` that can be further configured via local `config` variable as follows:
```ruby
# Change macros for Vagrant packaging
config.macros[:instdir] = '%{vagrant_plugin_instdir}'
config.macros[:libdir] = '%{vagrant_plugin_libdir}'
@@ -103,18 +108,14 @@
> Gem2Rpm::Configuration::DEFAULT_RULES
```
## Conventions
-A typical source RPM for a gem should consist of three files: the gem file
-itself, the template for the spec file and the spec file. To ensure that
-the template will be included in the source RPM, it must be listed as one
-of the sources in the spec file.
+A typical source RPM for a gem should consist of two files: the gem file
+itself and the spec file.
The resulting RPMs should follow the naming convention 'rubygem-$GEM'
-where GEM is the name of the packaged gem. The default template also makes
-sure that the resulting package provides 'ruby($GEM)', according to general
-packaging conventions for scripting languages.
+where GEM is the name of the packaged gem.
## Limitations
Because of the differences between the two packaging schemes, it is impossible to come up with a completely automated way of doing the conversion, but the spec files produced by this package should be good enough for most pure-ruby gems.