0

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 (source: ftp://www.rpmfind.net/linux/RPM/mageia/cauldron/i586/media/core/release/perl-JSON-2.900.0-5.mga6.noarch.html), so I ran sudo dnf install -y perl-JSON (if relevant I am operating on Fedora 25) 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.

I have installed this client using the universal installer and it runs fine so I know that perl(JSON:backportPP) isn't really required to run it...

1 Answer 1

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .