2019-07-02 03:50:50 +02:00
|
|
|
|
|
|
|
require "./context.cr"
|
|
|
|
require "./recipe.cr"
|
|
|
|
|
|
|
|
extend Package
|
|
|
|
|
|
|
|
# FIXME: recipe.clean? context autoclean?
|
|
|
|
Context.new().tap do |context|
|
2019-07-03 05:23:48 +02:00
|
|
|
context.packaging_backend = "apk"
|
2019-07-03 03:35:35 +02:00
|
|
|
|
2019-07-02 03:50:50 +02:00
|
|
|
# FIXME: context.new_recipe? context.recipe?
|
|
|
|
Recipe.new(context, "hello", "2.10").tap do |recipe|
|
|
|
|
recipe.sources << "https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz"
|
|
|
|
|
2019-07-03 05:23:48 +02:00
|
|
|
# This is a voluntary mix of automatic and manual build
|
|
|
|
# instructions.
|
|
|
|
# Also, installing in /package makes testing with a real-life
|
|
|
|
# package manager trivial and reduces the damage done in case
|
|
|
|
# of… containment failure. ]:->
|
|
|
|
recipe.instructions.configure << "cd hello-#{recipe.version} && ./configure --prefix=/package"
|
2019-07-02 08:47:11 +02:00
|
|
|
#recipe.instructions.build << "cd hello-#{recipe.version} && make"
|
2019-07-03 05:23:48 +02:00
|
|
|
#recipe.instructions.install << "cd hello-#{recipe.version} && make DESTDIR='${PKG}' install"
|
2019-07-02 03:50:50 +02:00
|
|
|
|
2019-07-03 04:24:33 +02:00
|
|
|
recipe.url = "https://www.gnu.org/software/hello/"
|
|
|
|
recipe.description = "The GNU Hello program produces a familiar, friendly greeting."
|
|
|
|
recipe.dependencies << "gettext"
|
|
|
|
|
2019-07-04 23:18:54 +02:00
|
|
|
recipe.auto_split
|
|
|
|
|
|
|
|
# Should be automatic now.
|
|
|
|
#recipe.packages << Package::Package.new(recipe).tap do |package|
|
|
|
|
# package.name = "#{recipe.name}-man"
|
|
|
|
# package.files = ["/package/share/man"]
|
|
|
|
#end
|
2019-07-04 07:51:00 +02:00
|
|
|
|
2019-07-03 03:17:01 +02:00
|
|
|
recipe.download
|
|
|
|
recipe.extract
|
|
|
|
|
2019-07-02 08:47:11 +02:00
|
|
|
raise "oh no, build failed" unless recipe.build
|
2019-07-02 03:50:50 +02:00
|
|
|
recipe.package
|
|
|
|
|
|
|
|
recipe.clean
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|