@@ -41,6 +41,35 @@ async function createNfpmConfig(
41
41
"share" ,
42
42
) ;
43
43
44
+ const contents : any [ ] = [
45
+ {
46
+ src : workingBinPath ,
47
+ dst : "/opt/quarto/bin" ,
48
+ type : "tree" ,
49
+ } ,
50
+ {
51
+ src : workingSharePath ,
52
+ dst : "/opt/quarto/share" ,
53
+ type : "tree" ,
54
+ } ,
55
+ ] ;
56
+
57
+ // Add copyright file for DEB packages
58
+ if ( format === 'deb' ) {
59
+ const copyrightFile = join (
60
+ workingDir ,
61
+ "usr" ,
62
+ "share" ,
63
+ "doc" ,
64
+ configuration . productName . toLowerCase ( ) ,
65
+ "copyright" ,
66
+ ) ;
67
+ contents . push ( {
68
+ src : copyrightFile ,
69
+ dst : `/usr/share/doc/${ configuration . productName . toLowerCase ( ) } /copyright` ,
70
+ } ) ;
71
+ }
72
+
44
73
const config : any = {
45
74
name : configuration . productName . toLowerCase ( ) ,
46
75
version : configuration . version ,
@@ -50,18 +79,7 @@ async function createNfpmConfig(
50
79
homepage : "https://github.com/quarto-dev/quarto-cli" ,
51
80
license : "MIT" ,
52
81
53
- contents : [
54
- {
55
- src : workingBinPath ,
56
- dst : "/opt/quarto/bin" ,
57
- type : "tree" ,
58
- } ,
59
- {
60
- src : workingSharePath ,
61
- dst : "/opt/quarto/share" ,
62
- type : "tree" ,
63
- } ,
64
- ] ,
82
+ contents : contents ,
65
83
66
84
scripts : {
67
85
postinstall : join ( configuration . directoryInfo . pkg , "scripts" , "linux" , format , "postinst" ) ,
@@ -123,6 +141,23 @@ async function buildPackageWithNfpm(
123
141
overwrite : true ,
124
142
} ) ;
125
143
144
+ // Create copyright file for DEB packages
145
+ if ( format === 'deb' ) {
146
+ info ( "Creating copyright file" ) ;
147
+ const url = "https://github.com/quarto-dev/quarto-cli" ;
148
+ const copyrightText = `Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
149
+ Upstream-Name: Quarto
150
+ Source: ${ url }
151
+
152
+ Files: *
153
+ Copyright: Posit, PBC.
154
+ License: MIT` ;
155
+
156
+ const copyrightDir = join ( workingDir , "usr" , "share" , "doc" , configuration . productName . toLowerCase ( ) ) ;
157
+ ensureDirSync ( copyrightDir ) ;
158
+ Deno . writeTextFileSync ( join ( copyrightDir , "copyright" ) , copyrightText ) ;
159
+ }
160
+
126
161
// Create nfpm configuration
127
162
const nfpmConfig = await createNfpmConfig ( configuration , format , workingDir ) ;
128
163
const configPath = join ( configuration . directoryInfo . out , "nfpm.yaml" ) ;
0 commit comments