Building the MythTV packages for Debian 12

For discussion of topics specific to MythTV on linux
Post Reply
User avatar
jfabernathy
Senior
Posts: 610
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Building the MythTV packages for Debian 12

Post by jfabernathy »

The main purpose of this post is to document how I did it so I can repeat if I need to and maybe others can use it.

I used to use Ubuntu which already builds the packages automaticaly, even for Master called v34. However, like many Ubuntu users I've moved away from Ubuntu to Debian due to Canonical's position on a host of proprietary items like snap packages.

I found that Deb-multimedia.org didn't have v34 or Master. I also found that due to PEP 668, MythTV needed to be built as packages and not just building from source per https://www.mythtv.org/wiki/Build_from_Source

First look at the wiki https://www.mythtv.org/wiki/Installing_MythTV_on_Debian

I start by installing the dependencies. Ansible does work for Debian 12.

Code: Select all

sudo apt install git ansible
cd ~/
git clone https://github.com/MythTV/ansible
cd ansible
./mythtv.yml --limit=localhost

Code: Select all

cd
mkdir ~/build
cd ~/build
git clone https://github.com/MythTV/packaging.git -b fixes/33 # if you want the current release v33
or
git clone https://github.com/MythTV/packaging.git             # if you want the Master or "v34"
cd packaging/deb

./build-debs.sh fixes/33
or
./build-debs.sh master
Now the software needs to be installed. I found the wiki was confusing to me on this part. Also I wanted to have a local repo to contain my packages so any mythtv frontend or backend could install and update from this repository.

I build a virtual machine with KVM/QEMU of Debian 12 on one of my workstations. And since my VM environment uses a network bridge all my VMs are on my home LAN along with all my Mythtv FE/BEs.

My MythTV production backend in on a PC in a closet and it's on 24/7 and acts as my home CIFS/SMB Network Attached Storage (NAS). So I put my Debian 12 mythtv repo on that system.

On that MythTV backend/NAS I created a directory /usr/share/my_mythtv_repo and gave it my user, "jim", ownership with rw permisions. My user is named "jim" on all my systems to simplify things.

I created a shell script called create-packages-list.sh in the /home/jim directory of my Mythtv backend/NAS that will be run remotely by my Debian 12 package builder VM system.

Code: Select all

#! /bin/bash
#
#create-packages-list.sh
#
# This script is put in /home/jim on kubuntu-closet.local and is run by copy-debs.sh on a remote system
#
cd /usr/share/my_mythtv_repo
dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
#
On the VM that builds the packages I put another script in the /home/jim/ directory call copy-debs.sh

Code: Select all

#! /bin/bash
#
# This script is run after the VM builds the debian packages for mythtv per the wiki
#
cd /home/jim/build/packaging/deb/
#
ssh jim@kubuntu-closet.local "rm /usr/share/my_mythtv_repo/*"
scp ./*.deb jim@kubuntu-closet.local:/usr/share/my_mythtv_repo/
scp ./*.dsc jim@kubuntu-closet.local:/usr/share/my_mythtv_repo/
scp ./*.changes jim@kubuntu-closet.local:/usr/share/my_mythtv_repo/
ssh jim@kubuntu-closet.local ./create-packages-list.sh
#
Now on the Package builder VM, I do the following to move the newly built packages to the NAS

Code: Select all

cd
./copy-deb.sh
Now the repo needs to be setup so you can use

Code: Select all

sudo apt install mythtv   #or 
sudo apt install mythtv-frontend
Or just

Code: Select all

sudo apt update && sudo apt upgrade -y
On my mythtv backend/NAS I created a file

Code: Select all

/etc/apache2/conf-available/my_mythtv_repo.conf
with contents

Code: Select all

# conf file for sharing Debian packages

Alias /my_mythtv_repo /usr/share/my_mythtv_repo

<Directory /usr/share/my_mythtv_repo>
Options +Indexes
AllowOverride None
Require all granted
</Directory>
Then run

Code: Select all

sudo a2enconf my_mythtv_repo
sudo systemctl reload apache2.service
Then you should see the directory listing in your web-browser of

Code: Select all

http://<server_ip>/my_mythtv_repo/
Now each Debian 12 system needs a change to their apt setup in /etc/apt/sources.list.d directory.

Create a file called

Code: Select all

/etc/apt/sources.list.d/my_mythtv_repo.list

Code: Select all

# Local build of mythtv, in /usr/share/my_mythtv_repo
# See https://help.ubuntu.com/community/Repositories/Personal
deb [trusted=yes] http://<NAS ip address>/my_mythtv_repo ./
Make sure to put in the actual NAS IP address.

So on any Debian 12 system you can either install or update mythtv by

Code: Select all

sudo apt update
sudo apt install mythtv              # or
sudo apt install mythtv-frontend     # etc.
After the packages get updated later you just need to

Code: Select all

sudo apt update && sudo apt upgrade -y

NOTE. I found it necessary when rebuilding the packages with a newer version to cleanup and start over as far as the /home/jim/build directory.

I just

Code: Select all

cd ~/build
rm -rf packages
git clone https://github.com/MythTV/packaging.git -b fixes/33 # if you want the current release v33
or
git clone https://github.com/MythTV/packaging.git             # if you want the Master or "v34"
cd packaging/deb

./build-debs.sh fixes/33
or
./build-debs.sh master

cd 
./copy-debs.sh
I do not cover setting up the mythconverg database or other things related to the backend. I find I can use with modification a script from:

Code: Select all

https://github.com/MikeB2013/pi-utils
The script pi-mythbackend-helper.sh can easily be modified for MythTV version and PHP version. Since most of the setup is grouped as functions, you can comment out the function calls you don't want.
Post Reply