Closed andrewlock closed 2 months ago
hey!
yeah, I think currently you have to copy the license file into the package, something like:
contents:
- src: ./LICENSE.md
dst: /usr/share/doc/my-package/copyright
file_info:
mode: 0644
Oh, I see, thanks for the info! With fpm we weren't doing that, just specifying the metadata a!d that was it. Thanks, I'll give it a try!
Hmmm, that still hasn't worked π€
If I run dpkg -c
I can see the copyright file is there:
-rw-r--r-- root/root 11357 2024-03-07 11:30 ./usr/share/doc/my-package/copyright
but it's still not reported by dpkg --info
or by dpkg -f my-package_3.1.0_amd64.deb license
π€
Any more ideas? π Thanks for the help!
I was doing a bit more spelunking, and AFAICT, the
RPMMetaData
has a license field in the metadata for example:
https://github.com/goreleaser/nfpm/blob/52e0c639c8d0675a895e47f27c35a0e1bb1242df/rpm/rpm.go#L252
The template for the debian control file has no such field:
https://github.com/goreleaser/nfpm/blob/52e0c639c8d0675a895e47f27c35a0e1bb1242df/deb/deb.go#L716
Compared to fpm which does include it:
Interestingly though, I don't see a specific mention of the License field in the debian control file spec, so I guess fpm is adding it as a "user-defined field"? π€
Based on the documentation about copyright information here, your suggestion of just adding the file seems correct, although it also says:
Packages distributed under the Apache license (version 2.0), the Artistic license, the Creative Commons CC0-1.0 license, the GNU GPL (versions 1, 2, or 3), the GNU LGPL (versions 2, 2.1, or 3), the GNU FDL (versions 1.2 or 1.3), and the Mozilla Public License (version 1.1 or 2.0) should refer to the corresponding files under /usr/share/common-licenses, 9 rather than quoting them in the copyright file.
So I think the license file should look something like this (based on examples I found):
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: {{HomePage}}
Upstream-Name: {{PackageName}}
Files:
*
Copyright: {{Year}} {{CopyrightOwner}}
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
Comment:
On Debian-based systems the full text of the Apache version 2.0 license can be
found in `/usr/share/common-licenses/Apache-2.0'.
and there shouldn't be a license control field value?
In which case, I think there's probably nothing to do here, though I guess it would be really nice if nfpm could handle this automatically based on the License
configuration field π Might be a bit much to ask though! π
ah, so, I think at least the License
field in the control file we can set -> https://github.com/goreleaser/nfpm/pull/849
about formatting a license in the specific format needed, maybe that can be left to whoever is packaging it
Ah cool, thank you! π
What happened?
I'm trying to migrate from fpm to nfpm, and AFAICT, the license field is being ignored.
How can we reproduce this?
configfile:
Then if I run
dpkg-deb --info
on the output I get:Note that there is no license field. And running
dpkg-deb --field license
similarly shows it's not set.nfpm version
Search
Code of Conduct
Additional context
Thanks for this project, I would love to remove our ruby dependency! π I expect I'm just doing something wrong, but I've looked all through the code and can't figure it out. Thanks for your help!