Skip to content

Commit

Permalink
use install for manpage, try loop for SourceN files
Browse files Browse the repository at this point in the history
Signed-off-by: Lokesh Mandvekar <[email protected]>
  • Loading branch information
lsm5 committed May 3, 2024
1 parent 560084a commit f18e4ba
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions rpm/containers-common.spec
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ Source5: %{github_containers}/image/%{image_branch}/docs/containers-registries.c
Source6: %{github_containers}/image/%{image_branch}/docs/containers-registries.d.5.md
Source7: %{github_containers}/image/%{image_branch}/docs/containers-signature.5.md
Source8: %{github_containers}/image/%{image_branch}/docs/containers-transports.5.md
Source9: %{github_containers}/image/%{image_branch}/registries.conf
Source9: %{github_containers}/storage/%{storage_branch}/docs/containers-storage.conf.5.md
Source10: %{github_containers}/shortnames/%{shortnames_branch}/shortnames.conf
Source11: %{github_containers}/image/%{image_branch}/default.yaml
Source12: %{github_containers}/image/%{image_branch}/default-policy.json
Source13: %{github_containers}/storage/%{storage_branch}/docs/containers-storage.conf.5.md
Source13: %{github_containers}/image/%{image_branch}/registries.conf
Source14: %{github_containers}/storage/%{storage_branch}/storage.conf
# Fetch RPM-GPG-KEY-redhat-release from the authoritative source instead of storing
# a copy in repo or dist-git. Depending on distribution-gpg-keys rpm is also
Expand Down Expand Up @@ -99,6 +99,14 @@ not required by Skopeo.
bash rpm/update-config-files.sh

%build
mkdir -p man5
for i in *.5.md; do
go-md2man -in $i -out man5/$(basename $i .md)
done

for i in {1..9}; do
go-md2man -in %{SOURCE$i} -out man5/$(basename %{SOURCE$i} .md)
done

%install
# install config and policy files for registries
Expand All @@ -111,10 +119,10 @@ touch %{buildroot}%{_prefix}/lib/containers/storage/overlay-images/images.lock
install -dp -m 700 %{buildroot}%{_prefix}/lib/containers/storage/overlay-layers
touch %{buildroot}%{_prefix}/lib/containers/storage/overlay-layers/layers.lock

install -Dp -m0644 %{SOURCE9} %{buildroot}%{_sysconfdir}/containers/registries.conf
install -Dp -m0644 %{SOURCE10} %{buildroot}%{_sysconfdir}/containers/registries.conf.d/000-shortnames.conf
install -Dp -m0644 %{SOURCE11} %{buildroot}%{_sysconfdir}/containers/registries.d/default.yaml
install -Dp -m0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/containers/policy.json
install -Dp -m0644 %{SOURCE13} %{buildroot}%{_sysconfdir}/containers/registries.conf
install -Dp -m0644 %{SOURCE14} %{buildroot}%{_datadir}/containers/storage.conf

# RPM-GPG-KEY-redhat-release already exists on rhel envs, install only on
Expand All @@ -128,20 +136,10 @@ install -Dp -m0644 contrib/redhat/registry.redhat.io.yaml -t %{buildroot}%{_sysc

# install manpages
install -dp %{buildroot}%{_mandir}/man5
go-md2man -in docs/Containerfile.5.md -out %{buildroot}%{_mandir}/man5/Containerfile.5
go-md2man -in docs/containerignore.5.md -out %{buildroot}%{_mandir}/man5/containerignore.5
ln -s %{_mandir}/man5/containerignore.5 %{buildroot}%{_mandir}/man5/.containerignore.5
go-md2man -in docs/containers.conf.5.md %{buildroot}%{_mandir}/man5/containers.conf.5
go-md2man -in docs/containers-mounts.conf.5.md -out %{buildroot}%{_mandir}/man5/containers-mounts.conf.5
go-md2man -in %{SOURCE1} -out %{buildroot}%{_mandir}/man5/containers-auth.json.5
go-md2man -in %{SOURCE2} -out %{buildroot}%{_mandir}/man5/containers-certs.d.5
go-md2man -in %{SOURCE3} -out %{buildroot}%{_mandir}/man5/containers-policy.json.5
go-md2man -in %{SOURCE4} -out %{buildroot}%{_mandir}/man5/containers-registries.conf.5
go-md2man -in %{SOURCE5} -out %{buildroot}%{_mandir}/man5/containers-registries.conf.d.5
go-md2man -in %{SOURCE6} -out %{buildroot}%{_mandir}/man5/containers-registries.d.5
go-md2man -in %{SOURCE7} -out %{buildroot}%{_mandir}/man5/containers-signature.5
go-md2man -in %{SOURCE8} -out %{buildroot}%{_mandir}/man5/containers-transports.5
go-md2man -in %{SOURCE13} -out %{buildroot}%{_mandir}/man5/containers-storage.conf.5
for i in man5/*.5; do
install -Dp -m0644 $i -t %{buildroot}%{_mandir}/man5
done
ln -s containerignore.5 %{buildroot}%{_mandir}/man5/.containerignore.5

# install config files for mounts, containers and seccomp
install -m0644 pkg/subscriptions/mounts.conf %{buildroot}%{_datadir}/containers/mounts.conf
Expand Down

0 comments on commit f18e4ba

Please sign in to comment.