require "./context.cr" require "./recipe.cr" extend Package # FIXME: recipe.clean? context autoclean? Context.new().tap do |context| context.packaging_backend = "apk" # 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" # 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" #recipe.instructions.build << "cd hello-#{recipe.version} && make" #recipe.instructions.install << "cd hello-#{recipe.version} && make DESTDIR='${PKG}' install" recipe.url = "https://www.gnu.org/software/hello/" recipe.description = "The GNU Hello program produces a familiar, friendly greeting." recipe.dependencies << "gettext" 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 recipe.download recipe.extract raise "oh no, build failed" unless recipe.build recipe.package recipe.clean end end