aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/obs/data/build_binpkg.Dockerfile
blob: 201c7e568202f0ce1216f65a1ec24301960538bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
ARG	DISTRO_FROM
FROM	${DISTRO_FROM}
ARG	DISTRO
ARG	UID

COPY	Release.key /tmp/Release.key

RUN	useradd --uid=${UID} -m user

# Only install build-essential here, and what's needed to add the Osmocom
# repository. Everything else must be defined as dependency in the package
# build recipe. For rpm-based distributions, there is no build-essential or
# similar package. Instead add relevant packages from prjconf, e.g.:
# https://build.opensuse.org/projects/CentOS:CentOS-8/prjconf
# For debian, make sure we don't have man pages as otherwise it takes some time
# to regenerate the manuals database when installing build dependencies.
# SYS#5818: using almalinux:8 instead of centos:8
RUN	case "$DISTRO" in \
	debian*) \
		echo "path-exclude=/usr/share/man/*" \
			> /etc/dpkg/dpkg.cfg.d/exclude-man-pages && \
		rm -rf /usr/share/man/ && \
		apt-get update && \
		apt-get install -y --no-install-recommends \
			build-essential \
			ca-certificates \
			fakeroot \
			git \
			gnupg2 \
			&& \
		apt-get clean \
		;; \
	almalinux*) \
		dnf -y install \
			autoconf \
			automake \
			binutils \
			dnf-utils \
			gcc \
			gcc-c++ \
			glibc-devel \
			libtool \
			make \
			redhat-rpm-config \
			rpm-build \
			rpmdevtools \
			wget && \
		yum config-manager --set-enabled powertools && \
		su user -c rpmdev-setuptree \
		;; \
	esac

# Add master repository, where packages immediately get updated after merging
# patches to master.
RUN	case "$DISTRO" in \
	debian:11) \
		apt-key add /tmp/Release.key && \
		rm /tmp/Release.key && \
		echo "deb https://downloads.osmocom.org/packages/osmocom:/master/Debian_11/ ./" \
			> /etc/apt/sources.list.d/osmocom-master.list \
		;; \
	almalinux:8) \
		{ echo "[network_osmocom_master]"; \
		  echo "name=Nightly packages of the Osmocom project (CentOS_8)"; \
		  echo "type=rpm-md"; \
		  echo "baseurl=https://downloads.osmocom.org/packages/osmocom:/master/CentOS_8/"; \
		  echo "gpgcheck=1"; \
		  echo "gpgkey=https://downloads.osmocom.org/packages/osmocom:/master/CentOS_8/repodata/repomd.xml.key"; \
		  echo "enabled=1"; \
		} > /etc/yum.repos.d/network:osmocom:master.repo \
		;; \
	*) \
		echo "can't install repo for $DISTRO" && \
		exit 1 \
		;; \
	esac

WORKDIR	/obs/