-
Notifications
You must be signed in to change notification settings - Fork 3
/
build-rpm-Dockerfile
34 lines (28 loc) · 1.38 KB
/
build-rpm-Dockerfile
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
FROM centos:8
ARG hypercane_version
# RPM build dependencies -- thanks: https://www.redhat.com/sysadmin/create-rpm-package
RUN dnf update -y
RUN dnf install -y rpmdevtools rpmlint glibc-langpack-en
# MementoEmbed build/install dependencies
RUN dnf install -y epel-release
RUN dnf install -y sed grep tar python3-virtualenv makeself which make gcc
# install Python3.8 separately and set it as the default
RUN dnf install -y python38
RUN alternatives --install /usr/bin/python unversioned-python /usr/bin/python3.8 1
# build the RPM
WORKDIR /root
RUN rpmdev-setuptree
# because QA_RPATHS=\$(( 0x0001|0x0010 )) does not appear to work
RUN sed -i '/QA_CHECK_RPATHS/d' /root/.rpmmacros
RUN printf "#!/bin/bash\nset -o xtrace\nQA_CHECK_RPATHS=0 QA_RPATHS=\$(( 0x0001|0x0010 )) rpmbuild -bs /root/rpmbuild/SPECS/hypercane.spec\nQA_CHECK_RPATHS=0 QA_RPATHS=\$(( 0x0001|0x0010 )) rpmbuild -bb /root/rpmbuild/SPECS/hypercane.spec\n" > /root/build-rpms.sh
RUN chmod 0700 ./build-rpms.sh
RUN cat ./build-rpms.sh
COPY source-distro/hypercane-${hypercane_version}.tar.gz ./rpmbuild/SOURCES
COPY hypercane.spec .
RUN sed "s/{{ hypercane_version }}/${hypercane_version}/g" ./hypercane.spec > /root/rpmbuild/SPECS/hypercane.spec
RUN ls -l ./rpmbuild/SPECS/
RUN rpmlint ./rpmbuild/SPECS/hypercane.spec
RUN cat /root/.rpmmacros
# keep running -- for debugging
# ENTRYPOINT [ "tail", "-f", "/dev/null"]
CMD ["/root/build-rpms.sh"]