2019-07-02 03:50:50 +02:00
|
|
|
|
|
|
|
class Package::Package
|
2019-07-03 05:23:48 +02:00
|
|
|
getter recipe : Recipe
|
2019-07-04 23:18:54 +02:00
|
|
|
getter automatic : Bool
|
2019-07-02 03:50:50 +02:00
|
|
|
|
2019-07-04 23:18:54 +02:00
|
|
|
def initialize(@recipe, @automatic = false)
|
2019-07-03 03:17:01 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
macro inherit(attribute)
|
|
|
|
@{{attribute.var.id}} : {{attribute.type.id}}?
|
|
|
|
|
|
|
|
def {{attribute.var.id}} : {{attribute.type.id}}
|
|
|
|
@{{attribute.var.id}} || @recipe.{{attribute.var.id}}
|
|
|
|
end
|
2019-07-03 04:24:33 +02:00
|
|
|
|
|
|
|
def {{attribute.var.id}}=(new_value : {{attribute.type.id}})
|
|
|
|
@{{attribute.var.id}} = new_value
|
|
|
|
end
|
2019-07-03 03:17:01 +02:00
|
|
|
end
|
|
|
|
|
2019-07-03 04:24:33 +02:00
|
|
|
inherit name : String
|
|
|
|
inherit version : String
|
|
|
|
inherit release : Int32
|
|
|
|
|
|
|
|
inherit url : String?
|
|
|
|
inherit description : String
|
|
|
|
|
|
|
|
inherit dependencies : Array(String)
|
|
|
|
inherit conflicts : Array(String)
|
|
|
|
inherit provides : Array(String)
|
2019-07-03 03:17:01 +02:00
|
|
|
|
2019-07-04 07:51:00 +02:00
|
|
|
# Reference for splits. Recipe#packages[0] should keep this set to `nil`.
|
|
|
|
property files : Array(String)?
|
|
|
|
|
|
|
|
def fake_root_directory
|
|
|
|
"#{@recipe.working_directory}/root-#{name}"
|
|
|
|
end
|
2019-07-03 03:17:01 +02:00
|
|
|
|
|
|
|
def to_s
|
|
|
|
"<Package: #{name}-#{version}>"
|
2019-07-02 03:50:50 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|