packaging.spec configuration example, few comments in src/context.cr
parent
7924f15376
commit
5ad65f00ec
|
@ -0,0 +1,35 @@
|
||||||
|
# /etc/packaging.spec configuration file
|
||||||
|
|
||||||
|
# where to send built packages
|
||||||
|
packages-directory: /usr/local/baguette/pkg/
|
||||||
|
# where to download sources
|
||||||
|
sources-directory: /usr/local/baguette/src/
|
||||||
|
|
||||||
|
# the slot we want for our packages
|
||||||
|
slotting: /usr/baguette
|
||||||
|
|
||||||
|
# prefixes for `packaging` running environment and child processes
|
||||||
|
# a.k.a. where to search for binaries during the build
|
||||||
|
prefixes:
|
||||||
|
- /usr/baguette/
|
||||||
|
- /
|
||||||
|
|
||||||
|
# list of environment variables when building
|
||||||
|
environment:
|
||||||
|
# we may choose another compiler, provide some CFLAGS, etc.
|
||||||
|
- CC: clang
|
||||||
|
- CFLAGS: -Os -Wall
|
||||||
|
|
||||||
|
# next three parameters have special meaning
|
||||||
|
# to provide parameters to the `./configure` script when building
|
||||||
|
- configure: --disable-nls --without-gettext
|
||||||
|
|
||||||
|
# to provide parameters to the `make` command
|
||||||
|
- make:
|
||||||
|
|
||||||
|
# to provide parameters to the final `make install` command
|
||||||
|
- make install:
|
||||||
|
|
||||||
|
# wanna build for another system? not a problem, just add the back-end (we currently have `apk` and `package`)
|
||||||
|
package-manager: package
|
||||||
|
|
|
@ -58,7 +58,11 @@ class Package::Context
|
||||||
# but it’ll be kind of enough for now.
|
# but it’ll be kind of enough for now.
|
||||||
property architecture = "x86_64"
|
property architecture = "x86_64"
|
||||||
|
|
||||||
|
# prefixes for `packaging` running environment and child processes
|
||||||
|
# = where to search for binaries and libraries for the build
|
||||||
property prefixes = ["/usr", "/", "/usr/baguetteos"]
|
property prefixes = ["/usr", "/", "/usr/baguetteos"]
|
||||||
|
|
||||||
|
# list of environment variables we want to have when building
|
||||||
property environment = {} of String => String
|
property environment = {} of String => String
|
||||||
|
|
||||||
property verbosity = 0
|
property verbosity = 0
|
||||||
|
@ -259,8 +263,10 @@ class Package::Context
|
||||||
when "sources-directory"
|
when "sources-directory"
|
||||||
@sources_directory = value.as_s
|
@sources_directory = value.as_s
|
||||||
when "prefixes"
|
when "prefixes"
|
||||||
|
# Prefixes during the build process.
|
||||||
@prefixes = value.as_a_or_s
|
@prefixes = value.as_a_or_s
|
||||||
when "environment"
|
when "environment"
|
||||||
|
# Environment variables during the build process.
|
||||||
value.as_a_or_s.each do |entry|
|
value.as_a_or_s.each do |entry|
|
||||||
match = entry.split(':').map(
|
match = entry.split(':').map(
|
||||||
&.gsub(/^[ \t]*/, "").gsub(/[ \t]*$/, ""))
|
&.gsub(/^[ \t]*/, "").gsub(/[ \t]*$/, ""))
|
||||||
|
@ -274,6 +280,7 @@ class Package::Context
|
||||||
@environment[key] = value
|
@environment[key] = value
|
||||||
end
|
end
|
||||||
when "package-manager"
|
when "package-manager"
|
||||||
|
# Targeted package manager (default: package, for BaguetteOS).
|
||||||
self.packaging_backend = value.as_s
|
self.packaging_backend = value.as_s
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Reference in New Issue