]> 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://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 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 -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
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 </description>
103 </item>
104
105 <item>
106 <title>Using appstream in Debian to locate packages with firmware and mime type support</title>
107 <link>http://people.skolelinux.org/pere/blog/Using_appstream_in_Debian_to_locate_packages_with_firmware_and_mime_type_support.html</link>
108 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Using_appstream_in_Debian_to_locate_packages_with_firmware_and_mime_type_support.html</guid>
109 <pubDate>Thu, 4 Feb 2016 16:40:00 +0100</pubDate>
110 <description>&lt;p&gt;The &lt;a href=&quot;https://wiki.debian.org/DEP-11&quot;&gt;appstream system&lt;/a&gt;
111 is taking shape in Debian, and one provided feature is a very
112 convenient way to tell you which package to install to make a given
113 firmware file available when the kernel is looking for it. This can
114 be done using apt-file too, but that is for someone else to blog
115 about. :)&lt;/p&gt;
116
117 &lt;p&gt;Here is a small recipe to find the package with a given firmware
118 file, in this example I am looking for ctfw-3.2.3.0.bin, randomly
119 picked from the set of firmware announced using appstream in Debian
120 unstable. In general you would be looking for the firmware requested
121 by the kernel during kernel module loading. To find the package
122 providing the example file, do like this:&lt;/p&gt;
123
124 &lt;blockquote&gt;&lt;pre&gt;
125 % apt install appstream
126 [...]
127 % apt update
128 [...]
129 % appstreamcli what-provides firmware:runtime ctfw-3.2.3.0.bin | \
130 awk &#39;/Package:/ {print $2}&#39;
131 firmware-qlogic
132 %
133 &lt;/pre&gt;&lt;/blockquote&gt;
134
135 &lt;p&gt;See &lt;a href=&quot;https://wiki.debian.org/AppStream/Guidelines&quot;&gt;the
136 appstream wiki&lt;/a&gt; page to learn how to embed the package metadata in
137 a way appstream can use.&lt;/p&gt;
138
139 &lt;p&gt;This same approach can be used to find any package supporting a
140 given MIME type. This is very useful when you get a file you do not
141 know how to handle. First find the mime type using &lt;tt&gt;file
142 --mime-type&lt;/tt&gt;, and next look up the package providing support for
143 it. Lets say you got an SVG file. Its MIME type is image/svg+xml,
144 and you can find all packages handling this type like this:&lt;/p&gt;
145
146 &lt;blockquote&gt;&lt;pre&gt;
147 % apt install appstream
148 [...]
149 % apt update
150 [...]
151 % appstreamcli what-provides mimetype image/svg+xml | \
152 awk &#39;/Package:/ {print $2}&#39;
153 bkchem
154 phototonic
155 inkscape
156 shutter
157 tetzle
158 geeqie
159 xia
160 pinta
161 gthumb
162 karbon
163 comix
164 mirage
165 viewnior
166 postr
167 ristretto
168 kolourpaint4
169 eog
170 eom
171 gimagereader
172 midori
173 %
174 &lt;/pre&gt;&lt;/blockquote&gt;
175
176 &lt;p&gt;I believe the MIME types are fetched from the desktop file for
177 packages providing appstream metadata.&lt;/p&gt;
178 </description>
179 </item>
180
181 </channel>
182 </rss>