Package yarn should be noarch

I have taken the source RPM and rebuilt it on my SLES 12 system.
https://build.opensuse.org/package/show/Virtualization%3Acontainers%3APortus/yarn

Why doesn’t OpenSUSE build this as an noarch package.
After bulding the RPM there is over 17000 files, while the RPM built by yarn themself have only 13 files.

https://github.com/yarnpkg/yarn/releases/download/v1.4.1/yarn-v1.4.1.tar.gz
https://github.com/yarnpkg/yarn/releases/download/v1.4.1/yarn-1.4.1-1.noarch.rpm

rpm -qlp yarn-1.4.1-1.noarch.rpm


/usr/bin/yarn
/usr/bin/yarnpkg
/usr/share/doc/yarn/copyright
/usr/share/yarn/LICENSE
/usr/share/yarn/README.md
/usr/share/yarn/bin/yarn
/usr/share/yarn/bin/yarn.cmd
/usr/share/yarn/bin/yarn.js
/usr/share/yarn/bin/yarnpkg
/usr/share/yarn/bin/yarnpkg.cmd
/usr/share/yarn/lib/cli.js
/usr/share/yarn/lib/v8-compile-cache.js
/usr/share/yarn/package.json

On Wed 31 Jan 2018 09:56:02 AM CST, DJViking wrote:

I have taken the source RPM and rebuilt it on my SLES 12 system.
http://tinyurl.com/yaot2rqy
yaot2rqy ->
https://build.opensuse.org/package/show/Virtualization%3Acontainers%3APortus/yarn

Why doesn’t OpenSUSE build this as an noarch package.
After bulding the RPM there is over 17000 files, while the RPM built by
yarn themself have only 13 files.

http://tinyurl.com/y8fe73hn
y8fe73hn ->
https://github.com/yarnpkg/yarn/releases/download/v1.4.1/yarn-v1.4.1.tar.gz
http://tinyurl.com/ybvak3nl ybvak3nl ->
https://github.com/yarnpkg/yarn/releases/download/v1.4.1/yarn-1.4.1-1.noarch.rpm

rpm -qlp yarn-1.4.1-1.noarch.rpm

Code:

/usr/bin/yarn
/usr/bin/yarnpkg
/usr/share/doc/yarn/copyright
/usr/share/yarn/LICENSE
/usr/share/yarn/README.md
/usr/share/yarn/bin/yarn
/usr/share/yarn/bin/yarn.cmd
/usr/share/yarn/bin/yarn.js
/usr/share/yarn/bin/yarnpkg
/usr/share/yarn/bin/yarnpkg.cmd
/usr/share/yarn/lib/cli.js
/usr/share/yarn/lib/v8-compile-cache.js
/usr/share/yarn/package.json


Hi
Because the package maintainers copy all the libs/modules etc over, see
line 62 of the spec file;
https://build.opensuse.org/package/view_file/Virtualization:containers:Portus/yarn/yarn.spec?expand=1

Having the libs == arch dependent.


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE Leap 42.3|GNOME 3.20.2|4.4.104-39-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

So I can build the same RPM by removing line 62 and get a noarch package.

Hi
No since it’s linking files that it copies into the lib dir, you would just need to copy the yarn.js files over to /usr/bin and soft link and fix up the %files section.

If you do that then you would also need to add the following line after BuildRoot:;


BuildArch: noarch

But what’s wrong with the package as it stands?

Nothing, but 17000 files… unnecessary big. Yarn itself is much smaller.

We need to provide yarn with our SLES12 and those 2 Fedora people in my company complains about the complexity of SUSE yarn package compared to the one from Fedora.

Hi
Since it contains supporting files, do the Fedora users need to install additional packages for things to work?

Probably yes. Not sure, have to check with them tomorrow.

Seems the supporting files are downloaded/installed using yarn itself.
Running yarn install fetches the necessary packages and stores it under node_modules/ in the project directory.

Hi
So one way or the other the files arrive… openSUSE maintainers have just decided to include…
Perhaps even a little bit more secure since it comes as a complete package from source…

The packages are fetched from Yarn registry, which we are using Sonatype Nexus to cache