Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 1 addition & 32 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,37 +52,6 @@ Your build packages should be found in the generated `./packages` directory.

- `melange` CLI has a command `bump` to make it easier. More details are [available here](https://github.com/chainguard-dev/melange/blob/f52b622351657fd9ccdb7e3bfb124caef61ad651/NEWS.md).

## Source Directory

If your package needs some additional files to include in the package, you can create a folder with the
same name as the package.yaml and put them there. For example, if you have a file named `foo.yaml`, you can
create a folder named `foo/` and put all the files you want to include in the package there.

If the directory does not exist, it will _not_ be an error; it simply will be ignored.

You should **not** put additional source files for your package in this root directory, as it
will pollute it for source from too many packages.

For example, see [busybox.yaml](./busybox.yaml) and the source directory [busybox/](./busybox/).

If multiple packages share a source, create a single directory and symlink the others to the source.
The name of the symlink must be the name of the package in `<package>.yaml`. For example,
all of the following files share the same source directory, [postgres/](./postgres/):

* [postgres-11.yaml](./postgres-11.yaml)
* [postgres-12.yaml](./postgres-12.yaml)
* [postgres-13.yaml](./postgres-13.yaml)
* [postgres-14.yaml](./postgres-14.yaml)
* [postgres-15.yaml](./postgres-15.yaml)

And all have symlinks:

* `postgres-11` -> `postgres/`
* `postgres-12` -> `postgres/`
* `postgres-13` -> `postgres/`
* `postgres-14` -> `postgres/`
* `postgres-15` -> `postgres/`

## Some tips

- melange has a few built-in pipelines. You can see their source code [in the melange repository](https://github.com/chainguard-dev/melange/tree/main/pkg/build/pipelines).
Expand All @@ -97,7 +66,7 @@ And all have symlinks:
gsutil -m rsync -r gs://wolfi-production-registry-destination/os/ ./packages
```

- If you don't want to install `gsutil` locally, you can use this image `gcr.io/google.com/cloudsdktool/google-cloud-cli:slim` which is the official SDK image from GCP and already include `gsutil` in there.
- If you dont want to install `gsutil` locally, you can use this image `gcr.io/google.com/cloudsdktool/google-cloud-cli:slim` which is the official SDK image from GCP and already include `gsutil` in there.

- When deciding how to add `update:` configuration see the [update docs](./docs/UPDATES.md)

Expand Down
21 changes: 16 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ MELANGE_OPTS += -r ${WOLFI_PROD}
endif

define build-package
$(eval pkgname = $(1))
$(eval sourcedir = $(pkgname))
$(eval pkgname = $(call comma-split,$(1),1))
$(eval sourcedir = $(call comma-split,$(1),2))
$(eval sourcedir = $(or $(sourcedir),$(pkgname)))
$(eval pkgfullname = $(shell $(MELANGE) package-version $(pkgname).yaml))
$(eval pkgtarget = $(TARGETDIR)/$(pkgfullname).apk)
packages/$(pkgname): $(pkgtarget)
Expand All @@ -46,6 +47,9 @@ endef

# The list of packages to be built. The order matters.
# At some point, when ready, this should be replaced with `wolfictl text -t name .`
# non-standard source directories are provided by adding them separated by a comma,
# e.g.
# postgres-11,postgres
PKGLIST ?= $(shell cat packages.txt | grep -v '^\#' )

all: ${KEY} .build-packages
Expand All @@ -58,14 +62,21 @@ clean:

.PHONY: list list-yaml
list:
$(info $(PKGLIST))
$(info $(PKGNAMELIST))
@printf ''

list-yaml:
$(info $(addsuffix .yaml,$(PKGLIST)))
$(info $(addsuffix .yaml,$(PKGNAMELIST)))
@printf ''

PACKAGES := $(addprefix packages/,$(PKGLIST))
comma := ,
comma-split = $(word $2,$(subst ${comma}, ,$1))

# PKGLIST includes the optional directory e.g. mariadb-10.6,mariadb
# PKGNAMELIST is only the names
PKGNAMELIST = $(foreach F,$(PKGLIST), $(firstword $(subst ${comma}, ,${F})))

PACKAGES := $(addprefix packages/,$(PKGNAMELIST))

$(foreach pkg,$(PKGLIST),$(eval $(call build-package,$(pkg))))

Expand Down
1 change: 0 additions & 1 deletion bazel-5

This file was deleted.

1 change: 0 additions & 1 deletion bazel-6

This file was deleted.

1 change: 0 additions & 1 deletion mariadb-10.11

This file was deleted.

1 change: 0 additions & 1 deletion mariadb-10.6

This file was deleted.

23 changes: 13 additions & 10 deletions packages.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# The list of packages to be built. The order matters.
# When ready, this should be replaced with `wolfictl text -t name .`
# At some point, when ready, this should be replaced with `wolfictl text -t name .`
# non-standard source directories are provided by adding them separated by a comma,
# e.g.
# postgres-11,postgres
# lines beginning with # are ignored
gmp
mpfr
Expand Down Expand Up @@ -187,11 +190,11 @@ libjpeg-turbo
lcms2
su-exec
llvm15
postgresql-11
postgresql-12
postgresql-13
postgresql-14
postgresql-15
postgresql-11,postgresql
postgresql-12,postgresql
postgresql-13,postgresql
postgresql-14,postgresql
postgresql-15,postgresql
tzdata
maven-stage0
maven
Expand Down Expand Up @@ -231,8 +234,8 @@ composer
yaml
docker-credential-ecr-login
pwgen
mariadb-10.6
mariadb-10.11
mariadb-10.6,mariadb
mariadb-10.11,mariadb
wait-for-it
argon2
haproxy
Expand Down Expand Up @@ -611,8 +614,8 @@ openjdk-12
openjdk-13
openjdk-14
openjdk-17
bazel-5
bazel-6
bazel-5,bazel
bazel-6,bazel
envoy
aws-efs-csi-driver
prometheus-bind-exporter
Expand Down
1 change: 0 additions & 1 deletion postgresql-11

This file was deleted.

1 change: 0 additions & 1 deletion postgresql-12

This file was deleted.

1 change: 0 additions & 1 deletion postgresql-13

This file was deleted.

1 change: 0 additions & 1 deletion postgresql-14

This file was deleted.

1 change: 0 additions & 1 deletion postgresql-15

This file was deleted.