]> pere.pagekite.me Git - homepage.git/blob - blog/archive/2016/02/02.rss
Typo.
[homepage.git] / blog / archive / 2016 / 02 / 02.rss
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
3 <channel>
4 <title>Petter Reinholdtsen - Entries from February 2016</title>
5 <description>Entries from February 2016</description>
6 <link>http://people.skolelinux.org/pere/blog/</link>
7
8
9 <item>
10 <title>Creating, updating and checking debian/copyright semi-automatically</title>
11 <link>http://people.skolelinux.org/pere/blog/Creating__updating_and_checking_debian_copyright_semi_automatically.html</link>
12 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Creating__updating_and_checking_debian_copyright_semi_automatically.html</guid>
13 <pubDate>Fri, 19 Feb 2016 15:00:00 +0100</pubDate>
14 <description>&lt;p&gt;Making packages for Debian require quite a lot of attention to
15 details. And one of the details is the content of the
16 debian/copyright file, which should list all relevant licenses used by
17 the code in the package in question, preferably in
18 &lt;a href=&quot;https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/&quot;&gt;machine
19 readable DEP5 format&lt;/a&gt;.&lt;/p&gt;
20
21 &lt;p&gt;For large packages with lots of contributors it is hard to write
22 and update this file manually, and if you get some detail wrong, the
23 package is normally rejected by the ftpmasters. So getting it right
24 the first time around get the package into Debian faster, and save
25 both you and the ftpmasters some work.. Today, while trying to figure
26 out what was wrong with
27 &lt;a href=&quot;https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=686447&quot;&gt;the
28 zfsonlinux copyright file&lt;/a&gt;, I decided to spend some time on
29 figuring out the options for doing this job automatically, or at least
30 semi-automatically.&lt;/p&gt;
31
32 &lt;p&gt;Lucikly, there are at least two tools available for generating the
33 file based on the code in the source package,
34 &lt;tt&gt;&lt;a href=&quot;https://tracker.debian.org/pkg/debmake&quot;&gt;debmake&lt;/a&gt;&lt;/tt&gt;
35 and &lt;tt&gt;&lt;a href=&quot;https://tracker.debian.org/pkg/cme&quot;&gt;cme&lt;/a&gt;&lt;/tt&gt;. I&#39;m
36 not sure which one of them came first, but both seem to be able to
37 create a sensible draft file. As far as I can tell, none of them can
38 be trusted to get the result just right, so the content need to be
39 polished a bit before the file is OK to upload. I found the debmake
40 option in
41 &lt;a href=&quot;http://goofying-with-debian.blogspot.com/2014/07/debmake-checking-source-against-dep-5.html&quot;&gt;a
42 blog posts from 2014&lt;/a&gt;.
43
44 &lt;p&gt;To generate using debmake, use the -cc option:
45
46 &lt;p&gt;&lt;pre&gt;
47 debmake -cc &gt; debian/copyright
48 &lt;/pre&gt;&lt;/p&gt;
49
50 &lt;p&gt;Note there are some problems with python and non-ASCII names, so
51 this might not be the best option.&lt;/p&gt;
52
53 &lt;p&gt;The cme option is based on a config parsing library, and I found
54 this approach in
55 &lt;a href=&quot;https://ddumont.wordpress.com/2015/04/05/improving-creation-of-debian-copyright-file/&quot;&gt;a
56 blog post from 2015&lt;/a&gt;. To generate using cme, use the &#39;update
57 dpkg-copyright&#39; option:
58
59 &lt;p&gt;&lt;pre&gt;
60 cme update dpkg-copyright -quiet
61 &lt;/pre&gt;&lt;/p&gt;
62
63 &lt;p&gt;This will create or update debian/copyright. The cme tool seem to
64 handle UTF-8 names better than debmake.&lt;/p&gt;
65
66 &lt;p&gt;When the copyright file is created, I would also like some help to
67 check if the file is correct. For this I found two good options,
68 &lt;tt&gt;debmake -k&lt;/tt&gt; and &lt;tt&gt;license-reconcile&lt;/tt&gt;. The former seem
69 to focus on license types and file matching, and is able to detect
70 ineffective blocks in the copyright file. The latter reports missing
71 copyright holders and years, but was confused by inconsistent license
72 names (like CDDL vs. CDDL-1.0). I suspect it is good to use both and
73 fix all issues reported by them before uploading. But I do not know
74 if the tools and the ftpmasters agree on what is important to fix in a
75 copyright file, so the package might still be rejected.&lt;/p&gt;
76
77 &lt;p&gt;The devscripts tool &lt;tt&gt;licensecheck&lt;/tt&gt; deserve mentioning. It
78 will read through the source and try to find all copyright statements.
79 It is not comparing the result to the content of debian/copyright, but
80 can be useful when verifying the content of the copyright file.&lt;/p&gt;
81
82 &lt;p&gt;Are you aware of better tools in Debian to create and update
83 debian/copyright file. Please let me know, or blog about it on
84 planet.debian.org.&lt;/p&gt;
85
86 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
87 activities, please send Bitcoin donations to my address
88 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
89 </description>
90 </item>
91
92 <item>
93 <title>Using appstream in Debian to locate packages with firmware and mime type support</title>
94 <link>http://people.skolelinux.org/pere/blog/Using_appstream_in_Debian_to_locate_packages_with_firmware_and_mime_type_support.html</link>
95 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Using_appstream_in_Debian_to_locate_packages_with_firmware_and_mime_type_support.html</guid>
96 <pubDate>Thu, 4 Feb 2016 16:40:00 +0100</pubDate>
97 <description>&lt;p&gt;The &lt;a href=&quot;https://wiki.debian.org/DEP-11&quot;&gt;appstream system&lt;/a&gt;
98 is taking shape in Debian, and one provided feature is a very
99 convenient way to tell you which package to install to make a given
100 firmware file available when the kernel is looking for it. This can
101 be done using apt-file too, but that is for someone else to blog
102 about. :)&lt;/p&gt;
103
104 &lt;p&gt;Here is a small recipe to find the package with a given firmware
105 file, in this example I am looking for ctfw-3.2.3.0.bin, randomly
106 picked from the set of firmware announced using appstream in Debian
107 unstable. In general you would be looking for the firmware requested
108 by the kernel during kernel module loading. To find the package
109 providing the example file, do like this:&lt;/p&gt;
110
111 &lt;blockquote&gt;&lt;pre&gt;
112 % apt install appstream
113 [...]
114 % apt update
115 [...]
116 % appstreamcli what-provides firmware:runtime ctfw-3.2.3.0.bin | \
117 awk &#39;/Package:/ {print $2}&#39;
118 firmware-qlogic
119 %
120 &lt;/pre&gt;&lt;/blockquote&gt;
121
122 &lt;p&gt;See &lt;a href=&quot;https://wiki.debian.org/AppStream/Guidelines&quot;&gt;the
123 appstream wiki&lt;/a&gt; page to learn how to embed the package metadata in
124 a way appstream can use.&lt;/p&gt;
125
126 &lt;p&gt;This same approach can be used to find any package supporting a
127 given MIME type. This is very useful when you get a file you do not
128 know how to handle. First find the mime type using &lt;tt&gt;file
129 --mime-type&lt;/tt&gt;, and next look up the package providing support for
130 it. Lets say you got an SVG file. Its MIME type is image/svg+xml,
131 and you can find all packages handling this type like this:&lt;/p&gt;
132
133 &lt;blockquote&gt;&lt;pre&gt;
134 % apt install appstream
135 [...]
136 % apt update
137 [...]
138 % appstreamcli what-provides mimetype image/svg+xml | \
139 awk &#39;/Package:/ {print $2}&#39;
140 bkchem
141 phototonic
142 inkscape
143 shutter
144 tetzle
145 geeqie
146 xia
147 pinta
148 gthumb
149 karbon
150 comix
151 mirage
152 viewnior
153 postr
154 ristretto
155 kolourpaint4
156 eog
157 eom
158 gimagereader
159 midori
160 %
161 &lt;/pre&gt;&lt;/blockquote&gt;
162
163 &lt;p&gt;I believe the MIME types are fetched from the desktop file for
164 packages providing appstream metadata.&lt;/p&gt;
165 </description>
166 </item>
167
168 </channel>
169 </rss>