Re: Help with rubygem packaging

2019-12-04 Thread Leigh Scott
> For linked-list,
> And you see the temp_dir rubygem dep is used for only
> spec/archive_spec.rb context "::load" and "#write!".
> 
> ```
> $ grep -r temp_dir spec/
> ```
> 
> spec/archive_spec.rb
> 
> ```

Thanks that fixes the %check
>   context "::load" do
> ...
>   end
> 
>   context "#write!" do
> ...
>   end
> ...
> ```
> 
> You can adapt the way to comment out the specific lines like this.
> 
> ```
> $ sed -i '/^  context "::load" do$/,/^  end$/ s/^/#/'
> spec/archive_spec.rb
> $ sed -i '/^  context "#write!" do$/,/^  end$/ s/^/#/'
> spec/archive_spec.rb
> ```
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: Help with rubygem packaging

2019-12-04 Thread Jun Aruga
For linked-list,

> + ruby -Ilib:. -e 'Dir.glob "test/**/test_*.rb", (:require)'
...
> 0 runs, 0 assertions, 0 failures, 0 errors, 0 skips
> + popd

"test/**/test_*.rb" you are using is incorrect in this case, and
different from the guideline. The test files were not captured..
"./test/**/*_test.rb" works possibly.

```
$ find . -name "test_*.rb"
./linked-list-0.0.13/test/test_helper.rb

$ find . -name "*_test.rb"
./linked-list-0.0.13/test/list_test.rb
./linked-list-0.0.13/test/node_test.rb
./linked-list-0.0.13/test/conversions_test.rb
```

For hrx,

> Looks like %check for hrx is a no go due to missing dep that isn't present in 
> the repo
>
> + pushd ./usr/share/gems/gems/hrx-1.0.0
> ~/rpmbuild/BUILD/hrx-1.0.0/usr/share/gems/gems/hrx-1.0.0 
> ~/rpmbuild/BUILD/hrx-1.0.0
> + ln -s /home/leigh/rpmbuild/BUILD/spec spec
> + rspec -rspec_helper spec
>
> An error occurred while loading ./spec/archive_spec.rb.
> Failure/Error: require 'rspec/temp_dir'

You see the missing dep 'rspec/temp_dir' is a testing dep.

```
$ cat hrx-1.0.0/Gemfile
...
gem "rspec-temp_dir", "~> 1.0", group: :test
```

We are trying to run a unit tests as much as possible, commenting out
or skipping the testing dep specific logic.
When you have %check section, I think that you feel more secure.

You learned commenting out not used dep like `sed -i '/bundler/
s/^/#/' Rakefile`.
You can adapt the way to this "rspec/temp_dir" case too like this.

```
$ sed -i "/require 'rspec\/temp_dir'/ s/^/#/" spec/archive_spec.rb
```

And you see the temp_dir rubygem dep is used for only
spec/archive_spec.rb context "::load" and "#write!".

```
$ grep -r temp_dir spec/
```

spec/archive_spec.rb

```
  context "::load" do
...
  end

  context "#write!" do
...
  end
...
```

You can adapt the way to comment out the specific lines like this.

```
$ sed -i '/^  context "::load" do$/,/^  end$/ s/^/#/' spec/archive_spec.rb
$ sed -i '/^  context "#write!" do$/,/^  end$/ s/^/#/' spec/archive_spec.rb
```

Or if the entire unit case does not work due to the missing testing
dep, you can just rename the test file to be skipped by rspec like
this.

```
$ mv spec/archive_spec.rb{,.disabled}
```

There is a good way to see all the RPM spec file easily. You can do
grep to see the examples.
(I think if this way is not documented, it is useful to be documented
somewhere in the guideline).

```
$ wget http://src.fedoraproject.org/repo/rpm-specs-latest.tar.xz

$ tar xvf rpm-specs-latest.tar.xz

$ ls rpm-specs/*.spec | wc -l
21514
```


-- 
Jun | He - His - Him
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: Help with rubygem packaging

2019-12-04 Thread Vít Ondruch

Dne 04. 12. 19 v 12:28 Vít Ondruch napsal(a):
> Dne 03. 12. 19 v 23:43 Leigh Scott napsal(a):
>> Thanks, I didn't know about gem2rpm.
>>
>> Reviews submitted (needed for sassc tests).
>
> Out of curiosity, where I can find the tests?

Answering to myself:

https://github.com/sass/sass-spec


Vít



>
>
> Vít
>
>
>> https://bugzilla.redhat.com/show_bug.cgi?id=1779403
>> https://bugzilla.redhat.com/show_bug.cgi?id=1779404
>> ___
>> devel mailing list -- devel@lists.fedoraproject.org
>> To unsubscribe send an email to devel-le...@lists.fedoraproject.org
>> Fedora Code of Conduct: 
>> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
>> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
>> List Archives: 
>> https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
> ___
> devel mailing list -- devel@lists.fedoraproject.org
> To unsubscribe send an email to devel-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: Help with rubygem packaging

2019-12-04 Thread Vít Ondruch

Dne 03. 12. 19 v 23:43 Leigh Scott napsal(a):
> Thanks, I didn't know about gem2rpm.
>
> Reviews submitted (needed for sassc tests).


Out of curiosity, where I can find the tests?


Vít


>
> https://bugzilla.redhat.com/show_bug.cgi?id=1779403
> https://bugzilla.redhat.com/show_bug.cgi?id=1779404
> ___
> devel mailing list -- devel@lists.fedoraproject.org
> To unsubscribe send an email to devel-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: Help with rubygem packaging

2019-12-03 Thread Leigh Scott
Thank you for the examples and hints

> 2. Adding %check section, as Jaroslav said.
> Note that we do not use "bundler" ("bundle" command) and
> "rake"
> command in RPM *.spec file.
> 
 I have removed bundler and rake from linked-list, the test doesn't seem to run 
anything

+ pushd ./usr/share/gems/gems/linked-list-0.0.13
~/rpmbuild/BUILD/linked-list-0.0.13/usr/share/gems/gems/linked-list-0.0.13 
~/rpmbuild/BUILD/linked-list-0.0.13
+ sed -i '/bundler/ s/^/#/' Rakefile
+ ruby -Ilib:. -e 'Dir.glob "test/**/test_*.rb", (:require)'
Run options: --seed 28775

# Running:



Fabulous run in 0.000872s, 0. runs/s, 0. assertions/s.

0 runs, 0 assertions, 0 failures, 0 errors, 0 skips
+ popd


> 3. Following *.spec files might be useful to refer.
> 
> https://src.fedoraproject.org/rpms/rubygem-listen/blob/master/f/rubygem-l...
>   with Ruby C-extention.
> https://src.fedoraproject.org/rpms/rubygem-rake/blob/master/f/rubygem-rak...
>   without Ruby C-extension.

Looks like %check for hrx is a no go due to missing dep that isn't present in 
the repo

+ pushd ./usr/share/gems/gems/hrx-1.0.0
~/rpmbuild/BUILD/hrx-1.0.0/usr/share/gems/gems/hrx-1.0.0 
~/rpmbuild/BUILD/hrx-1.0.0
+ ln -s /home/leigh/rpmbuild/BUILD/spec spec
+ rspec -rspec_helper spec

An error occurred while loading ./spec/archive_spec.rb.
Failure/Error: require 'rspec/temp_dir'
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: Help with rubygem packaging

2019-12-03 Thread Jun Aruga
> https://bugzilla.redhat.com/show_bug.cgi?id=1779403
> https://bugzilla.redhat.com/show_bug.cgi?id=1779404

I checked your uploaded *.spec files now a little bit.
I see that you are using "rake" in your rubygem-linked-list.spec,
and there is no %check section in your rubygem-hrx.spec.

> Note that we do not use "bundler" ("bundle" command) and "rake"
command in RPM *.spec file.

I am understanding that the reasons not using bundle and rake command
in the RPM *.spec file are

1. to simplify the build dependency tree.
2. to debug the unit tests easily if you face an issue in the unit test logic.
  "bundle" and "rake" sometimes make you harder to debug, as they have
their own issues.

So, referring the Ruby guideline page - minitest and rspec test cases,
your *.spec files could be like this.
https://docs.fedoraproject.org/en-US/packaging-guidelines/Ruby/#_testing_frameworks_usage


## rubygem-linked-list.spec

```
...
BuildRequires: rubygem(minitest)
...
%check
pushd .%{gem_instdir}
ruby -e 'Dir.glob "./test/**/*_test.rb", (:require)'
popd
```

## rubygem-hrx.spec

```
...
BuildRequires: rubygem(rspec)
...
%check
pushd .%{gem_instdir}
rspec -Ilib spec
popd
```


--
Jun | He - His - Him
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: Help with rubygem packaging

2019-12-03 Thread Jun Aruga
Hi Leigh,
Thank you for contributing the rubygem-* packages.

Let me comment for your *.spec files.

I recommend to compare the *.spec file generated by gem2rpm with your
*.spec file, and align basically.
The gem2rpm guides you.

How to do it (For example in case of Fedora 30)

```
$ sudo dnf install rubygem-gem2rpm

$ rpm -q rubygem-gem2rpm
rubygem-gem2rpm-1.0.1-3.fc30.noarch

$ gem fetch hrx

$ ls -l hrx-1.0.0.gem

$ gem2rpm hrx-1.0.0.gem > rubygem-hrx.spec
```

If you find some improvements for generated spec file, you can report it here.
https://github.com/fedora-ruby/gem2rpm

2. Adding %check section, as Jaroslav said.
Note that we do not use "bundler" ("bundle" command) and "rake"
command in RPM *.spec file.

3. Following *.spec files might be useful to refer.

https://src.fedoraproject.org/rpms/rubygem-listen/blob/master/f/rubygem-listen.spec
  with Ruby C-extention.
https://src.fedoraproject.org/rpms/rubygem-rake/blob/master/f/rubygem-rake.spec
  without Ruby C-extension.

"gem unpack" is useful to see the files in the *.gem file.
As hrx-1.0.0.gem and linked-list-0.0.13.gem are including the unit
test files in it,
Possibly "Source0" is good enough. Note above 2 *.spec files use
"Source1" too, as gem file does not include the unit test files.

```
$ gem unpack hrx-1.0.0.gem
Unpacked gem: '/home/jaruga/doc/memo/20191203_review_rubygem_pkgs/hrx-1.0.0'
```

Happy building!

--
Jun | He - His - Him
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: Help with rubygem packaging

2019-12-03 Thread Leigh Scott
Thanks, I didn't know about gem2rpm.

Reviews submitted (needed for sassc tests).

https://bugzilla.redhat.com/show_bug.cgi?id=1779403
https://bugzilla.redhat.com/show_bug.cgi?id=1779404
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: Help with rubygem packaging

2019-12-03 Thread Jaroslav Prokop

Hi,

great to see someone taking up on some rubygems!

to the packages, the rubygem-linked-list as mentioned by Fabio have 
binaries that will probably have name conflicts with some other packages.


Secondly rubygem-hrx should not have `Requires: rubygem(linked-list)`[0] 
because that dependency is automatically generated from package's 
gemspec. So rubygem-thor will get pulled in as well as a result.


I highly recommend running the test suite in %check section[1], since 
ruby cannot catch some basic stuff at compile time (because there is no 
compilation :) ) unlike with let's say Java.


Also I think you can submit package review requests with the state it is 
in and there we can help you with each package in their own bug threads, 
even if you have no experience.


Cheers,

Jarek


[0] 
https://docs.fedoraproject.org/en-US/packaging-guidelines/Ruby/#_rubygems


[1] 
https://docs.fedoraproject.org/en-US/packaging-guidelines/Ruby/#_running_test_suites


On 03/12/2019 19:08, Leigh Scott wrote:

Hi,

Can someone  check these specfiles before I submit review requests please?
I have zero experience with packaging rubygem packaes.

https://leigh123linux.fedorapeople.org/pub/SPECS/rubygem-hrx.spec
https://leigh123linux.fedorapeople.org/pub/SPECS/rubygem-linked-list.spec

Best regards
Leigh
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org

___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: Help with rubygem packaging

2019-12-03 Thread Fabio Valentini
On Tue, Dec 3, 2019 at 7:08 PM Leigh Scott  wrote:
>
> Hi,
>
> Can someone  check these specfiles before I submit review requests please?
> I have zero experience with packaging rubygem packaes.
>
> https://leigh123linux.fedorapeople.org/pub/SPECS/rubygem-hrx.spec
> https://leigh123linux.fedorapeople.org/pub/SPECS/rubygem-linked-list.spec
>
> Best regards
> Leigh

Hi Leigh,

Those two packages look like two pretty standard rubygem packages
(probably coming from manually sanitized gem2rpm output?).
The only strange things I see at first glance are the two binaries
that are shipped with linked-list: "setup" and "console" (and usually,
ruby scripts are copied to _bindir, not moved).
Are these binaries / scripts really necessary? The package will
conflict with some other, already existing fedora packages due to the
overly generic names for these binaries.

Fabio

> ___
> devel mailing list -- devel@lists.fedoraproject.org
> To unsubscribe send an email to devel-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Help with rubygem packaging

2019-12-03 Thread Leigh Scott
Hi,

Can someone  check these specfiles before I submit review requests please?
I have zero experience with packaging rubygem packaes.

https://leigh123linux.fedorapeople.org/pub/SPECS/rubygem-hrx.spec
https://leigh123linux.fedorapeople.org/pub/SPECS/rubygem-linked-list.spec

Best regards
Leigh
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org