diff --git a/rpms/boilerplate/Dockerfile b/rpms/boilerplate/Dockerfile index 05d0e02..8d00407 100644 --- a/rpms/boilerplate/Dockerfile +++ b/rpms/boilerplate/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,11 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN wget -O /app/boilerplate https://github.com/gruntwork-io/boilerplate/releases/download/v${PACKAGE_VERSION}/boilerplate_linux_amd64 +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/boilerplate/resources/build.sh b/rpms/boilerplate/resources/build.sh new file mode 100755 index 0000000..6c76db7 --- /dev/null +++ b/rpms/boilerplate/resources/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/bash + +# Download the required files +wget -O /app/boilerplate https://github.com/gruntwork-io/boilerplate/releases/download/v${PACKAGE_VERSION}/boilerplate_linux_amd64 + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/boilerplate/nfpm.yaml b/rpms/boilerplate/resources/nfpm.yaml similarity index 100% rename from rpms/boilerplate/nfpm.yaml rename to rpms/boilerplate/resources/nfpm.yaml diff --git a/rpms/cni-plugins/Dockerfile b/rpms/cni-plugins/Dockerfile index e9c7767..8d00407 100644 --- a/rpms/cni-plugins/Dockerfile +++ b/rpms/cni-plugins/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,13 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml -COPY scripts /app/scripts - -# Download the required files -RUN wget -O /app/cni-plugins-linux-amd64.tgz https://github.com/containernetworking/plugins/releases/download/v${PACKAGE_VERSION}/cni-plugins-linux-amd64-v${PACKAGE_VERSION}.tgz && \ - tar xf cni-plugins-linux-amd64.tgz +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/cni-plugins/resources/build.sh b/rpms/cni-plugins/resources/build.sh new file mode 100755 index 0000000..f89d051 --- /dev/null +++ b/rpms/cni-plugins/resources/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/bash + +# Download and extract cni-plugins +wget -O /app/cni-plugins-linux-amd64.tgz https://github.com/containernetworking/plugins/releases/download/v${PACKAGE_VERSION}/cni-plugins-linux-amd64-v${PACKAGE_VERSION}.tgz +tar xf cni-plugins-linux-amd64.tgz + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/cni-plugins/nfpm.yaml b/rpms/cni-plugins/resources/nfpm.yaml similarity index 100% rename from rpms/cni-plugins/nfpm.yaml rename to rpms/cni-plugins/resources/nfpm.yaml diff --git a/rpms/cni-plugins/scripts/preinstall.sh b/rpms/cni-plugins/resources/scripts/preinstall.sh similarity index 100% rename from rpms/cni-plugins/scripts/preinstall.sh rename to rpms/cni-plugins/resources/scripts/preinstall.sh diff --git a/rpms/consul-cni/Dockerfile b/rpms/consul-cni/Dockerfile index e544aac..8d00407 100644 --- a/rpms/consul-cni/Dockerfile +++ b/rpms/consul-cni/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,14 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml -COPY scripts /app/scripts - -# Download the required files -RUN dnf install -y unzip && \ - wget -O /app/consul-cni.zip https://releases.hashicorp.com/consul-cni/${PACKAGE_VERSION}/consul-cni_${PACKAGE_VERSION}_linux_amd64.zip && \ - unzip consul-cni.zip +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/consul-cni/resources/build.sh b/rpms/consul-cni/resources/build.sh new file mode 100755 index 0000000..b38721c --- /dev/null +++ b/rpms/consul-cni/resources/build.sh @@ -0,0 +1,11 @@ +#!/usr/bin/bash + +# Install dependencies +dnf install -y unzip + +# Download and extract consul-cni +wget -O /app/consul-cni.zip https://releases.hashicorp.com/consul-cni/${PACKAGE_VERSION}/consul-cni_${PACKAGE_VERSION}_linux_amd64.zip +unzip consul-cni.zip + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/consul-cni/nfpm.yaml b/rpms/consul-cni/resources/nfpm.yaml similarity index 100% rename from rpms/consul-cni/nfpm.yaml rename to rpms/consul-cni/resources/nfpm.yaml diff --git a/rpms/consul-cni/scripts/preinstall.sh b/rpms/consul-cni/resources/scripts/preinstall.sh similarity index 100% rename from rpms/consul-cni/scripts/preinstall.sh rename to rpms/consul-cni/resources/scripts/preinstall.sh diff --git a/rpms/consul/Dockerfile b/rpms/consul/Dockerfile index f113c51..8d00407 100644 --- a/rpms/consul/Dockerfile +++ b/rpms/consul/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,13 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN dnf install -y unzip && \ - wget -O /app/consul.zip https://releases.hashicorp.com/consul/${PACKAGE_VERSION}/consul_${PACKAGE_VERSION}_linux_amd64.zip && \ - unzip consul.zip +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/consul/resources/build.sh b/rpms/consul/resources/build.sh new file mode 100755 index 0000000..368177a --- /dev/null +++ b/rpms/consul/resources/build.sh @@ -0,0 +1,11 @@ +#!/usr/bin/bash + +# Install dependencies +dnf install -y unzip + +# Download and extract consul +wget -O /app/consul.zip https://releases.hashicorp.com/consul/${PACKAGE_VERSION}/consul_${PACKAGE_VERSION}_linux_amd64.zip +unzip consul.zip + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/consul/nfpm.yaml b/rpms/consul/resources/nfpm.yaml similarity index 100% rename from rpms/consul/nfpm.yaml rename to rpms/consul/resources/nfpm.yaml diff --git a/rpms/etcd/Dockerfile b/rpms/etcd/Dockerfile index b7b9da0..8d00407 100644 --- a/rpms/etcd/Dockerfile +++ b/rpms/etcd/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,13 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN wget -O /app/etcd-v${PACKAGE_VERSION}-linux-amd64.tar.gz https://github.com/etcd-io/etcd/releases/download/v${PACKAGE_VERSION}/etcd-v${PACKAGE_VERSION}-linux-amd64.tar.gz && \ - tar xf /app/etcd-v${PACKAGE_VERSION}-linux-amd64.tar.gz && \ - mv /app/etcd-v${PACKAGE_VERSION}-linux-amd64/* /app/ +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/etcd/resources/build.sh b/rpms/etcd/resources/build.sh new file mode 100755 index 0000000..41a6178 --- /dev/null +++ b/rpms/etcd/resources/build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/bash + +# Download and extract etcd +wget -O /app/etcd-v${PACKAGE_VERSION}-linux-amd64.tar.gz https://github.com/etcd-io/etcd/releases/download/v${PACKAGE_VERSION}/etcd-v${PACKAGE_VERSION}-linux-amd64.tar.gz +tar xf /app/etcd-v${PACKAGE_VERSION}-linux-amd64.tar.gz +mv /app/etcd-v${PACKAGE_VERSION}-linux-amd64/* /app/ + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/etcd/nfpm.yaml b/rpms/etcd/resources/nfpm.yaml similarity index 100% rename from rpms/etcd/nfpm.yaml rename to rpms/etcd/resources/nfpm.yaml diff --git a/rpms/g10k/Dockerfile b/rpms/g10k/Dockerfile index 0e6f335..8d00407 100644 --- a/rpms/g10k/Dockerfile +++ b/rpms/g10k/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,14 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN wget -O /app/g10k.zip https://github.com/xorpaul/g10k/releases/download/v${PACKAGE_VERSION}/g10k-v${PACKAGE_VERSION}-linux-amd64.zip && \ - pushd /app && \ - unzip /app/g10k.zip && \ - popd +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/g10k/resources/build.sh b/rpms/g10k/resources/build.sh new file mode 100755 index 0000000..524387b --- /dev/null +++ b/rpms/g10k/resources/build.sh @@ -0,0 +1,10 @@ +#!/usr/bin/bash + +# Download and extract g10k +wget -O /app/g10k.zip https://github.com/xorpaul/g10k/releases/download/v${PACKAGE_VERSION}/g10k-v${PACKAGE_VERSION}-linux-amd64.zip +pushd /app +unzip /app/g10k.zip +popd + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/g10k/nfpm.yaml b/rpms/g10k/resources/nfpm.yaml similarity index 100% rename from rpms/g10k/nfpm.yaml rename to rpms/g10k/resources/nfpm.yaml diff --git a/rpms/incus/Dockerfile b/rpms/incus/Dockerfile index 9d58b44..8d00407 100644 --- a/rpms/incus/Dockerfile +++ b/rpms/incus/Dockerfile @@ -1,4 +1,3 @@ -# Start with the AlmaLinux 8.10 base image FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs @@ -12,44 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -COPY scripts /app/scripts +# Copy resources from the context into the container COPY resources /app/resources -# Download the required files -RUN dnf install -y \ - unzip \ - libtool \ - autoconf \ - automake \ - gcc \ - make \ - git \ - go \ - cowsql-devel \ - libacl-devel \ - libcap-devel \ - libseccomp-devel \ - libuv-devel \ - raft-devel \ - libudev-devel \ - lxc-devel \ - libsqlite3x-devel \ - sqlite-devel \ - systemd-rpm-macros \ - bash-completion \ - gettext \ - help2man \ - wget && \ - wget -O /app/incus.tar.gz https://github.com/lxc/incus/archive/refs/tags/v${PACKAGE_VERSION}.tar.gz && tar -C /app -xf incus.tar.gz && \ - wget https://go.dev/dl/go1.24.1.linux-amd64.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz && \ - export PATH=/usr/local/go/bin:$PATH && \ - pushd /app/incus-${PACKAGE_VERSION} && \ - make deps && \ - export CGO_CFLAGS="-I/root/go/deps/raft/include/ -I/root/go/deps/cowsql/include/" && \ - export CGO_LDFLAGS="-L/root/go/deps/raft/.libs -L/root/go/deps/cowsql/.libs/" && \ - export LD_LIBRARY_PATH="/root/go/deps/raft/.libs/:/root/go/deps/cowsql/.libs/" && \ - export CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)" && \ - make build - # Default command to build RPMs -CMD /app/scripts/build-packages.sh +CMD /app/resources/build.sh diff --git a/rpms/incus/resources/build.sh b/rpms/incus/resources/build.sh new file mode 100755 index 0000000..7bc56d2 --- /dev/null +++ b/rpms/incus/resources/build.sh @@ -0,0 +1,52 @@ +#!/usr/bin/bash + +# Install build dependencies +dnf install -y \ + unzip \ + libtool \ + autoconf \ + automake \ + gcc \ + make \ + git \ + go \ + cowsql-devel \ + libacl-devel \ + libcap-devel \ + libseccomp-devel \ + libuv-devel \ + raft-devel \ + libudev-devel \ + lxc-devel \ + libsqlite3x-devel \ + sqlite-devel \ + systemd-rpm-macros \ + bash-completion \ + gettext \ + help2man \ + wget + +# Download and extract incus source +wget -O /app/incus.tar.gz https://github.com/lxc/incus/archive/refs/tags/v${PACKAGE_VERSION}.tar.gz +tar -C /app -xf incus.tar.gz + +# Install specific Go version +wget https://go.dev/dl/go1.24.1.linux-amd64.tar.gz +rm -rf /usr/local/go +tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz + +# Set up Go environment and build incus +export PATH=/usr/local/go/bin:$PATH +pushd /app/incus-${PACKAGE_VERSION} +make deps +export CGO_CFLAGS="-I/root/go/deps/raft/include/ -I/root/go/deps/cowsql/include/" +export CGO_LDFLAGS="-L/root/go/deps/raft/.libs -L/root/go/deps/cowsql/.libs/" +export LD_LIBRARY_PATH="/root/go/deps/raft/.libs/:/root/go/deps/cowsql/.libs/" +export CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)" +make build +popd + +# Build the RPMs +nfpm pkg --config /app/resources/nfpm_incus.yaml --target /app/dist --packager rpm +nfpm pkg --config /app/resources/nfpm_incus-client.yaml --target /app/dist --packager rpm +nfpm pkg --config /app/resources/nfpm_incus-tools.yaml --target /app/dist --packager rpm diff --git a/rpms/incus/scripts/postinstall.sh b/rpms/incus/resources/scripts/postinstall.sh similarity index 100% rename from rpms/incus/scripts/postinstall.sh rename to rpms/incus/resources/scripts/postinstall.sh diff --git a/rpms/incus/scripts/postremove.sh b/rpms/incus/resources/scripts/postremove.sh similarity index 100% rename from rpms/incus/scripts/postremove.sh rename to rpms/incus/resources/scripts/postremove.sh diff --git a/rpms/incus/scripts/preinstall.sh b/rpms/incus/resources/scripts/preinstall.sh similarity index 100% rename from rpms/incus/scripts/preinstall.sh rename to rpms/incus/resources/scripts/preinstall.sh diff --git a/rpms/incus/scripts/preremove.sh b/rpms/incus/resources/scripts/preremove.sh similarity index 100% rename from rpms/incus/scripts/preremove.sh rename to rpms/incus/resources/scripts/preremove.sh diff --git a/rpms/incus/scripts/build-packages.sh b/rpms/incus/scripts/build-packages.sh deleted file mode 100755 index 9489094..0000000 --- a/rpms/incus/scripts/build-packages.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/bash -nfpm pkg --config /app/resources/nfpm_incus.yaml --target /app/dist --packager rpm && \ -nfpm pkg --config /app/resources/nfpm_incus-client.yaml --target /app/dist --packager rpm && \ -nfpm pkg --config /app/resources/nfpm_incus-tools.yaml --target /app/dist --packager rpm diff --git a/rpms/jellyfin-ffmpeg-bin/Dockerfile b/rpms/jellyfin-ffmpeg-bin/Dockerfile index 9bbe4cb..8d00407 100644 --- a/rpms/jellyfin-ffmpeg-bin/Dockerfile +++ b/rpms/jellyfin-ffmpeg-bin/Dockerfile @@ -1,4 +1,3 @@ -# Start with the AlmaLinux 9 base image FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs @@ -15,9 +14,5 @@ ENV PACKAGE_VERSION=${PACKAGE_VERSION} # Copy resources from the context into the container COPY resources /app/resources -# Download the required files -RUN mkdir -p /root/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} && \ - spectool -g -R /app/resources/jellyfin-ffmpeg-bin_${PACKAGE_VERSION}.spec && \ - rpmbuild -ba /app/resources/jellyfin-ffmpeg-bin_${PACKAGE_VERSION}.spec && \ - cp /root/rpmbuild/RPMS/x86_64/jellyfin-ffmpeg-bin-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.*.rpm /app/dist/ && \ - cp /root/rpmbuild/SRPMS/jellyfin-ffmpeg-bin-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.*.rpm /app/dist +# Default command to build RPMs +CMD /app/resources/build.sh diff --git a/rpms/jellyfin-ffmpeg-bin/resources/build.sh b/rpms/jellyfin-ffmpeg-bin/resources/build.sh new file mode 100755 index 0000000..77687d3 --- /dev/null +++ b/rpms/jellyfin-ffmpeg-bin/resources/build.sh @@ -0,0 +1,14 @@ +#!/usr/bin/bash + +# Setup rpmbuild directory structure +mkdir -p /root/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} + +# Download source files using spectool +spectool -g -R /app/resources/jellyfin-ffmpeg-bin_${PACKAGE_VERSION}.spec + +# Build the RPM +rpmbuild -ba /app/resources/jellyfin-ffmpeg-bin_${PACKAGE_VERSION}.spec + +# Copy the built RPMs to output directory +cp /root/rpmbuild/RPMS/x86_64/jellyfin-ffmpeg-bin-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.*.rpm /app/dist/ +cp /root/rpmbuild/SRPMS/jellyfin-ffmpeg-bin-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.*.rpm /app/dist \ No newline at end of file diff --git a/rpms/jellyfin-server/Dockerfile b/rpms/jellyfin-server/Dockerfile index 024924f..8d00407 100644 --- a/rpms/jellyfin-server/Dockerfile +++ b/rpms/jellyfin-server/Dockerfile @@ -1,4 +1,3 @@ -# Start with the AlmaLinux 9 base image FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs @@ -15,12 +14,5 @@ ENV PACKAGE_VERSION=${PACKAGE_VERSION} # Copy resources from the context into the container COPY resources /app/resources -# Download the required files -RUN mkdir -p /root/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} && \ - dnf install dotnet-sdk-8.0 -y && \ - spectool -g -R /app/resources/jellyfin-server_${PACKAGE_VERSION}.spec && \ - cp /app/resources/fix-envfile-path.patch /root/rpmbuild/SOURCES/fix-envfile-path.patch && \ - cp /app/resources/tmpfiles.conf /root/rpmbuild/SOURCES/tmpfiles.conf && \ - rpmbuild -ba /app/resources/jellyfin-server_${PACKAGE_VERSION}.spec && \ - cp /root/rpmbuild/RPMS/x86_64/jellyfin-server-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.x86_64.rpm /app/dist/ && \ - cp /root/rpmbuild/SRPMS/jellyfin-server-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.src.rpm /app/dist/ +# Default command to build RPMs +CMD /app/resources/build.sh diff --git a/rpms/jellyfin-server/resources/build.sh b/rpms/jellyfin-server/resources/build.sh new file mode 100755 index 0000000..78c4fc4 --- /dev/null +++ b/rpms/jellyfin-server/resources/build.sh @@ -0,0 +1,21 @@ +#!/usr/bin/bash + +# Setup rpmbuild directory structure +mkdir -p /root/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} + +# Install .NET SDK for building +dnf install dotnet-sdk-8.0 -y + +# Download source files using spectool +spectool -g -R /app/resources/jellyfin-server_${PACKAGE_VERSION}.spec + +# Copy additional files to SOURCES +cp /app/resources/fix-envfile-path.patch /root/rpmbuild/SOURCES/fix-envfile-path.patch +cp /app/resources/tmpfiles.conf /root/rpmbuild/SOURCES/tmpfiles.conf + +# Build the RPM +rpmbuild -ba /app/resources/jellyfin-server_${PACKAGE_VERSION}.spec + +# Copy the built RPMs to output directory +cp /root/rpmbuild/RPMS/x86_64/jellyfin-server-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.x86_64.rpm /app/dist/ +cp /root/rpmbuild/SRPMS/jellyfin-server-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.src.rpm /app/dist/ \ No newline at end of file diff --git a/rpms/jellyfin-web/Dockerfile b/rpms/jellyfin-web/Dockerfile index 05326f4..8d00407 100644 --- a/rpms/jellyfin-web/Dockerfile +++ b/rpms/jellyfin-web/Dockerfile @@ -1,4 +1,3 @@ -# Start with the AlmaLinux 9 base image FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs @@ -15,11 +14,5 @@ ENV PACKAGE_VERSION=${PACKAGE_VERSION} # Copy resources from the context into the container COPY resources /app/resources -# Download the required files -RUN mkdir -p /root/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} && \ - dnf module enable nodejs:20 -y && \ - dnf install nodejs npm -y && \ - spectool -g -R /app/resources/jellyfin-web_${PACKAGE_VERSION}.spec && \ - rpmbuild -ba /app/resources/jellyfin-web_${PACKAGE_VERSION}.spec && \ - cp /root/rpmbuild/RPMS/noarch/jellyfin-web-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.noarch.rpm /app/dist/ && \ - cp /root/rpmbuild/SRPMS/jellyfin-web-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.src.rpm /app/dist/ +# Default command to build RPMs +CMD /app/resources/build.sh diff --git a/rpms/jellyfin-web/resources/build.sh b/rpms/jellyfin-web/resources/build.sh new file mode 100755 index 0000000..dc3f958 --- /dev/null +++ b/rpms/jellyfin-web/resources/build.sh @@ -0,0 +1,18 @@ +#!/usr/bin/bash + +# Setup rpmbuild directory structure +mkdir -p /root/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} + +# Install Node.js for building +dnf module enable nodejs:20 -y +dnf install nodejs npm -y + +# Download source files using spectool +spectool -g -R /app/resources/jellyfin-web_${PACKAGE_VERSION}.spec + +# Build the RPM +rpmbuild -ba /app/resources/jellyfin-web_${PACKAGE_VERSION}.spec + +# Copy the built RPMs to output directory +cp /root/rpmbuild/RPMS/noarch/jellyfin-web-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.noarch.rpm /app/dist/ +cp /root/rpmbuild/SRPMS/jellyfin-web-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.src.rpm /app/dist/ \ No newline at end of file diff --git a/rpms/nfpm/Dockerfile b/rpms/nfpm/Dockerfile index 965cb5e..8d00407 100644 --- a/rpms/nfpm/Dockerfile +++ b/rpms/nfpm/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,11 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Compile the binaries -RUN GOBIN=/app go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v${PACKAGE_VERSION} +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/nfpm/resources/build.sh b/rpms/nfpm/resources/build.sh new file mode 100755 index 0000000..b4ecf19 --- /dev/null +++ b/rpms/nfpm/resources/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/bash + +# Compile nfpm binary using Go +GOBIN=/app go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v${PACKAGE_VERSION} + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/nfpm/nfpm.yaml b/rpms/nfpm/resources/nfpm.yaml similarity index 100% rename from rpms/nfpm/nfpm.yaml rename to rpms/nfpm/resources/nfpm.yaml diff --git a/rpms/nomad-autoscaler/Dockerfile b/rpms/nomad-autoscaler/Dockerfile index 87c9476..8d00407 100644 --- a/rpms/nomad-autoscaler/Dockerfile +++ b/rpms/nomad-autoscaler/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,13 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN dnf install -y unzip && \ - wget -O /app/nomad-autoscaler.zip https://releases.hashicorp.com/nomad-autoscaler/${PACKAGE_VERSION}/nomad-autoscaler_${PACKAGE_VERSION}_linux_amd64.zip && \ - unzip nomad-autoscaler.zip +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/nomad-autoscaler/resources/build.sh b/rpms/nomad-autoscaler/resources/build.sh new file mode 100755 index 0000000..b463ad9 --- /dev/null +++ b/rpms/nomad-autoscaler/resources/build.sh @@ -0,0 +1,11 @@ +#!/usr/bin/bash + +# Install dependencies +dnf install -y unzip + +# Download and extract nomad-autoscaler +wget -O /app/nomad-autoscaler.zip https://releases.hashicorp.com/nomad-autoscaler/${PACKAGE_VERSION}/nomad-autoscaler_${PACKAGE_VERSION}_linux_amd64.zip +unzip nomad-autoscaler.zip + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/nomad-autoscaler/nfpm.yaml b/rpms/nomad-autoscaler/resources/nfpm.yaml similarity index 100% rename from rpms/nomad-autoscaler/nfpm.yaml rename to rpms/nomad-autoscaler/resources/nfpm.yaml diff --git a/rpms/nomad/Dockerfile b/rpms/nomad/Dockerfile index 6c5f3cc..8d00407 100644 --- a/rpms/nomad/Dockerfile +++ b/rpms/nomad/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,13 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN dnf install -y unzip && \ - wget -O /app/nomad.zip https://releases.hashicorp.com/nomad/${PACKAGE_VERSION}/nomad_${PACKAGE_VERSION}_linux_amd64.zip && \ - unzip nomad.zip +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/nomad/resources/build.sh b/rpms/nomad/resources/build.sh new file mode 100755 index 0000000..834aaa5 --- /dev/null +++ b/rpms/nomad/resources/build.sh @@ -0,0 +1,11 @@ +#!/usr/bin/bash + +# Install dependencies +dnf install -y unzip + +# Download and extract nomad +wget -O /app/nomad.zip https://releases.hashicorp.com/nomad/${PACKAGE_VERSION}/nomad_${PACKAGE_VERSION}_linux_amd64.zip +unzip nomad.zip + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/nomad/nfpm.yaml b/rpms/nomad/resources/nfpm.yaml similarity index 100% rename from rpms/nomad/nfpm.yaml rename to rpms/nomad/resources/nfpm.yaml diff --git a/rpms/nzbget/Dockerfile b/rpms/nzbget/Dockerfile index b7778b9..8d00407 100644 --- a/rpms/nzbget/Dockerfile +++ b/rpms/nzbget/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,9 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml +# Copy resources from the context into the container +COPY resources /app/resources -# Download the required files -RUN wget -O /app/dist/nzbget-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.x86_64.rpm \ - https://github.com/nzbgetcom/nzbget/releases/download/v$PACKAGE_VERSION/nzbget-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.x86_64.rpm +# Default command to build RPMs +CMD /app/resources/build.sh diff --git a/rpms/nzbget/resources/build.sh b/rpms/nzbget/resources/build.sh new file mode 100755 index 0000000..f70f602 --- /dev/null +++ b/rpms/nzbget/resources/build.sh @@ -0,0 +1,5 @@ +#!/usr/bin/bash + +# Download the pre-built RPM from GitHub releases +wget -O /app/dist/nzbget-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.x86_64.rpm \ + https://github.com/nzbgetcom/nzbget/releases/download/v$PACKAGE_VERSION/nzbget-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.x86_64.rpm \ No newline at end of file diff --git a/rpms/nzbget/nfpm.yaml b/rpms/nzbget/resources/nfpm.yaml similarity index 100% rename from rpms/nzbget/nfpm.yaml rename to rpms/nzbget/resources/nfpm.yaml diff --git a/rpms/packer/Dockerfile b/rpms/packer/Dockerfile index fdbd242..8d00407 100644 --- a/rpms/packer/Dockerfile +++ b/rpms/packer/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,13 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN dnf install -y unzip && \ - wget -O /app/packer.zip https://releases.hashicorp.com/packer/${PACKAGE_VERSION}/packer_${PACKAGE_VERSION}_linux_amd64.zip && \ - unzip packer.zip +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/packer/resources/build.sh b/rpms/packer/resources/build.sh new file mode 100755 index 0000000..6b0f15e --- /dev/null +++ b/rpms/packer/resources/build.sh @@ -0,0 +1,11 @@ +#!/usr/bin/bash + +# Install dependencies +dnf install -y unzip + +# Download and extract packer +wget -O /app/packer.zip https://releases.hashicorp.com/packer/${PACKAGE_VERSION}/packer_${PACKAGE_VERSION}_linux_amd64.zip +unzip packer.zip + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/packer/nfpm.yaml b/rpms/packer/resources/nfpm.yaml similarity index 100% rename from rpms/packer/nfpm.yaml rename to rpms/packer/resources/nfpm.yaml diff --git a/rpms/puppet-initial/Dockerfile b/rpms/puppet-initial/Dockerfile index c6b63db..8d00407 100644 --- a/rpms/puppet-initial/Dockerfile +++ b/rpms/puppet-initial/Dockerfile @@ -1,4 +1,3 @@ -# Start with the AlmaLinux 8.10 base image FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs @@ -12,8 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -COPY scripts /app/scripts +# Copy resources from the context into the container COPY resources /app/resources # Default command to build RPMs -CMD /app/scripts/build-packages.sh +CMD /app/resources/build.sh diff --git a/rpms/puppet-initial/scripts/build-packages.sh b/rpms/puppet-initial/resources/build.sh similarity index 100% rename from rpms/puppet-initial/scripts/build-packages.sh rename to rpms/puppet-initial/resources/build.sh diff --git a/rpms/puppet-initial/scripts/postinstall.sh b/rpms/puppet-initial/resources/scripts/postinstall.sh similarity index 100% rename from rpms/puppet-initial/scripts/postinstall.sh rename to rpms/puppet-initial/resources/scripts/postinstall.sh diff --git a/rpms/puppet-initial/scripts/postremove.sh b/rpms/puppet-initial/resources/scripts/postremove.sh similarity index 100% rename from rpms/puppet-initial/scripts/postremove.sh rename to rpms/puppet-initial/resources/scripts/postremove.sh diff --git a/rpms/puppet-initial/scripts/preinstall.sh b/rpms/puppet-initial/resources/scripts/preinstall.sh similarity index 100% rename from rpms/puppet-initial/scripts/preinstall.sh rename to rpms/puppet-initial/resources/scripts/preinstall.sh diff --git a/rpms/puppet-initial/scripts/preremove.sh b/rpms/puppet-initial/resources/scripts/preremove.sh similarity index 100% rename from rpms/puppet-initial/scripts/preremove.sh rename to rpms/puppet-initial/resources/scripts/preremove.sh diff --git a/rpms/ruff/Dockerfile b/rpms/ruff/Dockerfile index 47a583a..8d00407 100644 --- a/rpms/ruff/Dockerfile +++ b/rpms/ruff/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,13 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN wget -O /app/ruff-x86_64-unknown-linux-gnu.tar.gz https://github.com/astral-sh/ruff/releases/download/${PACKAGE_VERSION}/ruff-x86_64-unknown-linux-gnu.tar.gz && \ - tar xf /app/ruff-x86_64-unknown-linux-gnu.tar.gz && \ - mv /app/ruff-x86_64-unknown-linux-gnu/* /app/ +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/ruff/resources/build.sh b/rpms/ruff/resources/build.sh new file mode 100755 index 0000000..937a58e --- /dev/null +++ b/rpms/ruff/resources/build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/bash + +# Download and extract ruff +wget -O /app/ruff-x86_64-unknown-linux-gnu.tar.gz https://github.com/astral-sh/ruff/releases/download/${PACKAGE_VERSION}/ruff-x86_64-unknown-linux-gnu.tar.gz +tar xf /app/ruff-x86_64-unknown-linux-gnu.tar.gz +mv /app/ruff-x86_64-unknown-linux-gnu/* /app/ + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/ruff/nfpm.yaml b/rpms/ruff/resources/nfpm.yaml similarity index 100% rename from rpms/ruff/nfpm.yaml rename to rpms/ruff/resources/nfpm.yaml diff --git a/rpms/terraform/Dockerfile b/rpms/terraform/Dockerfile index 3faefda..8d00407 100644 --- a/rpms/terraform/Dockerfile +++ b/rpms/terraform/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,13 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN dnf install -y unzip && \ - wget -O /app/terraform.zip https://releases.hashicorp.com/terraform/${PACKAGE_VERSION}/terraform_${PACKAGE_VERSION}_linux_amd64.zip && \ - unzip terraform.zip +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/terraform/resources/build.sh b/rpms/terraform/resources/build.sh new file mode 100755 index 0000000..3279615 --- /dev/null +++ b/rpms/terraform/resources/build.sh @@ -0,0 +1,11 @@ +#!/usr/bin/bash + +# Install dependencies +dnf install -y unzip + +# Download and extract terraform +wget -O /app/terraform.zip https://releases.hashicorp.com/terraform/${PACKAGE_VERSION}/terraform_${PACKAGE_VERSION}_linux_amd64.zip +unzip terraform.zip + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/terraform/nfpm.yaml b/rpms/terraform/resources/nfpm.yaml similarity index 100% rename from rpms/terraform/nfpm.yaml rename to rpms/terraform/resources/nfpm.yaml diff --git a/rpms/terragrunt/Dockerfile b/rpms/terragrunt/Dockerfile index 5476dcb..8d00407 100644 --- a/rpms/terragrunt/Dockerfile +++ b/rpms/terragrunt/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,11 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN wget -O /app/terragrunt https://github.com/gruntwork-io/terragrunt/releases/download/v${PACKAGE_VERSION}/terragrunt_linux_amd64 +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/terragrunt/resources/build.sh b/rpms/terragrunt/resources/build.sh new file mode 100755 index 0000000..09a5f70 --- /dev/null +++ b/rpms/terragrunt/resources/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/bash + +# Download terragrunt binary +wget -O /app/terragrunt https://github.com/gruntwork-io/terragrunt/releases/download/v${PACKAGE_VERSION}/terragrunt_linux_amd64 + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/terragrunt/nfpm.yaml b/rpms/terragrunt/resources/nfpm.yaml similarity index 100% rename from rpms/terragrunt/nfpm.yaml rename to rpms/terragrunt/resources/nfpm.yaml diff --git a/rpms/unkin-ca-certificates/Dockerfile b/rpms/unkin-ca-certificates/Dockerfile index ee5da82..8d00407 100644 --- a/rpms/unkin-ca-certificates/Dockerfile +++ b/rpms/unkin-ca-certificates/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,12 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml -COPY scripts /app/scripts - -# Download the required files -RUN curl -o /app/UNKIN_ROOTCA_2024.crt https://vault.query.consul:8200/v1/pki_root/ca/pem +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/unkin-ca-certificates/resources/build.sh b/rpms/unkin-ca-certificates/resources/build.sh new file mode 100755 index 0000000..f9cedae --- /dev/null +++ b/rpms/unkin-ca-certificates/resources/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/bash + +# Download the CA certificate from vault +curl -o /app/UNKIN_ROOTCA_2024.crt https://vault.query.consul:8200/v1/pki_root/ca/pem + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/unkin-ca-certificates/nfpm.yaml b/rpms/unkin-ca-certificates/resources/nfpm.yaml similarity index 100% rename from rpms/unkin-ca-certificates/nfpm.yaml rename to rpms/unkin-ca-certificates/resources/nfpm.yaml diff --git a/rpms/unkin-ca-certificates/scripts/postinstall.sh b/rpms/unkin-ca-certificates/resources/scripts/postinstall.sh similarity index 100% rename from rpms/unkin-ca-certificates/scripts/postinstall.sh rename to rpms/unkin-ca-certificates/resources/scripts/postinstall.sh diff --git a/rpms/unrar/Dockerfile b/rpms/unrar/Dockerfile index bd350d0..8d00407 100644 --- a/rpms/unrar/Dockerfile +++ b/rpms/unrar/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,14 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN export DOWNLOAD_VERSION=$(echo $PACKAGE_VERSION | sed s/\\.//) && \ - wget -O /app/rarlinux.tar.gz https://www.rarlab.com/rar/rarlinux-x64-${DOWNLOAD_VERSION}.tar.gz && \ - tar xf /app/rarlinux.tar.gz && \ - mv /app/rar/unrar /app/ +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/unrar/resources/build.sh b/rpms/unrar/resources/build.sh new file mode 100755 index 0000000..cd9f95b --- /dev/null +++ b/rpms/unrar/resources/build.sh @@ -0,0 +1,10 @@ +#!/usr/bin/bash + +# Download and extract unrar (with version formatting) +export DOWNLOAD_VERSION=$(echo $PACKAGE_VERSION | sed s/\\.//) +wget -O /app/rarlinux.tar.gz https://www.rarlab.com/rar/rarlinux-x64-${DOWNLOAD_VERSION}.tar.gz +tar xf /app/rarlinux.tar.gz +mv /app/rar/unrar /app/ + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/unrar/nfpm.yaml b/rpms/unrar/resources/nfpm.yaml similarity index 100% rename from rpms/unrar/nfpm.yaml rename to rpms/unrar/resources/nfpm.yaml diff --git a/rpms/uv/Dockerfile b/rpms/uv/Dockerfile index 06f1078..8d00407 100644 --- a/rpms/uv/Dockerfile +++ b/rpms/uv/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,13 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN wget -O /app/uv-x86_64-unknown-linux-gnu.tar.gz https://github.com/astral-sh/uv/releases/download/${PACKAGE_VERSION}/uv-x86_64-unknown-linux-gnu.tar.gz && \ - tar xf /app/uv-x86_64-unknown-linux-gnu.tar.gz && \ - mv /app/uv-x86_64-unknown-linux-gnu/* /app/ +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/uv/resources/build.sh b/rpms/uv/resources/build.sh new file mode 100755 index 0000000..3c47ecc --- /dev/null +++ b/rpms/uv/resources/build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/bash + +# Download and extract uv +wget -O /app/uv-x86_64-unknown-linux-gnu.tar.gz https://github.com/astral-sh/uv/releases/download/${PACKAGE_VERSION}/uv-x86_64-unknown-linux-gnu.tar.gz +tar xf /app/uv-x86_64-unknown-linux-gnu.tar.gz +mv /app/uv-x86_64-unknown-linux-gnu/* /app/ + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/uv/nfpm.yaml b/rpms/uv/resources/nfpm.yaml similarity index 100% rename from rpms/uv/nfpm.yaml rename to rpms/uv/resources/nfpm.yaml diff --git a/rpms/vault/Dockerfile b/rpms/vault/Dockerfile index a61859f..8d00407 100644 --- a/rpms/vault/Dockerfile +++ b/rpms/vault/Dockerfile @@ -1,5 +1,4 @@ -# Start with the AlmaLinux 8.10 base image -FROM git.unkin.net/unkin/almalinux8-rpmbuilder:latest +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -12,13 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN dnf install -y unzip && \ - wget -O /app/vault.zip https://releases.hashicorp.com/vault/${PACKAGE_VERSION}/vault_${PACKAGE_VERSION}_linux_amd64.zip && \ - unzip vault.zip +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/vault/resources/build.sh b/rpms/vault/resources/build.sh new file mode 100755 index 0000000..74abaa6 --- /dev/null +++ b/rpms/vault/resources/build.sh @@ -0,0 +1,11 @@ +#!/usr/bin/bash + +# Install dependencies +dnf install -y unzip + +# Download and extract vault +wget -O /app/vault.zip https://releases.hashicorp.com/vault/${PACKAGE_VERSION}/vault_${PACKAGE_VERSION}_linux_amd64.zip +unzip vault.zip + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/vault/nfpm.yaml b/rpms/vault/resources/nfpm.yaml similarity index 100% rename from rpms/vault/nfpm.yaml rename to rpms/vault/resources/nfpm.yaml diff --git a/rpms/victoria-logs/Dockerfile b/rpms/victoria-logs/Dockerfile index d69fe71..8d00407 100644 --- a/rpms/victoria-logs/Dockerfile +++ b/rpms/victoria-logs/Dockerfile @@ -11,13 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN wget -O /app/victoria-logs-linux-amd64-v${PACKAGE_VERSION}.tar.gz \ - https://github.com/VictoriaMetrics/VictoriaLogs/releases/download/v${PACKAGE_VERSION}/victoria-logs-linux-amd64-v${PACKAGE_VERSION}.tar.gz && \ - tar xf victoria-logs-linux-amd64-v${PACKAGE_VERSION}.tar.gz +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/victoria-logs/resources/build.sh b/rpms/victoria-logs/resources/build.sh new file mode 100755 index 0000000..c29b5d7 --- /dev/null +++ b/rpms/victoria-logs/resources/build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/bash + +# Download and extract victoria-logs +wget -O /app/victoria-logs-linux-amd64-v${PACKAGE_VERSION}.tar.gz \ + https://github.com/VictoriaMetrics/VictoriaLogs/releases/download/v${PACKAGE_VERSION}/victoria-logs-linux-amd64-v${PACKAGE_VERSION}.tar.gz +tar xf victoria-logs-linux-amd64-v${PACKAGE_VERSION}.tar.gz + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/victoria-logs/nfpm.yaml b/rpms/victoria-logs/resources/nfpm.yaml similarity index 100% rename from rpms/victoria-logs/nfpm.yaml rename to rpms/victoria-logs/resources/nfpm.yaml diff --git a/rpms/vlutils/Dockerfile b/rpms/vlutils/Dockerfile index 7c031f2..8d00407 100644 --- a/rpms/vlutils/Dockerfile +++ b/rpms/vlutils/Dockerfile @@ -11,13 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN wget -O /app/vlutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz \ - https://github.com/VictoriaMetrics/VictoriaLogs/releases/download/v${PACKAGE_VERSION}/vlutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz && \ - tar xf vlutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/vlutils/resources/build.sh b/rpms/vlutils/resources/build.sh new file mode 100755 index 0000000..8331c45 --- /dev/null +++ b/rpms/vlutils/resources/build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/bash + +# Download and extract vlutils +wget -O /app/vlutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz \ + https://github.com/VictoriaMetrics/VictoriaLogs/releases/download/v${PACKAGE_VERSION}/vlutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz +tar xf vlutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/vlutils/nfpm.yaml b/rpms/vlutils/resources/nfpm.yaml similarity index 100% rename from rpms/vlutils/nfpm.yaml rename to rpms/vlutils/resources/nfpm.yaml diff --git a/rpms/vmutils/Dockerfile b/rpms/vmutils/Dockerfile index d2ef66c..8d00407 100644 --- a/rpms/vmutils/Dockerfile +++ b/rpms/vmutils/Dockerfile @@ -11,13 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -# Copy nfpm.yaml from the context into the container -COPY nfpm.yaml /app/nfpm.yaml - -# Download the required files -RUN wget -O /app/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz \ - https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz && \ - tar xf vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz +# Copy resources from the context into the container +COPY resources /app/resources # Default command to build RPMs -CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm +CMD /app/resources/build.sh diff --git a/rpms/vmutils/resources/build.sh b/rpms/vmutils/resources/build.sh new file mode 100755 index 0000000..3ada06f --- /dev/null +++ b/rpms/vmutils/resources/build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/bash + +# Download and extract vmutils +wget -O /app/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz \ + https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz +tar xf vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/vmutils/nfpm.yaml b/rpms/vmutils/resources/nfpm.yaml similarity index 100% rename from rpms/vmutils/nfpm.yaml rename to rpms/vmutils/resources/nfpm.yaml