mirror of
https://github.com/containers/podman.git
synced 2025-05-22 01:27:07 +08:00
[CI:BUILD] copr: podman.spec.rpkg cleanups
- Remove f35 conditionals, list manpages only once. - Fix el8 builds the right way. Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
%global with_debug 1
|
||||
|
||||
# _user_tmpfiles.d currently undefined on rhel
|
||||
%if 0%{?fedora} <= 35 || 0%{?rhel}
|
||||
%if 0%{?rhel}
|
||||
%global _user_tmpfilesdir %{_datadir}/user-tmpfiles.d
|
||||
%endif
|
||||
|
||||
@ -17,38 +17,21 @@
|
||||
%global debug_package %{nil}
|
||||
%endif
|
||||
|
||||
%if ! 0%{?gobuild:1}
|
||||
%define gobuild(o:) go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '" -a -v -x %{?**};
|
||||
# RHEL 8's default %%gobuild macro doesn't account for the BUILDTAGS variable, so we
|
||||
# set it separately here and do not depend on RHEL 8's go-srpm-macros package.
|
||||
%if !0%{?fedora} && 0%{?rhel} <= 8
|
||||
%define gobuild(o:) go build -buildmode pie -compiler gc -tags="rpm_crashtraceback libtrust_openssl ${BUILDTAGS:-}" -ldflags "-linkmode=external -compressdwarf=false ${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**};
|
||||
%endif
|
||||
|
||||
# git_dir_name returns repository name derived from remote Git repository URL
|
||||
Name: {{{ git_dir_name }}}
|
||||
|
||||
Name: {{{ git_dir_name }}}
|
||||
Epoch: 101
|
||||
|
||||
# git_dir_version returns version based on commit and tag history of the Git project
|
||||
Version: {{{ git_dir_version }}}
|
||||
|
||||
# This can be useful later for adding downstream patches
|
||||
Release: 1%{?dist}
|
||||
|
||||
# Basic description of the package
|
||||
Version: {{{ git_dir_version }}}
|
||||
Release: 1%{?dist}
|
||||
Summary: Manage Pods, Containers and Container Images
|
||||
|
||||
# License. We assume GPLv2+ here.
|
||||
License: ASL 2.0
|
||||
|
||||
# Home page of the project. Can also point to the public Git repository page.
|
||||
URL: https://github.com/containers/podman
|
||||
|
||||
# Detailed information about the source Git repository and the source commit
|
||||
# for the created rpm package
|
||||
VCS: {{{ git_dir_vcs }}}
|
||||
|
||||
# git_dir_pack macro places the repository content (the source files) into a tarball
|
||||
# and returns its filename. The tarball will be used to build the rpm.
|
||||
License: Apache-2.0
|
||||
URL: https://github.com/containers/podman
|
||||
VCS: {{{ git_dir_vcs }}}
|
||||
Source: {{{ git_dir_pack }}}
|
||||
|
||||
%if 0%{?fedora} && ! 0%{?rhel}
|
||||
BuildRequires: btrfs-progs-devel
|
||||
%endif
|
||||
@ -89,7 +72,6 @@ Provides: %{name}-quadlet
|
||||
Obsoletes: %{name}-quadlet <= 101:0.0.git.17877.f247b4d4-1
|
||||
Provides: %{name}-quadlet = %{epoch}:%{version}-%{release}
|
||||
|
||||
# More detailed description of the package
|
||||
%description
|
||||
%{name} (Pod Manager) is a fully featured container engine that is a simple
|
||||
daemonless tool. %{name} provides a Docker-CLI comparable command line that
|
||||
@ -145,12 +127,9 @@ Remote client for managing %{name} containers.
|
||||
manage pods, containers and container images. %{name}-remote supports ssh
|
||||
connections as well.
|
||||
|
||||
# The following four sections already describe the rpm build process itself.
|
||||
# prep will extract the tarball defined as Source above and descend into it.
|
||||
%prep
|
||||
{{{ git_dir_setup_macro }}}
|
||||
|
||||
# This will invoke `make` command in the directory with the extracted sources.
|
||||
%build
|
||||
%set_build_flags
|
||||
%global gomodulesmode GO111MODULE=on
|
||||
@ -164,10 +143,6 @@ CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-specs=\/usr\/lib\/rpm\/redhat\/redhat-an
|
||||
export CGO_CFLAGS+=" -m64 -mtune=generic -fcf-protection=full"
|
||||
%endif
|
||||
|
||||
%if 0%{?rhel}
|
||||
rm -rf vendor/github.com/containers/storage/drivers/register/register_btrfs.go
|
||||
%endif
|
||||
|
||||
# build date. FIXME: Makefile uses '/v2/libpod', that doesn't work here?
|
||||
LDFLAGS="-X ./libpod/define.buildInfo=$(date +%s)"
|
||||
|
||||
@ -191,8 +166,6 @@ export BUILDTAGS="$BASEBUILDTAGS $(hack/btrfs_installed_tag.sh) $(hack/btrfs_tag
|
||||
|
||||
make docs docker-docs
|
||||
|
||||
# This will copy the files generated by the `make` command above into
|
||||
# the installable rpm package.
|
||||
%install
|
||||
PODMAN_VERSION=%{version} %{__make} DESTDIR=%{buildroot} PREFIX=%{_prefix} ETCDIR=%{buildroot}%{_sysconfdir} \
|
||||
install.bin \
|
||||
@ -202,16 +175,14 @@ PODMAN_VERSION=%{version} %{__make} DESTDIR=%{buildroot} PREFIX=%{_prefix} ETCDI
|
||||
install.docker \
|
||||
install.docker-docs \
|
||||
install.remote \
|
||||
%if 0%{?fedora} >= 36
|
||||
install.modules-load
|
||||
%endif
|
||||
|
||||
install -d -p %{buildroot}/%{_datadir}/%{name}/test/system
|
||||
cp -pav test/system %{buildroot}/%{_datadir}/%{name}/test/
|
||||
|
||||
# do not include docker and podman-remote man pages in main package
|
||||
# do not include docker and %%{name}-remote man pages in main package
|
||||
for file in `find %{buildroot}%{_mandir}/man[15] -type f | sed "s,%{buildroot},," | grep -v -e remote -e docker`; do
|
||||
echo "$file*" >> podman.file-list
|
||||
echo "$file*" >> %{name}.file-list
|
||||
done
|
||||
|
||||
%post
|
||||
@ -257,11 +228,7 @@ fi
|
||||
%{_userunitdir}/%{name}-kube@.service
|
||||
%{_tmpfilesdir}/%{name}.conf
|
||||
%{_user_tmpfilesdir}/%{name}-docker.conf
|
||||
%{_mandir}/man5/quadlet*.5*
|
||||
%{_mandir}/man5/podman-systemd.unit*.5*
|
||||
%if 0%{?fedora} >= 36
|
||||
%{_modulesloaddir}/%{name}-iptables.conf
|
||||
%endif
|
||||
|
||||
%files docker
|
||||
%{_bindir}/docker
|
||||
@ -283,7 +250,5 @@ fi
|
||||
%license LICENSE
|
||||
%{_datadir}/%{name}/test
|
||||
|
||||
# Finally, changes from the latest release of your application are generated from
|
||||
# your project's Git history. It will be empty until you make first annotated Git tag.
|
||||
%changelog
|
||||
{{{ git_dir_changelog }}}
|
||||
|
Reference in New Issue
Block a user