]> pere.pagekite.me Git - homepage.git/blob - blog/archive/2016/02/02.rss
Generated.
[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://www.hungry.com/~pere/blog/</link>
7
8
9 <item>
10 <title>Creating, updating and checking debian/copyright semi-automatically</title>
11 <link>http://www.hungry.com/~pere/blog/Creating__updating_and_checking_debian_copyright_semi_automatically.html</link>
12 <guid isPermaLink="true">http://www.hungry.com/~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 requires 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
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
90 &lt;p&gt;&lt;strong&gt;Update 2016-02-20&lt;/strong&gt;: I got a tip from Mike Gabriel
91 on how to use licensecheck and cdbs to create a draft copyright file
92
93 &lt;p&gt;&lt;pre&gt;
94 licensecheck --copyright -r `find * -type f` | \
95 /usr/lib/cdbs/licensecheck2dep5 &gt; debian/copyright.auto
96 &lt;/pre&gt;&lt;/p&gt;
97
98 &lt;p&gt;He mentioned that he normally check the generated file into the
99 version control system to make it easier to discover license and
100 copyright changes in the upstream source. I will try to do the same
101 with my packages in the future.&lt;/p&gt;
102
103 &lt;p&gt;&lt;strong&gt;Update 2016-02-21&lt;/strong&gt;: The cme author recommended
104 against using -quiet for new users, so I removed it from the proposed
105 command line.&lt;/p&gt;
106 </description>
107 </item>
108
109 <item>
110 <title>Using appstream in Debian to locate packages with firmware and mime type support</title>
111 <link>http://www.hungry.com/~pere/blog/Using_appstream_in_Debian_to_locate_packages_with_firmware_and_mime_type_support.html</link>
112 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/Using_appstream_in_Debian_to_locate_packages_with_firmware_and_mime_type_support.html</guid>
113 <pubDate>Thu, 4 Feb 2016 16:40:00 +0100</pubDate>
114 <description>&lt;p&gt;The &lt;a href=&quot;https://wiki.debian.org/DEP-11&quot;&gt;appstream system&lt;/a&gt;
115 is taking shape in Debian, and one provided feature is a very
116 convenient way to tell you which package to install to make a given
117 firmware file available when the kernel is looking for it. This can
118 be done using apt-file too, but that is for someone else to blog
119 about. :)&lt;/p&gt;
120
121 &lt;p&gt;Here is a small recipe to find the package with a given firmware
122 file, in this example I am looking for ctfw-3.2.3.0.bin, randomly
123 picked from the set of firmware announced using appstream in Debian
124 unstable. In general you would be looking for the firmware requested
125 by the kernel during kernel module loading. To find the package
126 providing the example file, do like this:&lt;/p&gt;
127
128 &lt;blockquote&gt;&lt;pre&gt;
129 % apt install appstream
130 [...]
131 % apt update
132 [...]
133 % appstreamcli what-provides firmware:runtime ctfw-3.2.3.0.bin | \
134 awk &#39;/Package:/ {print $2}&#39;
135 firmware-qlogic
136 %
137 &lt;/pre&gt;&lt;/blockquote&gt;
138
139 &lt;p&gt;See &lt;a href=&quot;https://wiki.debian.org/AppStream/Guidelines&quot;&gt;the
140 appstream wiki&lt;/a&gt; page to learn how to embed the package metadata in
141 a way appstream can use.&lt;/p&gt;
142
143 &lt;p&gt;This same approach can be used to find any package supporting a
144 given MIME type. This is very useful when you get a file you do not
145 know how to handle. First find the mime type using &lt;tt&gt;file
146 --mime-type&lt;/tt&gt;, and next look up the package providing support for
147 it. Lets say you got an SVG file. Its MIME type is image/svg+xml,
148 and you can find all packages handling this type like this:&lt;/p&gt;
149
150 &lt;blockquote&gt;&lt;pre&gt;
151 % apt install appstream
152 [...]
153 % apt update
154 [...]
155 % appstreamcli what-provides mimetype image/svg+xml | \
156 awk &#39;/Package:/ {print $2}&#39;
157 bkchem
158 phototonic
159 inkscape
160 shutter
161 tetzle
162 geeqie
163 xia
164 pinta
165 gthumb
166 karbon
167 comix
168 mirage
169 viewnior
170 postr
171 ristretto
172 kolourpaint4
173 eog
174 eom
175 gimagereader
176 midori
177 %
178 &lt;/pre&gt;&lt;/blockquote&gt;
179
180 &lt;p&gt;I believe the MIME types are fetched from the desktop file for
181 packages providing appstream metadata.&lt;/p&gt;
182 </description>
183 </item>
184
185 </channel>
186 </rss>