Hi guys,
For a long time, I thought that it would be interesting to have .gem expansion support in %setup macro. This would simply our .spec files a bit. Finally, I gave a go to this idea and proposed this to RPM upstream [1]. Please let me know (preferably via the PR) if you can foresee any issues with this approach.
Thanks.
Vít
On Tue, Nov 10, 2015 at 8:52 AM, Vít Ondruch vondruch@redhat.com wrote:
Hi guys,
For a long time, I thought that it would be interesting to have .gem expansion support in %setup macro. This would simply our .spec files a bit. Finally, I gave a go to this idea and proposed this to RPM upstream [1]. Please let me know (preferably via the PR) if you can foresee any issues with this approach.
Thanks.
Vít
[1] https://github.com/rpm-software-management/rpm/pull/27 _______________________________________________ ruby-sig mailing list ruby-sig@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/ruby-sig
Hi Vit, I think this is a great idea. Since the instructions for prep of rubygems have settled down for a couple years I think now is the time to do it.
I do have one question. If I am reading the code right you have the equivalent of {gem unpack} SOURCE0 && gem spec SOURCE0 --ruby > {gem_name}.gemspec
Why aren't you using the -l in the gem spec portion? Shouldn't it be
{gem unpack} SOURCE0 && gem spec SOURCE0 -l --ruby > {gem_name}.gemspec
Troy
Dne 10.11.2015 v 16:09 Troy Dawson napsal(a):
On Tue, Nov 10, 2015 at 8:52 AM, Vít Ondruch <vondruch@redhat.com mailto:vondruch@redhat.com> wrote:
Hi guys, For a long time, I thought that it would be interesting to have .gem expansion support in %setup macro. This would simply our .spec files a bit. Finally, I gave a go to this idea and proposed this to RPM upstream [1]. Please let me know (preferably via the PR) if you can foresee any issues with this approach. Thanks. Vít [1] https://github.com/rpm-software-management/rpm/pull/27 _______________________________________________ ruby-sig mailing list ruby-sig@lists.fedoraproject.org <mailto:ruby-sig@lists.fedoraproject.org> https://admin.fedoraproject.org/mailman/listinfo/ruby-sig
Hi Vit, I think this is a great idea. Since the instructions for prep of rubygems have settled down for a couple years I think now is the time to do it.
I do have one question. If I am reading the code right you have the equivalent of {gem unpack} SOURCE0 && gem spec SOURCE0 --ruby > {gem_name}.gemspec
Why aren't you using the -l in the gem spec portion? Shouldn't it be
{gem unpack} SOURCE0 && gem spec SOURCE0 -l --ruby > {gem_name}.gemspec
Troy
Thank you, that is a good point. I omitted it just by accident. On the other hand, what is the practical difference? Not sure. I should probably dive a bit into RubyGems code.
Vít
Dne 10.11.2015 v 17:35 Vít Ondruch napsal(a):
Dne 10.11.2015 v 16:09 Troy Dawson napsal(a):
On Tue, Nov 10, 2015 at 8:52 AM, Vít Ondruch <vondruch@redhat.com mailto:vondruch@redhat.com> wrote:
Hi guys, For a long time, I thought that it would be interesting to have .gem expansion support in %setup macro. This would simply our .spec files a bit. Finally, I gave a go to this idea and proposed this to RPM upstream [1]. Please let me know (preferably via the PR) if you can foresee any issues with this approach. Thanks. Vít [1] https://github.com/rpm-software-management/rpm/pull/27 _______________________________________________ ruby-sig mailing list ruby-sig@lists.fedoraproject.org <mailto:ruby-sig@lists.fedoraproject.org> https://admin.fedoraproject.org/mailman/listinfo/ruby-sig
Hi Vit, I think this is a great idea. Since the instructions for prep of rubygems have settled down for a couple years I think now is the time to do it.
I do have one question. If I am reading the code right you have the equivalent of {gem unpack} SOURCE0 && gem spec SOURCE0 --ruby > {gem_name}.gemspec
Why aren't you using the -l in the gem spec portion? Shouldn't it be
{gem unpack} SOURCE0 && gem spec SOURCE0 -l --ruby > {gem_name}.gemspec
Troy
Thank you, that is a good point. I omitted it just by accident. On the other hand, what is the practical difference? Not sure. I should probably dive a bit into RubyGems code.
The -l aka --local is in default option set:
Defaults: --local --version '>= 0' --yaml
Not sure what would be the advantage to put the -l there explicitly. Lets keep it without -l.
Vít
Dne 10.11.2015 v 15:52 Vít Ondruch napsal(a):
Hi guys,
For a long time, I thought that it would be interesting to have .gem expansion support in %setup macro. This would simply our .spec files a bit. Finally, I gave a go to this idea and proposed this to RPM upstream [1]. Please let me know (preferably via the PR) if you can foresee any issues with this approach.
Thanks.
Vít
Just as an example, this would be the .spec file difference for rubygem-sqlite3:
$ git diff diff --git a/rubygem-sqlite3.spec b/rubygem-sqlite3.spec index 5f98c93..a2df0cd 100644 --- a/rubygem-sqlite3.spec +++ b/rubygem-sqlite3.spec @@ -34,15 +34,12 @@ BuildArch: noarch Documentation for %{name}
%prep -gem unpack %{SOURCE0} -%setup -q -D -T -n %{gem_name}-%{version} +%setup -q -n %{gem_name}-%{version}
%patch0 -p1
-gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec - %build -gem build %{gem_name}.gemspec +gem build ../%{gem_name}-%{version}.gemspec %gem_install
%install
Dne 10.11.2015 v 17:31 Vít Ondruch napsal(a):
Dne 10.11.2015 v 15:52 Vít Ondruch napsal(a):
Hi guys,
For a long time, I thought that it would be interesting to have .gem expansion support in %setup macro. This would simply our .spec files a bit. Finally, I gave a go to this idea and proposed this to RPM upstream [1]. Please let me know (preferably via the PR) if you can foresee any issues with this approach.
Thanks.
Vít
Just as an example, this would be the .spec file difference for rubygem-sqlite3:
$ git diff diff --git a/rubygem-sqlite3.spec b/rubygem-sqlite3.spec index 5f98c93..a2df0cd 100644 --- a/rubygem-sqlite3.spec +++ b/rubygem-sqlite3.spec @@ -34,15 +34,12 @@ BuildArch: noarch Documentation for %{name}
%prep -gem unpack %{SOURCE0} -%setup -q -D -T -n %{gem_name}-%{version} +%setup -q -n %{gem_name}-%{version}
%patch0 -p1
-gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%build -gem build %{gem_name}.gemspec +gem build ../%{gem_name}-%{version}.gemspec %gem_install
%install
And I forgot to add that one of advantages I see is that in contrast to current guidelines, the .gemspec is created on the same level as the unpacked directory and this avoids overwriting of .gemspec in case it is shipped in the original package.
Vít
ruby-sig@lists.fedoraproject.org