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
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,21 @@ CARGO_FEATURES ?= $(CARGO_FEATURES_DEFAULT)
# again. The unit test targets (install-unit-tests) don't use this and always
# build with the default features.
CARGO_OPTIONS ?= --features "$(CARGO_FEATURES)"
# Set to 1 to skip generating and installing man pages, e.g. for source
# builds into images that exclude documentation:
# make install DISABLE_DOCS=1
# This doesn't affect $(prefix)/share/doc/bootc/baseimage, which holds base
# image configuration rather than documentation.
DISABLE_DOCS ?=

# Build all binaries
.PHONY: bin
# The man pages are built first so that the production binary below
# overwrites the docgen-featured one in target/release.
ifneq ($(DISABLE_DOCS),1)
Comment thread
Johan-Liebert1 marked this conversation as resolved.
bin: manpages
endif
bin:
cargo build --release $(CARGO_OPTIONS) --bins

# The docgen feature this adds implies install-to-disk, so the man pages
Expand All @@ -77,9 +88,11 @@ install: completion
ln -s "$(STORAGE_RELATIVE_PATH)" "$(DESTDIR)$(prefix)/lib/bootc/storage"
install -D -m 0755 crates/cli/bootc-generator-stub $(DESTDIR)$(prefix)/lib/systemd/system-generators/bootc-systemd-generator
install -d $(DESTDIR)$(prefix)/lib/bootc/install
ifneq ($(DISABLE_DOCS),1)
install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man5 target/man/*.5
install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man7 target/man/*.7
install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man8 target/man/*.8
endif
install -D -m 0644 target/completion/bootc.bash $(DESTDIR)$(prefix)/share/bash-completion/completions/bootc
install -D -m 0644 target/completion/bootc.elvish $(DESTDIR)$(prefix)/share/elvish/lib/bootc.elv
install -D -m 0644 target/completion/bootc.fish $(DESTDIR)$(prefix)/share/fish/vendor_completions.d/bootc.fish
Expand Down
13 changes: 12 additions & 1 deletion docs/src/bootc-packaging-and-integration.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,23 @@ make install DESTDIR=/path/to/staging/root

The install target handles:
- Binary installation to `$(prefix)/bin`
- Man pages to `$(prefix)/share/man/man{5,8}`
- Man pages to `$(prefix)/share/man/man{5,7,8}`
- systemd units to `$(prefix)/lib/systemd/system`
- Documentation and examples to `$(prefix)/share/doc/bootc`
- Dracut module to `/usr/lib/dracut/modules.d/51bootc`
- Base image configuration files

To skip building and installing the man pages, for example when building
from source into a container image that excludes documentation, set
`DISABLE_DOCS=1`:

```bash
make install DISABLE_DOCS=1 DESTDIR=/path/to/staging/root
```

This also drops the build-time dependency on `go-md2man`. The base image
files under `$(prefix)/share/doc/bootc` are still installed.

### Optional Installation Targets

#### install-ostree-hooks
Expand Down
Loading