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

Respect rubygem(package) form with custom gem package name prefix #585

Merged
merged 3 commits into from Dec 6, 2013

Conversation

@stepanstipl
Copy link
Contributor

stepanstipl commented Nov 15, 2013

Hi Jordan,
I'm using fpm (great tool btw!) for packaging GEMs -> RPMs with Red Hat Software Collections. The problem is that fpm does not respect the standard format rubygem(packagename) for requires/provides, if any other prefix than standard "rubygem" is used for gems naming. This should fix it and keep the bracketed form even when different prefix is used for naming, like --gem-package-name-prefix ruby193-rubygem for Red Hat SCLs.

Cheers .st

name, remainder = remainder.split(" ", 2)
# yield rubygem(name)...
"rubygem(#{name})#{remainder ? " #{remainder}" : ""}"
if name=/^(#{attributes[:gem_package_name_prefix]})-([^\s]+)\s*(.*)$/.match(provides)

This comment has been minimized.

Copy link
@jordansissel

jordansissel Nov 15, 2013

Owner

this code is hard to read :|

@neoice

This comment has been minimized.

Copy link

neoice commented Nov 27, 2013

I'm not using SCLs, but I am looking into deploying an in-house Ruby to /opt/ruby. it looks like this would be required to install gems via fpm+rpm into the correct /opt/ruby PATH.

@stepanstipl

This comment has been minimized.

Copy link
Contributor Author

stepanstipl commented Nov 28, 2013

SCLs worked quite well for me with fpm, this was the only major issue (just run scl enable ruby193 bash and do all packaging from there). This is not about path where you install, but about the naming. So this would be required if you want to use custom prefix for rubygems like myrubygem(rake) (which I would recommend in my experience, else you would get into dependency mess with packages from base).

@jordansissel

This comment has been minimized.

Copy link
Owner

jordansissel commented Dec 6, 2013

Testing -

% bin/fpm -fs gem -t rpm --gem-package-name-prefix fancypants rails
% rpm -qp fancypants-rails-4.0.2-1.noarch.rpm --provides
fancypants(rails) = 4.0.2
fancypants-rails = 4.0.2-1

I agree this is the desired behavior. Good work! :)

jordansissel added a commit that referenced this pull request Dec 6, 2013
Respect rubygem(package) form with custom gem package name prefix
@jordansissel jordansissel merged commit 7723482 into jordansissel:master Dec 6, 2013
jordansissel added a commit that referenced this pull request Dec 6, 2013
gerbercj pushed a commit to gerbercj/fpm that referenced this pull request Feb 27, 2014
gerbercj pushed a commit to gerbercj/fpm that referenced this pull request Mar 11, 2014
gerbercj pushed a commit to gerbercj/fpm that referenced this pull request Apr 25, 2014
jordansissel added a commit that referenced this pull request Jun 18, 2014
This should help folks who want the old-style gem-rpm conversions
* with this flag, old behavior: rubygem-name
* without flag, default behavior: rubygem(name)

The 'default' behavior has been this behavior since 0.4.23 for most
users.
If you changed the package name prefix via --gem-package-prefix or
--gem-package-name-prefix then this behavior was broken.
It was fixed in #585.

But, I don't want folks relying on old behavior to be screwed
when that behavior mysteriously vanishes! This should be a good
enough work around for now.

Reported by Ryan Doherty via the fpm-users mailing list.
prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 18, 2014
Respect rubygem(package) form with custom gem package name prefix
prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 18, 2014
prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 18, 2014
This should help folks who want the old-style gem-rpm conversions
* with this flag, old behavior: rubygem-name
* without flag, default behavior: rubygem(name)

The 'default' behavior has been this behavior since 0.4.23 for most
users.
If you changed the package name prefix via --gem-package-prefix or
--gem-package-name-prefix then this behavior was broken.
It was fixed in jordansissel#585.

But, I don't want folks relying on old behavior to be screwed
when that behavior mysteriously vanishes! This should be a good
enough work around for now.

Reported by Ryan Doherty via the fpm-users mailing list.
prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 27, 2014
Respect rubygem(package) form with custom gem package name prefix
prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 27, 2014
prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 27, 2014
This should help folks who want the old-style gem-rpm conversions
* with this flag, old behavior: rubygem-name
* without flag, default behavior: rubygem(name)

The 'default' behavior has been this behavior since 0.4.23 for most
users.
If you changed the package name prefix via --gem-package-prefix or
--gem-package-name-prefix then this behavior was broken.
It was fixed in jordansissel#585.

But, I don't want folks relying on old behavior to be screwed
when that behavior mysteriously vanishes! This should be a good
enough work around for now.

Reported by Ryan Doherty via the fpm-users mailing list.
jordansissel added a commit that referenced this pull request Apr 24, 2015
Respect rubygem(package) form with custom gem package name prefix
jordansissel added a commit that referenced this pull request Apr 24, 2015
jordansissel added a commit that referenced this pull request Apr 24, 2015
This should help folks who want the old-style gem-rpm conversions
* with this flag, old behavior: rubygem-name
* without flag, default behavior: rubygem(name)

The 'default' behavior has been this behavior since 0.4.23 for most
users.
If you changed the package name prefix via --gem-package-prefix or
--gem-package-name-prefix then this behavior was broken.
It was fixed in #585.

But, I don't want folks relying on old behavior to be screwed
when that behavior mysteriously vanishes! This should be a good
enough work around for now.

Reported by Ryan Doherty via the fpm-users mailing list.
jordansissel added a commit that referenced this pull request Jun 20, 2016
Respect rubygem(package) form with custom gem package name prefix
jordansissel added a commit that referenced this pull request Jun 20, 2016
jordansissel added a commit that referenced this pull request Jun 20, 2016
This should help folks who want the old-style gem-rpm conversions
* with this flag, old behavior: rubygem-name
* without flag, default behavior: rubygem(name)

The 'default' behavior has been this behavior since 0.4.23 for most
users.
If you changed the package name prefix via --gem-package-prefix or
--gem-package-name-prefix then this behavior was broken.
It was fixed in #585.

But, I don't want folks relying on old behavior to be screwed
when that behavior mysteriously vanishes! This should be a good
enough work around for now.

Reported by Ryan Doherty via the fpm-users mailing list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.