github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/podman.spec.rpkg (about)

     1  # For automatic rebuilds in COPR
     2  
     3  # The following tag is to get correct syntax highlighting for this file in vim text editor
     4  # vim: syntax=spec
     5  
     6  %global with_debug 1
     7  
     8  %if 0%{?with_debug}
     9  %global _find_debuginfo_dwz_opts %{nil}
    10  %global _dwz_low_mem_die_limit 0
    11  %else
    12  %global debug_package %{nil}
    13  %endif
    14  
    15  %if ! 0%{?gobuild:1}
    16  %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 %{?**};
    17  %endif
    18  
    19  # git_dir_name returns repository name derived from remote Git repository URL
    20  Name:       {{{ git_dir_name }}}
    21  
    22  Epoch: 101
    23  
    24  # git_dir_version returns version based on commit and tag history of the Git project
    25  Version:    {{{ git_dir_version }}}
    26  
    27  # This can be useful later for adding downstream patches
    28  Release:    1%{?dist}
    29  
    30  # Basic description of the package
    31  Summary: Manage Pods, Containers and Container Images
    32  
    33  # License. We assume GPLv2+ here.
    34  License:   ASL 2.0
    35  
    36  # Home page of the project. Can also point to the public Git repository page.
    37  URL:        https://github.com/containers/podman
    38  
    39  # Detailed information about the source Git repository and the source commit
    40  # for the created rpm package
    41  VCS:        {{{ git_dir_vcs }}}
    42  
    43  # git_dir_pack macro places the repository content (the source files) into a tarball
    44  # and returns its filename. The tarball will be used to build the rpm.
    45  Source:     {{{ git_dir_pack }}}
    46  
    47  %if 0%{?fedora} && ! 0%{?rhel}
    48  BuildRequires: btrfs-progs-devel
    49  %endif
    50  BuildRequires: gcc
    51  BuildRequires: golang >= 1.16.6
    52  BuildRequires: glib2-devel
    53  BuildRequires: glibc-devel
    54  BuildRequires: glibc-static
    55  BuildRequires: git-core
    56  BuildRequires: go-md2man
    57  %if 0%{?fedora} || 0%{?rhel} >= 9
    58  BuildRequires: go-rpm-macros
    59  %endif
    60  %if 0%{?rhel} <= 8
    61  BuildRequires: pkgconfig(devmapper)
    62  %endif
    63  BuildRequires: gpgme-devel
    64  BuildRequires: libassuan-devel
    65  BuildRequires: libgpg-error-devel
    66  BuildRequires: libseccomp-devel
    67  BuildRequires: libselinux-devel
    68  BuildRequires: shadow-utils-subid-devel
    69  BuildRequires: pkgconfig
    70  BuildRequires: make
    71  BuildRequires: ostree-devel
    72  BuildRequires: systemd
    73  BuildRequires: systemd-devel
    74  Requires: conmon >= 2:2.0.30-2
    75  # containers-common pulled from podman-next copr for f34,
    76  # from the distro repos for f35+
    77  %if 0%{?fedora} <= 35
    78  Requires: containers-common >= 4:1-39
    79  %else
    80  Requires: containers-common >= 4:1-46
    81  %endif
    82  Requires: iptables
    83  Requires: nftables
    84  Recommends: catatonit
    85  Suggests: qemu-user-static
    86  
    87  # More detailed description of the package
    88  %description
    89  %{name} (Pod Manager) is a fully featured container engine that is a simple
    90  daemonless tool.  %{name} provides a Docker-CLI comparable command line that
    91  eases the transition from other container engines and allows the management of
    92  pods, containers and images.  Simply put: alias docker=%{name}.
    93  Most %{name} commands can be run as a regular user, without requiring
    94  additional privileges.
    95  
    96  %{name} uses Buildah(1) internally to create container images.
    97  Both tools share image (not container) storage, hence each can use or
    98  manipulate images (but not containers) created by the other.
    99  
   100  %package docker
   101  Summary: Emulate Docker CLI using %{name}
   102  BuildArch: noarch
   103  Requires: %{name} = %{epoch}:%{version}-%{release}
   104  Conflicts: docker
   105  Conflicts: docker-latest
   106  Conflicts: docker-ce
   107  Conflicts: docker-ee
   108  Conflicts: moby-engine
   109  
   110  %description docker
   111  This package installs a script named docker that emulates the Docker CLI by
   112  executes %{name} commands, it also creates links between all Docker CLI man
   113  pages and %{name}.
   114  
   115  %package tests
   116  Summary: Tests for %{name}
   117  Requires: %{name} = %{epoch}:%{version}-%{release}
   118  Requires: bats
   119  Requires: jq
   120  Requires: skopeo
   121  Requires: nmap-ncat
   122  Requires: httpd-tools
   123  Requires: openssl
   124  Requires: socat
   125  Requires: buildah
   126  Requires: gnupg
   127  
   128  %description tests
   129  %{summary}
   130  
   131  This package contains system tests for %{name}
   132  
   133  %package remote
   134  Summary: (Experimental) Remote client for managing %{name} containers
   135  
   136  %description remote
   137  Remote client for managing %{name} containers.
   138  
   139  %{name}-remote uses the libpod REST API to connect to a %{name} client to
   140  manage pods, containers and container images. %{name}-remote supports ssh
   141  connections as well.
   142  
   143  # The following four sections already describe the rpm build process itself.
   144  # prep will extract the tarball defined as Source above and descend into it.
   145  %prep
   146  {{{ git_dir_setup_macro }}}
   147  
   148  # This will invoke `make` command in the directory with the extracted sources.
   149  %build
   150  %set_build_flags
   151  %global gomodulesmode GO111MODULE=on
   152  export CGO_CFLAGS=$CFLAGS
   153  # These extra flags present in $CFLAGS have been skipped for now as they break the build
   154  CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-flto=auto//g')
   155  CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-Wp,D_GLIBCXX_ASSERTIONS//g')
   156  CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-specs=\/usr\/lib\/rpm\/redhat\/redhat-annobin-cc1//g')
   157  
   158  %ifarch x86_64
   159  export CGO_CFLAGS+=" -m64 -mtune=generic -fcf-protection=full"
   160  %endif
   161  
   162  %if 0%{?rhel}
   163  rm -rf vendor/github.com/containers/storage/drivers/register/register_btrfs.go
   164  %endif
   165  
   166  # build date. FIXME: Makefile uses '/v2/libpod', that doesn't work here?
   167  LDFLAGS="-X ./libpod/define.buildInfo=$(date +%s)"
   168  
   169  # build rootlessport first
   170  %gobuild -o bin/rootlessport ./cmd/rootlessport
   171  
   172  # set base buildtags common to both %%{name} and %%{name}-remote
   173  export BASEBUILDTAGS="seccomp exclude_graphdriver_devicemapper $(hack/selinux_tag.sh) $(hack/systemd_tag.sh) $(hack/libsubid_tag.sh)"
   174  
   175  # build %%{name}
   176  export BUILDTAGS="$BASEBUILDTAGS $(hack/btrfs_installed_tag.sh) $(hack/btrfs_tag.sh)"
   177  %gobuild -o bin/%{name} ./cmd/%{name}
   178  
   179  # build %%{name}-remote
   180  export BUILDTAGS="$BASEBUILDTAGS exclude_graphdriver_btrfs btrfs_noversion remote"
   181  %gobuild -o bin/%{name}-remote ./cmd/%{name}
   182  
   183  make docs docker-docs
   184  
   185  # This will copy the files generated by the `make` command above into
   186  # the installable rpm package.
   187  %install
   188  PODMAN_VERSION=%{version} %{__make} DESTDIR=%{buildroot} PREFIX=%{_prefix} ETCDIR=%{buildroot}%{_sysconfdir} \
   189          install.bin \
   190          install.man \
   191          install.systemd \
   192          install.completions \
   193          install.docker \
   194          install.docker-docs \
   195          install.remote \
   196  %if 0%{?fedora} >= 36
   197          install.modules-load
   198  %endif
   199  
   200  install -d -p %{buildroot}/%{_datadir}/%{name}/test/system
   201  cp -pav test/system %{buildroot}/%{_datadir}/%{name}/test/
   202  
   203  mv pkg/hooks/README.md pkg/hooks/README-hooks.md
   204  
   205  # do not include docker and podman-remote man pages in main package
   206  for file in `find %{buildroot}%{_mandir}/man[15] -type f | sed "s,%{buildroot},," | grep -v -e remote -e docker`; do
   207      echo "$file*" >> podman.file-list
   208  done
   209  
   210  # This lists all the files that are included in the rpm package and that
   211  # are going to be installed into target system where the rpm is installed.
   212  %files -f %{name}.file-list
   213  %license LICENSE
   214  %doc README.md CONTRIBUTING.md pkg/hooks/README-hooks.md install.md transfer.md
   215  %{_bindir}/%{name}
   216  %dir %{_libexecdir}/%{name}
   217  %{_libexecdir}/%{name}/rootlessport
   218  %{_datadir}/bash-completion/completions/%{name}
   219  # By "owning" the site-functions dir, we don't need to Require zsh
   220  %dir %{_datadir}/zsh/site-functions
   221  %{_datadir}/zsh/site-functions/_%{name}
   222  %dir %{_datadir}/fish/vendor_completions.d
   223  %{_datadir}/fish/vendor_completions.d/%{name}.fish
   224  %{_unitdir}/%{name}-auto-update.service
   225  %{_unitdir}/%{name}-auto-update.timer
   226  %{_unitdir}/%{name}.service
   227  %{_unitdir}/%{name}.socket
   228  %{_unitdir}/%{name}-restart.service
   229  %{_unitdir}/%{name}-play-kube@.service
   230  %{_userunitdir}/%{name}-auto-update.service
   231  %{_userunitdir}/%{name}-auto-update.timer
   232  %{_userunitdir}/%{name}.service
   233  %{_userunitdir}/%{name}.socket
   234  %{_userunitdir}/%{name}-restart.service
   235  %{_userunitdir}/%{name}-play-kube@.service
   236  %{_tmpfilesdir}/%{name}.conf
   237  %if 0%{?fedora} >= 36
   238  %{_modulesloaddir}/%{name}-iptables.conf
   239  %endif
   240  
   241  %files docker
   242  %{_bindir}/docker
   243  %{_mandir}/man1/docker*.1*
   244  %{_mandir}/man5/docker*.5*
   245  %{_usr}/lib/tmpfiles.d/%{name}-docker.conf
   246  
   247  %files remote
   248  %license LICENSE
   249  %{_bindir}/%{name}-remote
   250  %{_mandir}/man1/%{name}-remote*.*
   251  %{_datadir}/bash-completion/completions/%{name}-remote
   252  %dir %{_datadir}/fish/vendor_completions.d
   253  %{_datadir}/fish/vendor_completions.d/%{name}-remote.fish
   254  %dir %{_datadir}/zsh/site-functions
   255  %{_datadir}/zsh/site-functions/_%{name}-remote
   256  
   257  %files tests
   258  %license LICENSE
   259  %{_datadir}/%{name}/test
   260  
   261  # Finally, changes from the latest release of your application are generated from
   262  # your project's Git history. It will be empty until you make first annotated Git tag.
   263  %changelog
   264  {{{ git_dir_changelog }}}