https://bugzilla.redhat.com/show_bug.cgi?id=1546459
Bug ID: 1546459 Summary: Review Request: svgo-inkscape - Extension to optimize SVG files for Inkscape Product: Fedora Version: rawhide Component: Package Review Severity: medium Priority: medium Assignee: nobody@fedoraproject.org Reporter: luya@fedoraproject.org QA Contact: extras-qa@fedoraproject.org CC: package-review@lists.fedoraproject.org
Spec URL: https://copr-be.cloud.fedoraproject.org/results/luya/svgo-inkscape/fedora-ra... SRPM URL: https://copr-be.cloud.fedoraproject.org/results/luya/svgo-inkscape/fedora-ra... Description: An extension to save and optimize SVG files with SVGO at Inkscape. Fedora Account System Username: luya
https://bugzilla.redhat.com/show_bug.cgi?id=1546459
Robert-André Mauchin zebob.m@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |zebob.m@gmail.com
--- Comment #1 from Robert-André Mauchin zebob.m@gmail.com --- Hello.
- Source0 is wrong, it should be:
Source0: https://github.com/juanfran/svgo-inkscape/archive/v%%7Bversion%7D/%%7Bname%7...
- You should ask upstream first to include a license file, not do it yourself. If upstream is unresponsive, then you might include it.
« Packagers who choose to do this [include text of the license] should ensure that they have exhausted all attempts to work with upstream to include the license text as part of the source code, or at least, to confirm the full license text explicitly with the upstream, as this minimizes the risk on the packager. Packagers should also take copies of license texts from reliable and canonical sources (such as the Fedora Software Licenses page, the FSF licenses page, or the OSI license list), whenever possible. »
https://fedoraproject.org/wiki/Packaging:LicensingGuidelines#License_Text
- This does not replace shebangs, this change line encoding of the file!
#Replace shebangs line #!/usr/bin/env python sed -i 's/\r//' %{name}-%{version}/%{name}/svgo.inkscape.py
Just mark the file as executable and brp-mangle-shebangs will automatically do the rest:
chmod 0755 %{name}/svgo.inkscape.py
- -c %{name} is not necessary in %autosetup
- Then %install should be simplified to:
%install install -Dpm 0644 %{name}.inx -t %{buildroot}%{_datadir}/inkscape/extensions/ cp -pr %{name} -t %{buildroot}%{_datadir}/inkscape/extensions/
And %doc in %changelog:
%files %license LICENSE.txt %doc README.md
- There's a mix of tabs and spaces used for indentation, use one or another not both.
- This package won't work as intended: first if you read the Python source you see that it is expecting "node" in a subdirectory:
def effect(self): command = "./node/bin/node svgo.js --file=" + self.args[0]
This should be patched to depend on the system-wide node ( and you should thus add a Requires for it).
- Second svgo.js depends on svgo itself, which is a node module. That's why there is a package.json provided. You should thus run "npm install" in the svgo-inkscape directory to install the required modules.
https://bugzilla.redhat.com/show_bug.cgi?id=1546459
--- Comment #2 from Luya Tshimbalanga luya@fedoraproject.org --- (In reply to Robert-André Mauchin from comment #1)
Hello.
- Source0 is wrong, it should be:
Source0: https://github.com/juanfran/svgo-inkscape/archive/v%%7Bversion%7D/%%7Bname%7... %{version}.tar.gz
Fixed
- You should ask upstream first to include a license file, not do it
yourself. If upstream is unresponsive, then you might include it.
Already filed the request: https://github.com/juanfran/svgo-inkscape/issues/6
- This does not replace shebangs, this change line encoding of the file!
#Replace shebangs line #!/usr/bin/env python sed -i 's/\r//' %{name}-%{version}/%{name}/svgo.inkscape.py
Just mark the file as executable and brp-mangle-shebangs will automatically do the rest:
chmod 0755 %{name}/svgo.inkscape.py
Fixed
-c %{name} is not necessary in %autosetup
Then %install should be simplified to:
%install install -Dpm 0644 %{name}.inx -t %{buildroot}%{_datadir}/inkscape/extensions/ cp -pr %{name} -t %{buildroot}%{_datadir}/inkscape/extensions/
And %doc in %changelog:
%files %license LICENSE.txt %doc README.md
- There's a mix of tabs and spaces used for indentation, use one or another
not both.
Fixed.
- This package won't work as intended: first if you read the Python source
you see that it is expecting "node" in a subdirectory:
def effect(self): command = "./node/bin/node svgo.js --file=" + self.args[0]
This should be patched to depend on the system-wide node ( and you should thus add a Requires for it).
BuildRequires: nodejs-packaging seems the suggestion according to the guideline.
- Second svgo.js depends on svgo itself, which is a node module. That's why
there is a package.json provided. You should thus run "npm install" in the svgo-inkscape directory to install the required modules.
Looking at the nodejs guideline https://fedoraproject.org/wiki/Packaging:Node.js?rd=Node.js/Packagers#Instal..., it looks like using "npm install" is discouraged. Is there a better method instead?
https://bugzilla.redhat.com/show_bug.cgi?id=1546459
--- Comment #3 from Robert-André Mauchin zebob.m@gmail.com --- (In reply to Luya Tshimbalanga from comment #2)
- Second svgo.js depends on svgo itself, which is a node module. That's why
there is a package.json provided. You should thus run "npm install" in the svgo-inkscape directory to install the required modules.
Looking at the nodejs guideline https://fedoraproject.org/wiki/Packaging:Node.js?rd=Node.js/ Packagers#Installing_Modules, it looks like using "npm install" is discouraged. Is there a better method instead?
Yes my bad, internet is not available in Koji so this wouldn't work anyway. What you need to do instead is to package the bundled modules:
- nodejs-svgo
Use npm2rpm as a startup point. Look at other nodejs SPEC files to help you (https://src.fedoraproject.org/group/nodejs-sig). I,ve checked and all the dependencies are already packaged.
nodejs-minimist is already packaged too, just add npm(minimist) as a RR.
https://bugzilla.redhat.com/show_bug.cgi?id=1546459
--- Comment #4 from Luya Tshimbalanga luya@fedoraproject.org --- Sorr for the delay. I realize npm-svgo is already package. What will be the right way to symlink on this package?
https://bugzilla.redhat.com/show_bug.cgi?id=1546459
--- Comment #5 from Robert-André Mauchin zebob.m@gmail.com --- - Patch command = "./node/bin/node svgo.js --file=" + self.args[0] to point to /usr/bin/svgo
https://bugzilla.redhat.com/show_bug.cgi?id=1546459
--- Comment #6 from Luya Tshimbalanga luya@fedoraproject.org --- Here is the updated SPEC: https://copr-be.cloud.fedoraproject.org/results/luya/svgo-inkscape/fedora-ra... SRPM: https://copr-be.cloud.fedoraproject.org/results/luya/svgo-inkscape/fedora-ra...
Note the depend package node-svgo failed to install due to conflict.
https://bugzilla.redhat.com/show_bug.cgi?id=1546459
--- Comment #7 from Robert-André Mauchin zebob.m@gmail.com --- File a bug against https://apps.fedoraproject.org/packages/nodejs-csso/bugs and make it block this one. Try to bother jsmith on IRC or mail him about it.
FYI you just need to relax the dep in %prep:
%nodejs_fixdep css-tree
You could send a PR.
https://bugzilla.redhat.com/show_bug.cgi?id=1546459
Luya Tshimbalanga luya@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Depends On| |1648629
--- Comment #8 from Luya Tshimbalanga luya@fedoraproject.org --- Bug filed.
Referenced Bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=1648629 [Bug 1648629] Unable to install svgo-inkscape due to conflict
package-review@lists.fedoraproject.org