libretime / libretime-debian-packaging

Debian packaging for LibreTime
Other
8 stars 3 forks source link

Can I help with packaging? #14

Open yfyf opened 3 years ago

yfyf commented 3 years ago

Hi,

Thank you for this project! I help run a community radio in Vilnius and we use these .deb packages to provision Libretime. Not sure where to direct this, so opening an issue, let me know if there is a more appropriate channel.

Is there any way I could contribute / help with the Debian / Ubuntu packaging of Libretime?

I've tried using the .deb's provided, but they are all broken in subtle ways, e.g. assume a specific version of apache accross all distro versions (e.g. here) or use incorrect user names in systemd files (e.g. libretime-playout vs airtime-playout in postinst).

I think the majority of these issues could be eliminated by setting up a simple CI environment which attempts to build + install + start the services and do some basic checks (e.g. all airtime systemd services are running).

Not an expert in .deb packaging myself, but a Debian user for many years, so have some decent experience with the overall ecosystem.

Let me know what are your / the Libretime maintainers thoughts regarding the overall direction of .deb packaging.

P.S. I realize this is also related to the more general install / packaging questions of the Libretime project, but it is perhaps worthwhile to create good .deb based packaging and then propose to eliminate the manual installation scripts from the overall project?

paddatrapper commented 3 years ago

Hi!

By all means, you are welcome to help with the packaging. We use git-buildpackage as the building tool. I agree that a CI environment would be great. Something similar to the Salsa CI pipeline that we have within Debian, adapted to work on GitHub Actions would help.

Eventually I would like to get LibreTime into Debian main, but that requires a lot more work to get it policy compliant. Work for that happens on Salsa, but it has stalled due to lack of time and the amount of change that LT is currently going through - with many of the JS dependencies being replaced and the PHP eventually being removed, much of the required work will change in the next year or so.

yfyf commented 3 years ago

Awesome! Could you maybe share the specific git-buildpackage workflow you are using to build LT .deb packages? I would start my contribution by reproducing it and documenting it on the wiki here or something :)

paddatrapper commented 3 years ago

I had half of this typed out and then lost it... I'll write it up for you later in the week when I have access to the machine I was getting set up again!

paddatrapper commented 3 years ago

I use Git-Buildpackage with Git-pbuilder. My current 'documentation' is https://wiki.paddatrapper.com/doku.php?id=wiki:ppa_packaging though it is very lacking.

The steps I go through to set up git-buildpackage on Debian unstable are (python-setuptools will not be needed from the next release onwards):

sudo apt install git-buildpackage ubuntu-keyring eatmydata python-setuptools
export DIST=xenial
sudo mkdir /var/cache/pbuilder/base-$DIST.cow
sudo DIST=$DIST pbuilder create --configfile /home/kyle/.pbuilderrc --no-targz --buildplace /var/cache/pbuilder/base-$DIST.cow
gbp clone https://github.com/LibreTime/libretime-debian-packaging.git
cd libretime-debian-packaging
gbp buildpackage --git-dist=xenial --git-pbuilder-opt="--debbuildopts='-sa'" --git-ignore-new

The contents of ~/.pbuilderrc:

# Codenames for Debian suites according to their alias. Update these when
# needed.
UNSTABLE_CODENAME="sid"
TESTING_CODENAME="bullseye"
STABLE_CODENAME="buster"
OLDSTABLE_CODENAME="stretch"
STABLE_BACKPORTS_SUITE="$STABLE_CODENAME-backports"
OLDSTABLE_BACKPORTS_SUITE="$OLDSTABLE_CODENAME-backports"

# List of Debian suites.
DEBIAN_SUITES=($UNSTABLE_CODENAME $TESTING_CODENAME $STABLE_CODENAME $STABLE_BACKPORTS_SUITE
    $OLDSTABLE_CODENAME $OLDSTABLE_BACKPORTS_SUITE
    "experimental" "unstable" "testing" "stable" "oldstable")

# List of Ubuntu suites. Update these when needed.
UBUNTU_SUITES=("eaon" "bionic" "xenial")

# Mirrors to use. Update these to your preferred mirror.
DEBIAN_MIRROR="deb.debian.org"
UBUNTU_MIRROR="mirrors.kernel.org"

# Optionally use the changelog of a package to determine the suite to use if
# none set.
if [ -z "${DIST}" ] && [ -r "debian/changelog" ]; then
    DIST=$(dpkg-parsechangelog --show-field=Distribution)
fi

# Optionally change Debian codenames in $DIST to their aliases. Default
# UNRELEASED to unstable
case "$DIST" in
    $UNSTABLE_CODENAME)
        DIST="unstable"
        ;;
    $TESTING_CODENAME)
        DIST="testing"
        ;;
    $STABLE_CODENAME)
        DIST="stable"
        ;;
    $OLDSTABLE_CODENAME)
        DIST="oldstable"
        ;;
    $STABLE_BACKPORTS_SUITE)
        DIST="stable"
        OTHERMIRROR="$OTHERMIRROR | deb $MIRRORSITE $STABLE_BACKPORTS_SUITE $COMPONENTS"
        ;;
    $OLDSTABLE_BACKPORTS_SUITE)
        touch /tmp/$DIST
        DIST="oldstable"
        OTHERMIRROR="$OTHERMIRROR | deb $MIRRORSITE $OLDSTABLE_BACKPORTS_SUITE $COMPONENTS"
        ;;
    "UNRELEASED")
        DIST="unstable"
        ;;
esac

# Optionally set the architecture to the host architecture if none set. Note
# that you can set your own default (i.e. ${ARCH:="i386"}).
: ${ARCH:="$(dpkg --print-architecture)"}

NAME="$DIST"
if [ "$ARCH" != "$(dpkg --print-architecture)" ]; then
    NAME="$NAME-$ARCH"
    DEBOOTSTRAPOPTS=("--arch" "$ARCH" "${DEBOOTSTRAPOPTS[@]}")
fi
NO_TARGZ="yes"
DISTRIBUTION="$DIST"
BUILDRESULT="/var/cache/pbuilder/$NAME/result/"
APTCACHE="/var/cache/pbuilder/aptcache/"
BUILDPLACE="/var/cache/pbuilder/build/"

if $(echo ${DEBIAN_SUITES[@]} | grep -q $DIST); then
    # Debian configuration
    MIRRORSITE="http://$DEBIAN_MIRROR/debian/"
    COMPONENTS="main"
elif $(echo ${UBUNTU_SUITES[@]} | grep -q $DIST); then
    # Ubuntu configuration
    MIRRORSITE="http://$UBUNTU_MIRROR/ubuntu/"
    COMPONENTS="main universe"
else
    echo "Unknown distribution: $DIST"
    exit 1
fi

SOURCE_ONLY_CHANGES="yes"
EXTRAPACKAGES="eatmydata cowdancer"
EATMYDATA="yes"
yfyf commented 3 years ago

Neat! Thank you. I will try to build everything this weekend then.

SwampRabbit commented 3 years ago

@paddatrapper I am a member of MX Linux team, lately I've been packaging a lot of amateur radio stuffs, as well as audio packages for AV-Linux which is now based on MX. I ran across LibreTime on Salsa awhile back and put it on my list to check out later, because I wasn't sure on the state of thiing. But later is kinda now, I saw this branch and convo, so I figured I would reach out. :P

I'm interested in supporting packaging LibreTime and including it in our repos, but I guess I am sorta lost with what is what in regards to this application right now, which makes sense since it seems to be in massive transition still. A few questions if you don't mind though:

  1. I see all the systemctl blurbs hunting around on here, what are the chances LibreTime can work with sysvinit?
  2. I see "python"-foo in the control file and not "python3"-foo in your control file, is LibreTime still using some python2 bits?
  3. Does building off this branch produce a usable application at the moment?

FYSA: we use sbuild or pbuilder for the majority of our packaging, we stick to being Debian compliant as much as possible, but willing to get creative to give users what they want as long as it doesn't pose stability or security issues.

paddatrapper commented 3 years ago
  1. There is, the scripts are available in the various python_apps/, for example airtime_analyzer: https://github.com/LibreTime/libretime/blob/master/python_apps/airtime_analyzer/install/sysvinit/libretime-analyzer, they just need adding to the install here
  2. Alpha.8 (the current release in this repo) is python 2 only. The next release (alpha.9) that has just been released and I'm working on packaging at the moment is python 3 and updates those references. I've pushed what I have so far here.
  3. Yes - you can build alpha.9 by checking out the debian/3.0.0_alpha.8-1ubuntu4 tag that works for Ubuntu 16.04 and 18.04. It is definitely not Debian compliant - there is a ton of vendoring, pip3 calls in the postinst maintainer script and other lintian issues that need fixing though. To build (assuming you have git-buildpackage and pbuilder set up (for sbuild you should be able just to run that from the root of the repo after checking out the tag):
    git checkout debian/3.0.0_alpha.8-1ubuntu4
    gbp buildpackage --git-dist=xenial --git-pbuilder-opt="--debbuildopts='-sa'"

73!

SwampRabbit commented 3 years ago

@paddatrapper thanks, I'll dig into it first chance I get, got lots of other packaging I'm responsible for already, but slow and steady wins the race or so they say.