Add initial support for RPM packaging (#121)

- Add gen-rpm
- Package rpm in CI testing and releases
- Remove fedora 33 from testing (end of life)
- Update arguments for `build_private.sh` and `build_sunshine.sh`

Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
This commit is contained in:
h 2022-04-12 20:29:08 -07:00 committed by GitHub
commit a6921fffad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 271 additions and 20 deletions

View file

@ -35,4 +35,4 @@ RUN apt-get update -y && \
# Entrypoint
COPY build-private.sh /root/build.sh
ENTRYPOINT ["/root/build.sh"]
ENTRYPOINT ["/root/build.sh", "-deb"]

View file

@ -18,9 +18,10 @@ RUN dnf -y update && \
openssl-devel \
opus-devel \
pulseaudio-libs-devel \
rpm-build \
&& dnf clean all \
&& rm -rf /var/cache/yum
# Entrypoint
COPY build-private.sh /root/build.sh
ENTRYPOINT ["/root/build.sh"]
ENTRYPOINT ["/root/build.sh", "-rpm"]

View file

@ -23,9 +23,10 @@ RUN dnf -y update && \
openssl-devel \
opus-devel \
pulseaudio-libs-devel \
rpm-build \
&& dnf clean all \
&& rm -rf /var/cache/yum
# Entrypoint
COPY build-private.sh /root/build.sh
ENTRYPOINT ["/root/build.sh"]
ENTRYPOINT ["/root/build.sh", "-rpm"]

View file

@ -58,4 +58,4 @@ RUN cmake --version
# Entrypoint
COPY build-private.sh /root/build.sh
ENTRYPOINT ["/root/build.sh"]
ENTRYPOINT ["/root/build.sh", "-deb"]

View file

@ -41,4 +41,4 @@ RUN /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-m
# Entrypoint
COPY build-private.sh /root/build.sh
ENTRYPOINT ["/root/build.sh"]
ENTRYPOINT ["/root/build.sh", "-deb"]

View file

@ -34,4 +34,4 @@ RUN apt-get update -y && \
# Entrypoint
COPY build-private.sh /root/build.sh
ENTRYPOINT ["/root/build.sh"]
ENTRYPOINT ["/root/build.sh", "-deb"]

View file

@ -34,4 +34,4 @@ RUN apt-get update -y && \
# Entrypoint
COPY build-private.sh /root/build.sh
ENTRYPOINT ["/root/build.sh"]
ENTRYPOINT ["/root/build.sh", "-deb"]

View file

@ -32,4 +32,17 @@ cmake "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DSUNSHINE_EXECUTABLE_PATH=$SUNSHI
make -j ${nproc}
./gen-deb
# Get preferred package format
if [ "$1" == "-rpm" ]
then
echo "Packaging in .rpm format."
./gen-rpm -d
elif [ "$1" == "-deb" ]
then
echo "Packaging in .deb format."
./gen-deb
else
echo "Preferred packaging not specified."
echo "Use -deb or -rpm to specify preferred package format."
exit 1
fi

View file

@ -4,7 +4,8 @@ set -e
usage() {
echo "Usage: $0"
echo " -d: Generate a debug build"
echo " -p: Generate a debian package"
echo " -p: Generate a linux package"
echo " -e: Extension of package... i.e. 'deb', 'rpm' --> default [deb]"
echo " -u: The input device is not a TTY"
echo " -n name: Docker container name --> default [sunshine]"
echo " -s path/to/sources/sunshine: Use local sources instead of a git repository"
@ -26,13 +27,14 @@ absolute_path() {
CMAKE_BUILD_TYPE="-e CMAKE_BUILD_TYPE=Release"
SUNSHINE_PACKAGE_BUILD=OFF
SUNSHINE_PACKAGE_EXTENSION=deb
SUNSHINE_GIT_URL=https://github.com/sunshinestream/sunshine.git
CONTAINER_NAME=sunshine
# Docker will fail if ctrl+c is passed through and the input is not a tty
DOCKER_INTERACTIVE=-ti
while getopts ":dpuhc:s:n:" arg; do
while getopts ":dpuhc:e:s:n:" arg; do
case ${arg} in
u)
echo "Input device is not a TTY"
@ -49,6 +51,21 @@ while getopts ":dpuhc:s:n:" arg; do
SUNSHINE_ASSETS_DIR="-e SUNSHINE_ASSETS_DIR=/etc/sunshine"
SUNSHINE_EXECUTABLE_PATH="-e SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine"
;;
e)
echo "Defining package extension: $OPTARG"
if [ "$OPTARG" == "deb" ]
then
SUNSHINE_PACKAGE_EXTENSION=$OPTARG
echo "Package extension: deb"
elif [ "$OPTARG" == "rpm" ]
then
SUNSHINE_PACKAGE_EXTENSION=$OPTARG
echo "Package extension: rpm"
else
echo "Package extension not supported: $OPTARG"
echo "Falling back to default package extension: $SUNSHINE_PACKAGE_EXTENSION"
fi
;;
s)
absolute_path "$OPTARG"
OPTARG="$RETURN"
@ -98,8 +115,8 @@ then
mkdir -p $BUILD_DIR
case $SUNSHINE_PACKAGE_BUILD in
ON)
echo "Downloading package to: $BUILD_DIR/$CONTAINER_NAME.deb"
docker cp $CONTAINER_NAME:/root/sunshine-build/package-deb/sunshine.deb "$BUILD_DIR/$CONTAINER_NAME.deb"
echo "Downloading package to: $BUILD_DIR/$CONTAINER_NAME.$SUNSHINE_PACKAGE_EXTENSION"
docker cp $CONTAINER_NAME:/root/sunshine-build/package-$SUNSHINE_PACKAGE_EXTENSION/sunshine.$SUNSHINE_PACKAGE_EXTENSION "$BUILD_DIR/$CONTAINER_NAME.$SUNSHINE_PACKAGE_EXTENSION"
;;
*)
echo "Downloading binary and assets to: $BUILD_DIR"