45Drives / cockpit-zfs-manager

Cockpit ZFS Manager is an interactive ZFS on Linux admin package for Cockpit.
GNU Lesser General Public License v3.0
306 stars 26 forks source link

Installation from .deb is not possible #20

Open shawly opened 1 year ago

shawly commented 1 year ago

Because you have a Depends entry in your control file that requires znapzend but there is no package on the Ubuntu mirrors and the znapzend README instructs users to install it from source, this dependency can never be fulfilled.

Maybe you should remove that dependency or provide a fork that has a .deb file so users can install it as a package? I created a small Docker image to build a .deb file for it:

FROM ubuntu:jammy

ARG ZNAPVER
ARG DEBIAN_FRONTEND=noninteractive

WORKDIR /usr/local/src

RUN apt-get update && \
    apt-get install -y build-essential \
      bash \
      perl \
      unzip \
      autoconf \
      carton \
      curl \
      tar \
      wget && \
    wget https://github.com/oetiker/znapzend/releases/download/v${ZNAPVER}/znapzend-${ZNAPVER}.tar.gz && \
    tar zxvf znapzend-${ZNAPVER}.tar.gz

WORKDIR /usr/local/src/znapzend-${ZNAPVER}

RUN autoreconf --force --install --verbose --make && \
    ./configure --prefix=/usr/local && \
    make && \
    make DESTDIR=/build/znapzend_${ZNAPVER}-1_amd64 install

COPY control /build/znapzend_${ZNAPVER}-1_amd64/DEBIAN/control

WORKDIR /build

RUN sed -i "s/ZNAPVER/${ZNAPVER}/" /build/znapzend_${ZNAPVER}-1_amd64/DEBIAN/control && \
    dpkg-deb --build --root-owner-group "znapzend_${ZNAPVER}-1_amd64"

It needs a control file in the context directory:

Package: znapzend
Version: ZNAPVER
Maintainer: oetiker
Architecture: amd64
Description: ZnapZend is a ZFS centric backup tool to create snapshots and send them to backup locations. It relies on the ZFS tools snapshot, send and receive to do its work. It has the built-in ability to manage both local snapshots as well as remote copies by thinning them out as time progresses.
Depends: perl, zfsutils-linux

Building it with can be done with docker build -t znapzend-builder --build-args=ZNAPVER=0.21.1 . and then the .deb file can be copied by creating a container docker create --name znapzend znapzend-builder and copying the .deb package from there docker cp znapzend:/build/znapzend_0.21.1-1_amd64.deb .. Which can then be installed via apt install znapzend_0.21.1-1_amd64.deb.

This is just an example on how it can be done, but I use this in my Ansible scripts.

wommy commented 1 year ago

https://github.com/oetiker/znapzend/releases/tag/v0.21.2