Skip to content

Commit 693288f

Browse files
author
qount25
committed
Add Package#licence which attempts to read LICENCE file in pkg root and return its contents
1 parent 1f8b9b2 commit 693288f

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

Diff for: lib/pgpm/deb/builder.rb

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def initialize(spec)
1010
end
1111

1212
def build
13+
binding.break
1314
prepare
1415
generate_deb_src_files
1516
pull_image

Diff for: lib/pgpm/package.rb

+10
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ def inspect
2929
"#<#{self.class}:#{self.class.package_name} #{version}>"
3030
end
3131

32+
def licence
33+
path = "#{self.source.to_s}"
34+
["LICENSE", "license", "License"].each do |fn|
35+
if File.exist?("#{path}/#{fn}")
36+
return File.read("#{path}/#{fn}")
37+
end
38+
end
39+
nil
40+
end
41+
3242
abstract_package
3343
end
3444
end

Diff for: packages/timescale/timescaledb.rb

-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ def description
1919
"An open-source time-series SQL database optimized for fast ingest and complex queries"
2020
end
2121

22-
def license
23-
"Timescale License"
24-
end
25-
2622
def build_steps
2723
[
2824
"./bootstrap -DPG_CONFIG=$PG_CONFIG #{bootstrap_flags.map { |f| "-D#{f}" }.join(" ")}",

Diff for: packages/timescaledb.rb

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def build_info_for(os)
4141
"DESTDIR=$PGPM_BUILDROOT cmake --build build --target install"
4242
]
4343
}
44-
}
4544
end
4645
end
4746

0 commit comments

Comments
 (0)