Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating Source1 with comment lines #111

Closed
junaruga opened this issue May 24, 2022 · 5 comments
Closed

Generating Source1 with comment lines #111

junaruga opened this issue May 24, 2022 · 5 comments

Comments

@junaruga
Copy link
Contributor

I think the following tips, and the lines to create an archive file for test files is great that is used on this PR https://src.fedoraproject.org/rpms/rubygem-pg/pull-request/9 . And I want to see the lines are auto-generated by gem2rpm for more people to know the tips.

# git clone --no-checkout https://github.com/ged/ruby-pg.git
# git -C ruby-pg archive -v -o pg-1.3.5-spec.tar.gz v1.3.5 spec/
Source1: %{gem_name}-%{version}-spec.tar.gz

I want to see the following kind of lines are generated by gem2rpm. In my rough idea, the lines can be added like this to templates/fedora-27-rawhide.spec.erb by given <repository_url>.

The steps might be

  1. Run gem2rpm <gem file>.
  2. The gem2rpm get metadata from the given gemspec (e.g. pg.gemspec) or Gem lib.
  3. Get spec.metadata["source_code_uri"] as repository_url.
  4. Get repository_dir_name from repository_url.
  5. Assume test_dir_name (= test or spec) from *.gemspec spec.files.
  6. Print following lines with the values in the fedora-27-rawhide.spec.erb.
# git clone --no-checkout <repository_url>
# git -C <repository_dir_name> archive -v -o %{gem_name}-%{version}-<test_dir_name>.tar.gz v%{version} <test_dir_name>/
Source1: %{gem_name}-%{version}-<test_dir_name>.tar.gz
@voxik
Copy link
Member

voxik commented May 24, 2022

I am not against this idea. However, it should be somehow linked to heuristics that the test suite is actually excluded. Also, bonus points for checking that there is actually some test suite available upstream.

But on this place, I should also note that gem2rpm should not become slow due to extensive heuristics and checks.

BTW, thinking more about this, gem2rpm could even generate the tarball, right? ;)

@junaruga
Copy link
Contributor Author

junaruga commented May 24, 2022

BTW, thinking more about this, gem2rpm could even generate the tarball, right? ;)

The auto generation is also great. ^^

@pvalena
Copy link
Contributor

pvalena commented Jun 28, 2022

I am not against this idea. However, it should be somehow linked to heuristics that the test suite is actually excluded. Also, bonus points for checking that there is actually some test suite available upstream.

But on this place, I should also note that gem2rpm should not become slow due to extensive heuristics and checks.

BTW, thinking more about this, gem2rpm could even generate the tarball, right? ;)

What a fun idea! Although it is generic problem, so it might be better to call other tool; and not duplicate the implementation

@pvalena
Copy link
Contributor

pvalena commented Jun 28, 2022

I do intend to (at least) create a template + probably some gem2rpm library addition to generate all this.

Let me know if you're interested to collaborate.

@voxik
Copy link
Member

voxik commented Aug 5, 2022

Grooming the backlog a bit, it turns out this is duplicate of #102, therefore I am closing this ticket.

@voxik voxik closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants