parent
c846da4f9e
commit
88038d9644
@ -1,15 +1,36 @@
|
|||||||
FROM fedora:29
|
FROM fedora:29
|
||||||
ARG HOME=/build
|
# Docker build arguments
|
||||||
RUN mkdir /build && \
|
ARG SOURCE_DIR=/jellyfin
|
||||||
dnf install -y @buildsys-build rpmdevtools dnf-plugins-core && \
|
ARG PLATFORM_DIR=/jellyfin/deployment/fedora-package-x64
|
||||||
dnf copr enable -y @dotnet-sig/dotnet && \
|
ARG ARTIFACT_DIR=/dist
|
||||||
rpmdev-setuptree
|
ARG SDK_VERSION=2.2
|
||||||
|
# Docker run environment
|
||||||
WORKDIR /build/rpmbuild
|
ENV SOURCE_DIR=/jellyfin
|
||||||
COPY ./deployment/fedora-package-x64/pkg-src/jellyfin.spec SPECS
|
ENV ARTIFACT_DIR=/dist
|
||||||
COPY ./deployment/fedora-package-x64/pkg-src/ SOURCES
|
|
||||||
|
# Prepare Fedora build environment
|
||||||
RUN spectool -g -R SPECS/jellyfin.spec && \
|
RUN dnf update -y \
|
||||||
rpmbuild -bs SPECS/jellyfin.spec && \
|
&& dnf install -y @buildsys-build rpmdevtools dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel \
|
||||||
dnf build-dep -y SRPMS/jellyfin-*.src.rpm && \
|
&& dnf copr enable -y @dotnet-sig/dotnet \
|
||||||
rpmbuild -bb SPECS/jellyfin.spec;
|
&& rpmdev-setuptree \
|
||||||
|
&& dnf install -y dotnet-sdk-${SDK_VERSION}
|
||||||
|
|
||||||
|
# Link to docker-build script
|
||||||
|
RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh
|
||||||
|
|
||||||
|
# Link to RPM spec; mkdir needed or it fails, can't force dest
|
||||||
|
RUN mkdir -p ${SOURCE_DIR}/SPECS \
|
||||||
|
&& ln -s ${PLATFORM_DIR}/pkg-src/jellyfin.spec ${SOURCE_DIR}/SPECS/jellyfin.spec
|
||||||
|
|
||||||
|
# Link to RPM sources; mkdir needed or it fails, can't force dest
|
||||||
|
RUN mkdir -p ${SOURCE_DIR}/SOURCES \
|
||||||
|
&& ln -s ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/SOURCES
|
||||||
|
|
||||||
|
# Prepare artifact volume
|
||||||
|
VOLUME ${ARTIFACT_DIR}/
|
||||||
|
|
||||||
|
# Copy repository
|
||||||
|
COPY . ${SOURCE_DIR}/
|
||||||
|
|
||||||
|
# Set docker-build entrypoint
|
||||||
|
ENTRYPOINT ["/docker-build.sh"]
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Builds the RPM inside the Docker container
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
set -o xtrace
|
||||||
|
|
||||||
|
# Move to source directory
|
||||||
|
pushd ${SOURCE_DIR}
|
||||||
|
|
||||||
|
ls -al SOURCES/pkg-src/
|
||||||
|
|
||||||
|
# Build RPM
|
||||||
|
spectool -g -R SPECS/jellyfin.spec
|
||||||
|
rpmbuild -bs SPECS/jellyfin.spec --define "_sourcedir ${SOURCE_DIR}/SOURCES/pkg-src/"
|
||||||
|
rpmbuild -bb SPECS/jellyfin.spec --define "_sourcedir ${SOURCE_DIR}/SOURCES/pkg-src/"
|
||||||
|
|
||||||
|
# Move the artifacts out
|
||||||
|
mkdir -p ${ARTIFACT_DIR}/rpm
|
||||||
|
mv /root/rpmbuild/RPMS/x86_64/jellyfin-*.rpm /root/rpmbuild/SRPMS/jellyfin-*.src.rpm ${ARTIFACT_DIR}/rpm/
|
Loading…
Reference in new issue