aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rwxr-xr-x[-rw-r--r--]contrib/build_rpm.sh43
-rw-r--r--contrib/cirrus/lib.sh6
-rwxr-xr-xcontrib/cirrus/packer/systemd_banish.sh2
-rw-r--r--contrib/spec/podman.spec.in46
4 files changed, 66 insertions, 31 deletions
diff --git a/contrib/build_rpm.sh b/contrib/build_rpm.sh
index 1132ef380..e41763fa7 100644..100755
--- a/contrib/build_rpm.sh
+++ b/contrib/build_rpm.sh
@@ -1,15 +1,12 @@
#!/bin/bash
-set -x
-
-pkg_manager=`command -v dnf`
-if [ -z "$pkg_manager" ]; then
- pkg_manager=`command -v yum`
-fi
+set -euxo pipefail
+# returned path can vary: /usr/bin/dnf /bin/dnf ...
+pkg_manager=`command -v dnf yum | head -n1`
echo "Package manager binary: $pkg_manager"
-if [ $pkg_manager == "/usr/bin/yum" ]; then
+if [[ $pkg_manager == *yum ]]; then
echo "[virt7-container-common-candidate]
name=virt7-container-common-candidate
baseurl=https://cbs.centos.org/repos/virt7-container-common-candidate/x86_64/os/
@@ -22,35 +19,39 @@ declare -a PKGS=(device-mapper-devel \
glib2-devel \
glibc-static \
golang \
- golang-github-cpuguy83-go-md2man \
gpgme-devel \
libassuan-devel \
libseccomp-devel \
libselinux-devel \
make \
- golang-github-cpuguy83-go-md2man \
rpm-build \
- btrfs-progs-devel \
go-compilers-golang-compiler \
)
-if [ $pkg_manager == "/usr/bin/dnf" ]; then
+if [[ $pkg_manager == *dnf ]]; then
PKGS+=(python3-devel \
python3-varlink \
)
+ # btrfs-progs-devel is not available in CentOS/RHEL-8
+ if ! grep -i -q 'Red Hat\|CentOS' /etc/redhat-release; then
+ PKGS+=(btrfs-progs-devel)
+ fi
+ # disable doc until go-md2man rpm becomes available
+ # disable debug to avoid error: Empty %files file ~/rpmbuild/BUILD/libpod-.../debugsourcefiles.list
+ export extra_arg="--without doc --without debug"
+else
+ if ! grep -i -q 'Red Hat\|CentOS' /etc/redhat-release; then
+ PKGS+=(golang-github-cpuguy83-go-md2man)
+ fi
fi
echo ${PKGS[*]}
-$pkg_manager install -y ${PKGS[*]}
+sudo $pkg_manager install -y ${PKGS[*]}
make -f .copr/Makefile
-rpmbuild --rebuild podman-*.src.rpm
-
-# Test to make sure the install of the binary works
-$pkg_manager -y install ~/rpmbuild/RPMS/x86_64/podman-*.x86_64.rpm
-
-
-# If we built python/varlink packages, we should test their installs too
-if [ $pkg_manager == "/usr/bin/dnf" ]; then
- $pkg_manager -y install ~/rpmbuild/RPMS/noarch/python*
+# workaround for https://github.com/containers/libpod/issues/4627
+if [ -d ~/rpmbuild/BUILD ]; then
+ chmod -R +w ~/rpmbuild/BUILD
fi
+
+rpmbuild --rebuild ${extra_arg:-} podman-*.src.rpm
diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh
index 297ed49ce..2e43a59f6 100644
--- a/contrib/cirrus/lib.sh
+++ b/contrib/cirrus/lib.sh
@@ -12,7 +12,7 @@ HOME="$(getent passwd $USER | cut -d : -f 6)"
[[ -n "$UID" ]] || UID=$(getent passwd $USER | cut -d : -f 3)
GID=$(getent passwd $USER | cut -d : -f 4)
-# Essential default paths, many are overriden when executing under Cirrus-CI
+# Essential default paths, many are overridden when executing under Cirrus-CI
export GOPATH="${GOPATH:-/var/tmp/go}"
if type -P go &> /dev/null
then
@@ -82,7 +82,7 @@ PERIODIC_APT_RE='^(APT::Periodic::.+")1"\;'
LILTO="timeout_attempt_delay_command 24s 5 30s"
BIGTO="timeout_attempt_delay_command 300s 5 30s"
-# Safe env. vars. to transfer from root -> $ROOTLESS_USER (go env handled separetly)
+# Safe env. vars. to transfer from root -> $ROOTLESS_USER (go env handled separately)
ROOTLESS_ENV_RE='(CIRRUS_.+)|(ROOTLESS_.+)|(.+_IMAGE.*)|(.+_BASE)|(.*DIRPATH)|(.*FILEPATH)|(SOURCE.*)|(DEPEND.*)|(.+_DEPS_.+)|(OS_REL.*)|(.+_ENV_RE)|(TRAVIS)|(CI.+)|(TEST_REMOTE.*)'
# Unsafe env. vars for display
SECRET_ENV_RE='(IRCID)|(ACCOUNT)|(GC[EP]..+)|(SSH)'
@@ -319,7 +319,7 @@ setup_rootless() {
tee -a /etc/subuid >> /etc/subgid
# Env. vars set by Cirrus and setup_environment.sh must be explicitly
- # transfered to the test-user.
+ # transferred to the test-user.
echo "Configuring rootless user's environment variables:"
echo "# Added by $GOSRC/$SCRIPT_PATH/lib.sh setup_rootless()"
_ENV_VAR_NAMES=$(awk 'BEGIN{for(v in ENVIRON) print v}' | \
diff --git a/contrib/cirrus/packer/systemd_banish.sh b/contrib/cirrus/packer/systemd_banish.sh
index 396cf906c..6e2dd9c3e 100755
--- a/contrib/cirrus/packer/systemd_banish.sh
+++ b/contrib/cirrus/packer/systemd_banish.sh
@@ -3,7 +3,7 @@
set +e # Not all of these exist on every platform
# This is intended to be executed on VMs as a startup script on initial-boot.
-# Alternativly, it may be executed with the '--list' option to return the list
+# Alternatively, it may be executed with the '--list' option to return the list
# of systemd units defined for disablement (useful for testing).
EVIL_UNITS="cron crond atd apt-daily-upgrade apt-daily fstrim motd-news systemd-tmpfiles-clean"
diff --git a/contrib/spec/podman.spec.in b/contrib/spec/podman.spec.in
index 33ecc8eba..2b9621dbc 100644
--- a/contrib/spec/podman.spec.in
+++ b/contrib/spec/podman.spec.in
@@ -1,8 +1,9 @@
%global with_devel 0
%global with_bundled 1
-%global with_debug 1
%global with_check 0
%global with_unit_test 0
+%bcond_without doc
+%bcond_without debug
%if 0%{?fedora} >= 28
%bcond_without varlink
@@ -10,7 +11,7 @@
%bcond_with varlink
%endif
-%if 0%{?with_debug}
+%if %{with debug}
%global _find_debuginfo_dwz_opts %{nil}
%global _dwz_low_mem_die_limit 0
%else
@@ -39,7 +40,7 @@
%global shortcommit_conmon %(c=%{commit_conmon}; echo ${c:0:7})
Name: podman
-Version: 1.6.4
+Version: 1.7.0
Release: #COMMITDATE#.git%{shortcommit0}%{?dist}
Summary: Manage Pods, Containers and Container Images
License: ASL 2.0
@@ -52,12 +53,17 @@ ExclusiveArch: aarch64 %{arm} ppc64le s390x x86_64
# The COPR process will uncomment this
#BuildRequires: golang-bin
#
+# btrfs-progs-devel package is not available in CentOS/RHEL-8
+%if 0%{?rhel} != 8 && 0%{?centos} != 8
BuildRequires: btrfs-progs-devel
+%endif
BuildRequires: glib2-devel
BuildRequires: glibc-devel
BuildRequires: glibc-static
BuildRequires: git
+%if %{with doc}
BuildRequires: go-md2man
+%endif
BuildRequires: gpgme-devel
BuildRequires: libassuan-devel
BuildRequires: libgpg-error-devel
@@ -349,6 +355,15 @@ This package contains unit tests for project
providing packages with %{import_path} prefix.
%endif
+%if %{with doc}
+%package manpages
+Summary: Man pages for the %{name} commands
+BuildArch: noarch
+
+%description manpages
+Man pages for the %{name} commands
+%endif
+
%prep
%autosetup -Sgit -n %{repo}-%{shortcommit0}
@@ -357,7 +372,9 @@ tar zxf %{SOURCE1}
sed -i 's/install.remote: podman-remote/install.remote:/' Makefile
sed -i 's/install.bin: podman/install.bin:/' Makefile
+%if %{with doc}
sed -i 's/install.man: docs/install.man:/' Makefile
+%endif
%build
mkdir _build
@@ -370,8 +387,12 @@ export GOPATH=$(pwd)/_build:$(pwd):$(pwd):%{gopath}
export BUILDTAGS="varlink selinux seccomp $(hack/btrfs_installed_tag.sh) $(hack/btrfs_tag.sh) $(hack/libdm_tag.sh) exclude_graphdriver_devicemapper"
GOPATH=$GOPATH go generate ./cmd/podman/varlink/...
-BUILDTAGS=$BUILDTAGS make binaries docs
+%if %{with doc}
+BUILDTAGS=$BUILDTAGS make binaries docs
+%else
+BUILDTAGS=$BUILDTAGS make binaries
+%endif
# build conmon
pushd conmon
@@ -388,6 +409,7 @@ popd
%install
install -dp %{buildroot}%{_unitdir}
install -dp %{buildroot}%{_usr}/lib/systemd/user
+%if %{with doc}
PODMAN_VERSION=%{version} %{__make} PREFIX=%{buildroot}%{_prefix} ETCDIR=%{buildroot}%{_sysconfdir} \
install.bin \
install.remote \
@@ -395,6 +417,14 @@ PODMAN_VERSION=%{version} %{__make} PREFIX=%{buildroot}%{_prefix} ETCDIR=%{build
install.cni \
install.systemd \
install.completions
+%else
+PODMAN_VERSION=%{version} %{__make} PREFIX=%{buildroot}%{_prefix} ETCDIR=%{buildroot}%{_sysconfdir} \
+ install.bin \
+ install.remote \
+ install.cni \
+ install.systemd \
+ install.completions
+%endif
mv pkg/hooks/README.md pkg/hooks/README-hooks.md
@@ -477,8 +507,6 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath}
%license LICENSE
%doc README.md CONTRIBUTING.md pkg/hooks/README-hooks.md install.md code-of-conduct.md transfer.md
%{_bindir}/%{name}
-%{_mandir}/man1/*.1*
-%{_mandir}/man5/*.5*
%{_datadir}/bash-completion/completions/*
%{_datadir}/zsh/site-functions/*
%{_libexecdir}/%{name}/conmon
@@ -508,6 +536,12 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath}
%doc README.md CONTRIBUTING.md pkg/hooks/README-hooks.md install.md code-of-conduct.md transfer.md
%{_bindir}/%{name}-remote
+%if %{with doc}
+%files manpages
+%{_mandir}/man1/*.1*
+%{_mandir}/man5/*.5*
+%endif
+
%changelog
* Sat Aug 4 2018 Dan Walsh <dwalsh@redhat.com> - 0.8.1-1.git6b4ab2a
- Bump to v0.8.1