Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build debuginfo packages for leap 15 #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions libfabric.spec
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ Requires: libpsm2-devel >= 11.2.78
%description devel
Development files for the libfabric library.

%if (0%{?suse_version} > 0)
%global __debug_package 1
%global _debuginfo_subpackages 0
%debug_package
%endif

%prep
%autosetup -p1 -n libfabric-%dl_version

Expand Down
5 changes: 4 additions & 1 deletion packaging/Dockerfile.mockbuild
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Pull base image
FROM fedora:latest
MAINTAINER daos-stack <daos@daos.groups.io>
LABEL maintainer="daos@daos.groups.io>"

# use same UID as host and default value of 1000 if not specified
ARG UID=1000
Expand All @@ -28,3 +28,6 @@ RUN usermod -a -G mock $USER
RUN grep use_nspawn /etc/mock/site-defaults.cfg || \
echo "config_opts['use_nspawn'] = False" >> /etc/mock/site-defaults.cfg

ARG CACHEBUST
RUN dnf -y upgrade && \
dnf clean all
44 changes: 26 additions & 18 deletions packaging/Makefile_distro_vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,38 @@ SPECTOOL := spectool
# DISTRO_BASE (i.e. EL_7)
# from the CHROOT_NAME
ifeq ($(CHROOT_NAME),epel-7-x86_64)
DIST := $(shell rpm $(COMMON_RPM_ARGS) --eval %{?dist})
VERSION_ID := 7
DISTRO_ID := el7
DISTRO_BASE := EL_7
SED_EXPR := 1s/$(DIST)//p
DIST := $(shell rpm $(COMMON_RPM_ARGS) --eval %{?dist})
VERSION_ID := 7
DISTRO_ID := el7
DISTRO_BASE := EL_7
DISTRO_VERSION ?= $(VERSION_ID)
ORIG_TARGET_VER := 7
SED_EXPR := 1s/$(DIST)//p
endif
ifeq ($(CHROOT_NAME),epel-8-x86_64)
DIST := $(shell rpm $(COMMON_RPM_ARGS) --eval %{?dist})
VERSION_ID := 8
DISTRO_ID := el8
DISTRO_BASE := EL_8
SED_EXPR := 1s/$(DIST)//p
DIST := $(shell rpm $(COMMON_RPM_ARGS) --eval %{?dist})
VERSION_ID := 8
DISTRO_ID := el8
DISTRO_BASE := EL_8
DISTRO_VERSION ?= $(VERSION_ID)
ORIG_TARGET_VER := 8
SED_EXPR := 1s/$(DIST)//p
endif
ifeq ($(CHROOT_NAME),opensuse-leap-15.2-x86_64)
VERSION_ID := 15.2
DISTRO_ID := sl15.2
DISTRO_BASE := LEAP_15
SED_EXPR := 1p
VERSION_ID := 15.2
DISTRO_ID := sl15.2
DISTRO_BASE := LEAP_15
DISTRO_VERSION ?= $(VERSION_ID)
ORIG_TARGET_VER := 15.2
SED_EXPR := 1p
endif
ifeq ($(CHROOT_NAME),opensuse-leap-15.3-x86_64)
VERSION_ID := 15.3
DISTRO_ID := sl15.3
DISTRO_BASE := LEAP_15
SED_EXPR := 1p
VERSION_ID := 15.3
DISTRO_ID := sl15.3
DISTRO_BASE := LEAP_15
DISTRO_VERSION ?= $(VERSION_ID)
ORIG_TARGET_VER := 15.2
SED_EXPR := 1p
endif
endif
ifeq ($(ID),centos)
Expand Down
113 changes: 86 additions & 27 deletions packaging/Makefile_packaging.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ SHELL=/bin/bash
-include Makefile.local

# default to Leap 15 distro for chrootbuild
ifeq ($(MAKECMDGOALS),chrootbuild)
CHROOT_NAME ?= opensuse-leap-15.2-x86_64
endif
include packaging/Makefile_distro_vars.mk

ifeq ($(DEB_NAME),)
Expand Down Expand Up @@ -44,7 +46,21 @@ EL_7_PR_REPOS ?= $(shell git show -s --format=%B | sed -ne 's/^PR-rep
EL_8_PR_REPOS ?= $(shell git show -s --format=%B | sed -ne 's/^PR-repos-el8: *\(.*\)/\1/p')
UBUNTU_20_04_PR_REPOS ?= $(shell git show -s --format=%B | sed -ne 's/^PR-repos-ubuntu20: *\(.*\)/\1/p')

ifneq ($(PKG_GIT_COMMIT),)
ifeq ($(GITHUB_PROJECT),)
ifeq ($(GIT_PROJECT),)
$(error You must set either GITHUB_PROJECT or GIT_PROJECT if you set PKG_GIT_COMMIT)
endif
endif
BUILD_DEFINES := --define "commit $(PKG_GIT_COMMIT)"
RPM_BUILD_OPTIONS := $(BUILD_DEFINES)
GIT_DIFF_EXCLUDES := $(PATCH_EXCLUDE_FILES:%=':!%')
endif

COMMON_RPM_ARGS := --define "_topdir $$PWD/_topdir" $(BUILD_DEFINES)
ifneq ($(CHROOT_NAME),)
COMMON_RPM_ARGS += --define "chroot_name $(CHROOT_NAME)" $(BUILD_DEFINES)
endif
SPEC := $(shell if [ -f $(NAME)-$(DISTRO_BASE).spec ]; then echo $(NAME)-$(DISTRO_BASE).spec; else echo $(NAME).spec; fi)
VERSION = $(eval VERSION := $(shell rpm $(COMMON_RPM_ARGS) --specfile --qf '%{version}\n' $(SPEC) | sed -n '1p'))$(VERSION)
DEB_RVERS := $(subst $(DOT),\$(DOT),$(VERSION))
Expand Down Expand Up @@ -291,37 +307,80 @@ debs: $(DEBS)
ls: $(TARGETS)
ls -ld $^

ifneq ($(PKG_GIT_COMMIT),)
# This not really intended to run in CI. It's meant as a developer
# convenience to generate the needed patch and add it to the repo to
# be committed.
$(VERSION)..$(PKG_GIT_COMMIT).patch:
ifneq ($(GITHUB_PROJECT),)
# it really sucks that GitHub's "compare" returns such dirty patches
#curl -O 'https://github.com/$(GITHUB_PROJECT)/compare/$@'
git clone https://github.com/$(GITHUB_PROJECT).git
else
git clone $(GIT_PROJECT)
endif
set -x; pushd $(NAME) && \
trap 'popd && rm -rf $(NAME)' EXIT; \
echo git diff $(VERSION)..$(PKG_GIT_COMMIT) --stat -- \
$(GIT_DIFF_EXCLUDES ); \
git diff $(VERSION)..$(PKG_GIT_COMMIT) -- \
$(GIT_DIFF_EXCLUDES) > ../$@; \
popd; \
trap 'rm -rf $(NAME)' EXIT; \
git add $@
patch: $(VERSION)..$(PKG_GIT_COMMIT).patch
else
patch:
echo "PKG_GIT_COMMIT is not defined"
endif

# *_LOCAL_* repos are locally built packages.
# *_GROUP_* repos are a local mirror of a group of upstream repos.
# *_GROUP_* repos may not supply a repomd.xml.key.
ifeq ($(LOCAL_REPOS),true)
ifneq ($(REPOSITORY_URL),)
ifneq ($(DAOS_STACK_$(DISTRO_BASE)_$(DAOS_REPO_TYPE)_REPO),)
ifeq ($(ID_LIKE),debian)
# $(DISTRO_BASE)_LOCAL_REPOS is a list separated by | because you cannot pass lists
# of values with spaces as environment variables
$(DISTRO_BASE)_LOCAL_REPOS := [trusted=yes]
endif
$(DISTRO_BASE)_LOCAL_REPOS := $($(DISTRO_BASE)_LOCAL_REPOS) $(REPOSITORY_URL)$(DAOS_STACK_$(DISTRO_BASE)_$(DAOS_REPO_TYPE)_REPO)/
endif
$(DISTRO_BASE)_LOCAL_REPOS := $($(DISTRO_BASE)_LOCAL_REPOS)|
ifneq ($(DAOS_STACK_$(DISTRO_BASE)_DOCKER_$(DAOS_REPO_TYPE)_REPO),)
DISTRO_REPOS = $(DAOS_STACK_$(DISTRO_BASE)_DOCKER_$(DAOS_REPO_TYPE)_REPO)
$(DISTRO_BASE)_LOCAL_REPOS := $($(DISTRO_BASE)_LOCAL_REPOS)$(REPOSITORY_URL)$(DAOS_STACK_$(DISTRO_BASE)_DOCKER_$(DAOS_REPO_TYPE)_REPO)/|
endif
ifneq ($(DAOS_STACK_$(DISTRO_BASE)_APPSTREAM_REPO),)
$(DISTRO_BASE)_LOCAL_REPOS := $($(DISTRO_BASE)_LOCAL_REPOS)$(REPOSITORY_URL)$(DAOS_STACK_$(DISTRO_BASE)_APPSTREAM_REPO)|
endif
ifneq ($(DAOS_STACK_$(DISTRO_BASE)_POWERTOOLS_REPO),)
$(DISTRO_BASE)_LOCAL_REPOS := $($(DISTRO_BASE)_LOCAL_REPOS)$(REPOSITORY_URL)$(DAOS_STACK_$(DISTRO_BASE)_POWERTOOLS_REPO)|
endif
ifneq ($(ID_LIKE),debian)
ifneq ($(DAOS_STACK_INTEL_ONEAPI_REPO),)
$(DISTRO_BASE)_LOCAL_REPOS := $($(DISTRO_BASE)_LOCAL_REPOS)$(REPOSITORY_URL)$(DAOS_STACK_INTEL_ONEAPI_REPO)|
endif
endif
endif
endif
ifneq ($(REPOSITORY_URL),)
# group repos are not working in Nexus so we hack in the group members directly below
#ifneq ($(DAOS_STACK_$(DISTRO_BASE)_DOCKER_$(DAOS_REPO_TYPE)_REPO),)
#DISTRO_REPOS = $(DAOS_STACK_$(DISTRO_BASE)_DOCKER_$(DAOS_REPO_TYPE)_REPO)
#$(DISTRO_BASE)_LOCAL_REPOS := $($(DISTRO_BASE)_LOCAL_REPOS)|$(REPOSITORY_URL)$(DAOS_STACK_$(DISTRO_BASE)_DOCKER_$(DAOS_REPO_TYPE)_REPO)/
#endif
ifneq ($(DAOS_STACK_$(DISTRO_BASE)_$(DAOS_REPO_TYPE)_REPO),)
ifeq ($(ID_LIKE),debian)
# $(DISTRO_BASE)_LOCAL_REPOS is a list separated by | because you cannot pass lists
# of values with spaces as environment variables
$(DISTRO_BASE)_LOCAL_REPOS := [trusted=yes]
else
$(DISTRO_BASE)_LOCAL_REPOS := $(REPOSITORY_URL)$(DAOS_STACK_$(DISTRO_BASE)_LOCAL_REPO)
DISTRO_REPOS = disabled # any non-empty value here works and is not used beyond testing if the value is empty or not
endif # ifeq ($(ID_LIKE),debian)
ifeq ($(DISTRO_BASE), EL_8)
# hack to use 8.3 non-group repos on EL_8
$(DISTRO_BASE)_LOCAL_REPOS := $($(DISTRO_BASE)_LOCAL_REPOS)|$(subst $(ORIG_TARGET_VER),$(DISTRO_VERSION),$(REPOSITORY_URL)repository/centos-8.3-base-x86_64-proxy|$(REPOSITORY_URL)repository/centos-8.3-extras-x86_64-proxy|$(REPOSITORY_URL)repository/epel-el-8-x86_64-proxy)
else ifeq ($(DISTRO_BASE), EL_7)
# hack to use 7.9 non-group repos on EL_7
$(DISTRO_BASE)_LOCAL_REPOS := $($(DISTRO_BASE)_LOCAL_REPOS)|$(subst $(ORIG_TARGET_VER),$(DISTRO_VERSION),$(REPOSITORY_URL)repository/centos-7.9-base-x86_64-proxy|$(REPOSITORY_URL)repository/centos-7.9-extras-x86_64-proxy|$(REPOSITORY_URL)repository/centos-7.9-updates-x86_64-proxy|$(REPOSITORY_URL)repository/epel-el-7-x86_64-proxy)
else ifeq ($(DISTRO_BASE), LEAP_15)
# hack to use 15 non-group repos on LEAP_15
$(DISTRO_BASE)_LOCAL_REPOS := $($(DISTRO_BASE)_LOCAL_REPOS)|$(subst $(ORIG_TARGET_VER),$(DISTRO_VERSION),$(REPOSITORY_URL)repository/opensuse-15.2-oss-x86_64-proxy|$(REPOSITORY_URL)repository/opensuse-15.2-update-oss-x86_64-provo-mirror-proxy|$(REPOSITORY_URL)repository/opensuse-15.2-update-non-oss-x86_64-proxy|$(REPOSITORY_URL)repository/opensuse-15.2-non-oss-x86_64-proxy|$(REPOSITORY_URL)repository/opensuse-15.2-repo-sle-update-proxy|$(REPOSITORY_URL)repository/opensuse-15.2-repo-backports-update-proxy)
else
# debian
$(DISTRO_BASE)_LOCAL_REPOS := $($(DISTRO_BASE)_LOCAL_REPOS) $(REPOSITORY_URL)$(DAOS_STACK_$(DISTRO_BASE)_$(DAOS_REPO_TYPE)_REPO)
endif # ifeq ($(DISTRO_BASE), *)
endif #ifneq ($(DAOS_STACK_$(DISTRO_BASE)_$(DAOS_REPO_TYPE)_REPO),)
ifneq ($(DAOS_STACK_$(DISTRO_BASE)_APPSTREAM_REPO),)
$(DISTRO_BASE)_LOCAL_REPOS := $($(DISTRO_BASE)_LOCAL_REPOS)|$(REPOSITORY_URL)$(DAOS_STACK_$(DISTRO_BASE)_APPSTREAM_REPO)
endif
# group repos are not working in Nexus so we hack in the group members directly above
ifneq ($(DAOS_STACK_$(DISTRO_BASE)_POWERTOOLS_REPO),)
$(DISTRO_BASE)_LOCAL_REPOS := $($(DISTRO_BASE)_LOCAL_REPOS)|$(REPOSITORY_URL)$(DAOS_STACK_$(DISTRO_BASE)_POWERTOOLS_REPO)
endif
ifneq ($(ID_LIKE),debian)
ifneq ($(DAOS_STACK_INTEL_ONEAPI_REPO),)
$(DISTRO_BASE)_LOCAL_REPOS := $($(DISTRO_BASE)_LOCAL_REPOS)|$(REPOSITORY_URL)$(DAOS_STACK_INTEL_ONEAPI_REPO)
endif # ifneq ($(DAOS_STACK_INTEL_ONEAPI_REPO),)
endif # ifneq ($(ID_LIKE),debian)
endif # ifneq ($(REPOSITORY_URL),)
endif # ifeq ($(LOCAL_REPOS),true)
ifeq ($(ID_LIKE),debian)
chrootbuild: $(DEB_TOP)/$(DEB_DSC)
$(call distro_map) \
Expand Down
6 changes: 3 additions & 3 deletions packaging/rpm_chrootbuild
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fi
: "${WORKSPACE:=$PWD}"
mock_config_dir="$WORKSPACE/mock"
original_cfg_file="/etc/mock/${CHROOT_NAME}.cfg"
cfg_file="$mock_config_dir/${CHROOT_NAME}_daos.cfg"
cfg_file="$mock_config_dir/${CHROOT_NAME}.cfg"
mkdir -p "$mock_config_dir"
ln -sf /etc/mock/templates "$mock_config_dir/"
ln -sf /etc/mock/logging.ini "$mock_config_dir/"
Expand Down Expand Up @@ -57,6 +57,6 @@ done
echo "\"\"\"" >> "$cfg_file"

# shellcheck disable=SC2086
eval mock --configdir "$mock_config_dir" -r "${CHROOT_NAME}_daos" \
"${repo_dels[*]}" "${repo_adds[*]}" \
eval mock --configdir "$mock_config_dir" -r "${CHROOT_NAME}" \
${repo_dels[*]} ${repo_adds[*]} \
$MOCK_OPTIONS $RPM_BUILD_OPTIONS "$TARGET"