Bug#838069: calibre: Please announce supported hardware using AppStream

2024-07-14 Thread Petter Reinholdtsen


Control: tags -1 + patch

I had a look at how to modify the source to fix this.  Here is an
untested patch to implement support for provides in the generated
metadata XML file.  Unfortunately I lacked the required free disk space
to do a test build.  I did not add the provides to the editor metadata
entry, assuming that it is most relevant for the two other components.

diff --git a/src/calibre/linux.py b/src/calibre/linux.py
index bd0b6f9..b81215e 100644
--- a/src/calibre/linux.py
+++ b/src/calibre/linux.py
@@ -1157,6 +1157,10 @@ def get_appdata():
 _('calibre is the one stop solution to all your e-book 
needs.'),
 _('You can use calibre to catalog your books, fetch metadata 
for them automatically, convert them from and to all the various e-book 
formats, send them to your e-book reader devices, read the books on your 
computer, edit the books in a dedicated e-book editor and even make them 
available over the network with the built-in Content server. You can also 
download news and periodicals in e-book format from over a thousand different 
news and magazine websites.')  # noqa
 ),
+'provides': [
+{'modalias': 'usb:v2237p*d*ic08isc*ip*'},
+{'modalias': 'usb:v0525pA4A5d*ic08isc*ip*'},
+],
 'screenshots':(
 (1408, 792, 
'https://lh4.googleusercontent.com/-bNE1hc_3pIc/UvHLwKPGBPI/ASA/8oavs_c6xoU/w1408-h792-no/main-default.png',),
 (1408, 792, 
'https://lh4.googleusercontent.com/-Zu2httSKABE/UvHMYK30JJI/ATg/dQTQUjBvV5s/w1408-h792-no/main-grid.png'),
@@ -1188,6 +1192,10 @@ def get_appdata():
 _('The calibre E-book viewer allows you to read e-books in 
over a dozen different formats.'),
 _('It has a full screen mode for distraction free reading and 
can display the text with multiple columns per screen.'),
 ),
+'provides': [
+{'modalias': 'usb:v2237p*d*ic08isc*ip*'},
+{'modalias': 'usb:v0525pA4A5d*ic08isc*ip*'},
+],
 'screenshots':(
 (1408, 792, 
'https://lh5.googleusercontent.com/-dzSO82BPpaE/UvHMYY5SpNI/ATk/I_kF9fYWrZM/w1408-h792-no/viewer-default.png',),
 (1920, 1080, 
'https://lh6.googleusercontent.com/-n32Ae5RytAk/UvHMY0QD94I/ATs/Zw8Yz08HIKk/w1920-h1080-no/viewer-fs.png'),
@@ -1260,7 +1268,7 @@ def make_appdata_releases():
 
 def write_appdata(key, entry, base, translators):
 from lxml.builder import E
-from lxml.etree import tostring
+from lxml.etree import Element, tostring
 fpath = os.path.join(base, '%s.metainfo.xml' % key)
 screenshots = E.screenshots()
 for w, h, url in entry['screenshots']:
@@ -1300,6 +1308,14 @@ def write_appdata(key, entry, base, translators):
 tp = t.gettext(entry['summary'])
 if tp != entry['summary']:
 root.append(E.summary(tp, 
**{'{http://www.w3.org/XML/1998/namespace}lang': lang}))
+if 0 < len(entry.get('provides', [])):
+provides = E.provides()
+for p in entry['provides']:
+for tag in p.keys():
+provided = Elements(tag)
+provided.text = p[tag]
+provides.append(provided)
+root.append(provides)
 if entry.get('include-releases', False):
 try:
 root.append(make_appdata_releases())

-- 
Happy hacking
Petter Reinholdtsen



Bug#838069: calibre: Please announce supported hardware using AppStream

2020-07-24 Thread Petter Reinholdtsen
[Nicholas D Steeves]
> I agree, this seems like it would make it easier for new users to
> discover Calibre :-) That said, I noticed that isenkram is not
> installed on any of my (KDE) systems.  Is it part of the GNOME default
> installation?  It seems to me that this project won't be useful to
> such users if isenkram is not part of a default Debian KDE or GNOME
> installation, nor part of an Ubuntu one.

I do not have complete overview of which systems are using appstream
information these days, but it is worth noting that isenkram is not the
only one.  I believe the default KDE and GNOME package managers use it,
but have not confirmed this myself.

I have only focused on the hardware related part of appstream used by
isenkram, and would suggest to check with the appstream package
maintainer for information about the general use of appstream in Debian.

I provide a isenkram specific "cache" with information that I believe
should be available for everyone using the appstream system, and for
calibre this cache contain the following entries:

  Package: calibre
  Modaliases: unused(usb:v2237p*d*ic08isc*ip*, usb:v0525pA4A5d*ic08isc*ip*)

-- 
Happy hacking
Petter Reinholdtsen



Bug#838069: calibre: Please announce supported hardware using AppStream

2019-08-03 Thread Norbert Preining
Hi Nicholas,

> I agree, this seems like it would make it easier for new users to
> discover Calibre :-) That said, I noticed that isenkram is not

Maybe, but I haven't seen any appstream support system installed on any
system (maybe ubuntu?), so I am not that much convinced that it is
useful.

> Norbert, do you think upstream will be receptive to maintaining an
> appstream file?  The reason I think maybe not, is because Goyal wants

My guess is no ...

Best

Norbert

--
PREINING Norbert   http://www.preining.info
Accelia Inc. + IFMGA ProGuide + TU Wien + JAIST + TeX Live + Debian Dev
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13



Bug#838069: calibre: Please announce supported hardware using AppStream

2019-08-03 Thread Nicholas D Steeves
Control: tag -1 +confirmed

Hi Petter,

On Sat, Sep 17, 2016 at 10:28:14AM +0200, Petter Reinholdtsen wrote:
> 
> Hi.
> 
> The calibre package is one of the packages in the Debian archive that
> should be proposed for installation when a given hardware dongle is
> inserted or available.  Thanks to the appstream system, this can now be
> announced in a way other tools can use and act on.  I've written the
> isenkram system to ask the current user if hardware specific packages
> should be installed when a new dongle is installed or already present on
> a machine, and isenkram now uses appstream as one source for hardware to
> package mappings.
> 

I agree, this seems like it would make it easier for new users to
discover Calibre :-) That said, I noticed that isenkram is not
installed on any of my (KDE) systems.  Is it part of the GNOME default
installation?  It seems to me that this project won't be useful to
such users if isenkram is not part of a default Debian KDE or GNOME
installation, nor part of an Ubuntu one.

Norbert, do you think upstream will be receptive to maintaining an
appstream file?  The reason I think maybe not, is because Goyal wants
users to use a "curl | sudo sh" installation method, which doesn't
benefit from appstream integration.

I attempted to forward this bug to upstream bug tracker, but a
Launchpad<->Ubuntu One prevents me from logging into Launchpad.

If either of you are able to log into Launchpad, please forward this
bug here: https://bugs.launchpad.net/calibre


Regards,
Nicholas


signature.asc
Description: PGP signature


Bug#838069: calibre: Please announce supported hardware using AppStream

2016-09-17 Thread Petter Reinholdtsen

Package: calibre
Version: 2.60.0+dfsg-1
Severity: wishlist
User: p...@hungry.com
Usertags: appstream-modalias

Hi.

The calibre package is one of the packages in the Debian archive that
should be proposed for installation when a given hardware dongle is
inserted or available.  Thanks to the appstream system, this can now be
announced in a way other tools can use and act on.  I've written the
isenkram system to ask the current user if hardware specific packages
should be installed when a new dongle is installed or already present on
a machine, and isenkram now uses appstream as one source for hardware to
package mappings.

You can read more about this on my blog, 
http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html
 >.

Instructions on how to create the metadata XML file can be found in
https://wiki.debian.org/AppStream/Guidelines >.

It would be great if you could add an appstream metainfo file to the
calibre package, with content similar to this:

  
  
   [...]
   
usb:v2237p*d*ic08isc*ip*
usb:v0525pA4A5d*ic08isc*ip*

  

If there are other USB ids also supposed by the package, please add
those too. :)

-- 
Happy hacking
Petter Reinholdtsen