Ask Your Question
0

Building RPM file for Unix RuneScape Client: nothing provides Perl(JSON::backportPP)

asked 2017-01-01 23:52:12 -0600

updated 2017-01-02 00:13:15 -0600

I have been building an RPM file for this program and while for the most part this spec file works:

Name:          unix-runescape-client
Version:       4.3.5
Release:       1
License:       GPL-2.0
Summary:       A lightweight wrapper for the legacy Java client of RuneScape
Group:         Amusements/Games
Packager:      Brenton Horne
Source:        https://github.com/HikariKnight/rsu-client/archive/v%{version}.tar.gz
Requires:      perl perl(List::MoreUtils) perl(Config::IniFiles) perl(Archive::Extract) perl-Wx java-1.8.0-openjdk

%description
The Unix RuneScape Client developed by HikariKnight on GitHub. It is an
open-source wrapper for the old legacy Java client of RuneScape.

%prep
%setup -q -n rsu-client-%{version}

%install
_instdir=%{buildroot}/usr/share/runescape
cd runescape

mkdir -p "$_instdir" "%{buildroot}"/usr/{bin,share/applications}

# copy the stuff
cp -t "$_instdir" *.txt runescape updater rsu-settings AUTHORS
cp -Rt "$_instdir" share rsu
cp -Rt %{buildroot}/usr/bin templates/packaging/usr/games/*
cp -Rt %{buildroot}/usr templates/packaging/usr/share

# these libraries are old, and they are not needed anymore with current cairo
rm -rf "$_instdir"/rsu/3rdParty/linux/cairo-nogl

%files
%{_datadir}/applications/runescape*.desktop
%{_datadir}/runescape/*
%{_datadir}/kde4/services/jagex-jav.protocol
%{_bindir}/runescape*
%{_bindir}/rsu-settings
%{_bindir}/update-runescape-client

in building an RPM file whenever I try to install this RPM file I get the error:

Last metadata expiration check: 0:35:12 ago on Mon Jan  2 15:10:06 2017.
Error: nothing provides perl(JSON::backportPP) needed by unix-runescape-client-4.3.5-1.x86_64
(try to add '--allowerasing' to command line to replace conflicting packages)

installing with the --allowerasing option fails to fix this error. I searched for perl(JSON::backportPP) using good old Google to find that for Mageia, at least, perl-JSON provides this requirement, so I ran sudo dnf install -y perl-JSON only to find that perl-JSON was already installed... I also tried adding the perl-JSON dependency to the aforementioned spec file and rebuilding the RPM package but that too failed to fix this dependency issue.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2017-01-02 03:41:49 -0600

I've found the solution. Merely adding the line:

Provides: perl(JSON::backportPP)

to the spec fixes the problem. Here is my present spec file:

Name:          unix-runescape-client
Version:       4.3.5
Release:       1
License:       GPL-2.0
Summary:       A lightweight wrapper for the legacy Java client of RuneScape
Group:         Amusements/Games
Packager:      Brenton Horne
Url:           https://github.com/HikariKnight/rsu-client
Source:        https://github.com/HikariKnight/rsu-client/archive/v%{version}.tar.gz
Requires:      perl perl(List::MoreUtils) perl(Config::IniFiles) perl(Archive::Extract) perl-Wx java-1.8.0-openjdk
Provides:      unix-runescape-client
Provides:      perl(JSON::backportPP)

%description
The Unix RuneScape Client developed by HikariKnight on GitHub. It is an
open-source wrapper for the old legacy Java client of RuneScape.

%prep
%setup -q -n rsu-client-%{version}

%install
_instdir=%{buildroot}/usr/share/runescape
cd runescape

mkdir -p "$_instdir" "%{buildroot}"/usr/{bin,share/{applications,pixmaps}}

# copy the stuff
cp -t "$_instdir" *.txt runescape updater rsu-settings AUTHORS
cp -Rt "$_instdir" share rsu
cp -Rt %{buildroot}/usr/bin templates/packaging/usr/games/*
cp -Rt %{buildroot}/usr templates/packaging/usr/share

# these libraries are old, and they are not needed anymore with current cairo
rm -rf "$_instdir"/rsu/3rdParty/linux/cairo-nogl

sed -i -e 's|/opt/runescape/share/img/runescape.png|runescape|g' %{buildroot}/usr/share/applications/*.desktop
sed -i -e 's|/opt/runescape||g' %{buildroot}/usr/{bin/*,share/applications/*.desktop,share/runescape/*.txt}
mv %{buildroot}/usr/share/runescape/share/img/runescape* %{buildroot}/usr/share/pixmaps
rm -rf %{buildroot}/usr/share/runescape/share/img/

%files
%{_datadir}/applications/runescape*.desktop
%{_datadir}/runescape/*
%{_datadir}/kde4/services/jagex-jav.protocol
%{_datadir}/pixmaps/*
%{_bindir}/runescape*
%{_bindir}/rsu-settings
%{_bindir}/update-runescape-client
edit flag offensive delete link more
1

answered 2017-01-02 02:35:19 -0600

geforce gravatar image

You will need to patch the source

$ grep backportPP -r
runescape/rsu/framework/Perl5lib/JSON.pm:my $Module_bp  = 'JSON::backportPP'; # included in JSON distribution
runescape/rsu/framework/Perl5lib/JSON.pm:    elsif ($backend eq 'JSON::backportPP') {
runescape/rsu/framework/Perl5lib/JSON.pm:            local $^W; # if PP installed but invalid version, backportPP redefines methods.
runescape/rsu/framework/Perl5lib/JSON.pm:        _set_module( $JSON::Backend = $Module_PP ); # even if backportPP, set $Backend with 'JSON::PP'
runescape/rsu/framework/Perl5lib/JSON.pm:Instead, the C<JSON> distribution will include JSON::backportPP
runescape/rsu/framework/Perl5lib/JSON.pm:=item PERL_JSON_BACKEND = 'JSON::backportPP'
runescape/rsu/framework/Perl5lib/JSON.pm:Always use JSON::backportPP.
runescape/rsu/framework/Perl5lib/JSON.pm:JSON::backportPP is JSON::PP back port module.
runescape/rsu/framework/Perl5lib/JSON.pm:C<JSON> includes JSON::backportPP instead of JSON::PP.
runescape/rsu/framework/Perl5lib/JSON/backportPP.pm:package # This is JSON::backportPP
runescape/rsu/framework/Perl5lib/JSON/backportPP.pm:        my $helper = $] >= 5.006 ? 'JSON::backportPP::Compat5006' : 'JSON::backportPP::Compat5005';
runescape/rsu/framework/Perl5lib/JSON/backportPP/Compat5006.pm:package # This is JSON::backportPP
runescape/rsu/framework/Perl5lib/JSON/backportPP/Compat5006.pm:    JSON::backportPP56;
runescape/rsu/framework/Perl5lib/JSON/backportPP/Boolean.pm:use JSON::backportPP ();
runescape/rsu/framework/Perl5lib/JSON/backportPP/Compat5005.pm:package # This is JSON::backportPP
runescape/rsu/framework/Perl5lib/JSON/backportPP/Compat5005.pm:    JSON::backportPP5005;
edit flag offensive delete link more

Comments

How? I'm not all that accustom with patches or Perl. Would I have to delete all references to JSON::backportPP in those .pm files?

Brenton Horne gravatar imageBrenton Horne ( 2017-01-02 02:41:33 -0600 )edit

I've installed the Unix RuneScape Client using its universal installer and it runs fine so this is really just a packaging issue. I think if I can get the spec file to ignore this detected dependency it will work.

Brenton Horne gravatar imageBrenton Horne ( 2017-01-02 03:26:30 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-01-01 23:52:12 -0600

Seen: 273 times

Last updated: Jan 02 '17