diff --git a/ChangeLog b/ChangeLog index 8100cb3e9..94b6c6255 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21715,3 +21715,6 @@ 2021-05-19 Fred Gleason * Removed the 'LOCAL_PREFIX' and 'RD_LIB_PATH' Autoconf substitutions from the build system. +2021-05-19 Fred Gleason + * Hacked the build system to make the PyPAD module install + correctly on Debian-ish systems. diff --git a/acinclude.m4 b/acinclude.m4 index f2346242c..8aa8ae482 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -45,6 +45,9 @@ AC_DEFUN([AR_GCC_TARGET],[AC_REQUIRE([AC_PROG_CC])] # $ar_distro_version = Distribution Version (10.3, 3.1, etc) # $ar_distro_major = Distribution Version Major Number (10, 3, etc) # $ar_distro_minor = Distribution Version Minor Number (3, 1, etc) +# $ar_distro_pretty_name = Full Distribution Name (Ubuntu 20.04.2 LTS, etc) +# $ar_distro_id = All lowercase identifier (ubuntu, debian, centos, etc) +# $ar_distro_id_like = Identifier(s) of similar distros (rhel fedora, etc) # AC_DEFUN([AR_GET_DISTRO],[] [ @@ -53,7 +56,10 @@ AC_DEFUN([AR_GET_DISTRO],[] ar_distro_version=$(./get_distro.pl VERSION) ar_distro_major=$(./get_distro.pl MAJOR) ar_distro_minor=$(./get_distro.pl MINOR) - AC_MSG_RESULT([$ar_distro_name $ar_distro_version]) + ar_distro_pretty_name=$(./get_distro.pl PRETTY_NAME) + ar_distro_id=$(./get_distro.pl ID) + ar_distro_id_like=$(./get_distro.pl ID_LIKE) + AC_MSG_RESULT([$ar_distro_pretty_name $ar_distro_version]) ] ) diff --git a/configure.ac b/configure.ac index 103e9e00b..f852764c4 100644 --- a/configure.ac +++ b/configure.ac @@ -162,6 +162,12 @@ else AC_SUBST(QT_MYSQL_PKG,"qt5-qtbase-mysql") fi fi +if test $ar_distro_id = "debian" ; then + DISTRO_IS_DEBIANISH=yes +fi +if test $ar_distro_id = "ubuntu" ; then + DISTRO_IS_DEBIANISH=yes +fi # # Check for Expat @@ -245,9 +251,22 @@ AC_CHECK_HEADER(soundtouch/SoundTouch.h,[],[AC_MSG_ERROR([*** SoundTouch not fou # # Check for Python # -AM_PATH_PYTHON([3]) -#echo -n $pythondir | sed "s^\${prefix}^/usr^" > debian/pythondir -AC_SUBST(PYTHON_BASE_DEP,"python"`echo $PYTHON_VERSION | sed -e s/3./3/`) +if test -z $DISTRO_IS_DEBIANISH ; then + AM_PATH_PYTHON([3]) + #echo -n $pythondir | sed "s^\${prefix}^/usr^" > debian/pythondir + AC_SUBST(PYTHON_BASE_DEP,"python"`echo $PYTHON_VERSION | sed -e s/3./3/`) +else + # + # FIXME: Horrible hack to make Python install correctly on Debianish setups + # + AC_MSG_NOTICE([Configuring Debian-style Python installation]) + PYTHON="/usr/bin/python3" + AC_ARG_VAR(PYTHON,[the Python interpreter]) + pythondir="/usr/lib/python3/dist-packages" + AC_ARG_VAR(pythondir,[the Python modules directory]) + pyexecdir="/usr/lib/python3/dist-packages" + AC_ARG_VAR(pyexecdir,[the Python extension modules directory]) +fi # # Check for FLAC diff --git a/debian/rules b/debian/rules index 0ce387c7b..7bfd602af 100755 --- a/debian/rules +++ b/debian/rules @@ -100,11 +100,10 @@ binary: # rivendell-pypad # mkdir -p debian/rivendell-pypad/usr/lib/rivendell/pypad - cp -a apis/pypad/scripts/pypad* debian/rivendell-pypad/usr/lib/rivendell/pypad/ - mkdir -p debian/rivendell-pypad/usr/lib/python3.8/pypad - mv debian/tmp/usr/lib/python3.8/site-packages/pypad.py debian/rivendell-pypad/usr/lib/python3.8/pypad/ - mv debian/tmp/usr/lib/python3.8/site-packages/__pycache__ debian/rivendell-pypad/usr/lib/python3.8/pypad/ - rmdir debian/tmp/usr/lib/python3.8/site-packages + mv debian/tmp/usr/lib/rivendell/pypad/* debian/rivendell-pypad/usr/lib/rivendell/pypad/ + mkdir -p debian/rivendell-pypad/usr/lib/python3/dist-packages/__pycache__ + mv debian/tmp/usr/lib/python3/dist-packages/pypad.py debian/rivendell-pypad/usr/lib/python3/dist-packages/ + mv debian/tmp/usr/lib/python3/dist-packages/__pycache__/* debian/rivendell-pypad/usr/lib/python3/dist-packages/__pycache__/ # # rivendell-select diff --git a/get_distro.pl b/get_distro.pl index 00830f4dc..4dfde0f39 100755 --- a/get_distro.pl +++ b/get_distro.pl @@ -2,10 +2,13 @@ # get_distro.pl # -# Try to determine the distribution name and version of the host machine. -# Used as part of the AR_GET_DISTRO() macro. +# Read various fields from 'os-release'. +# Used as part of the AR_GET_DISTRO() macro. # -# (C) Copyright 2012,2016 Fred Gleason +# See https://www.freedesktop.org/software/systemd/man/os-release.html +# for a description of the various fields. +# +# (C) Copyright 2012-2021 Fred Gleason # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as @@ -22,13 +25,28 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -#USAGE: get_distro.pl NAME|VERSION|MAJOR|MINOR|POINT +my $usage="USAGE: get_distro.pl NAME|PRETTY_NAME|ID|ID_LIKE|VERSION|MAJOR|MINOR|POINT"; if($ARGV[0] eq "NAME") { print &Extract("NAME"); exit 0; } +if($ARGV[0] eq "PRETTY_NAME") { + print &Extract("PRETTY_NAME"); + exit 0; +} + +if($ARGV[0] eq "ID") { + print &Extract("ID"); + exit 0; +} + +if($ARGV[0] eq "ID_LIKE") { + print &Extract("ID_LIKE"); + exit 0; +} + if($ARGV[0] eq "VERSION") { print &Extract("VERSION_ID"); exit 0; @@ -63,18 +81,22 @@ exit 0; } +print $usage; exit 256; sub Extract { - if(open RELEASE,"<","/etc/os-release") { + if((open RELEASE,"<","/etc/os-release") || + (open RELEASE,"<","/usr/lib/os-release")) { while() { my @f0=split "\n",$_; for(my $i=0;$i<@f0;$i++) { my @f1=split "=",$f0[$i]; if($f1[0] eq $_[0]) { - return substr($f1[1],1,length($f1[1])-2); + $f1[1]=~s/^"(.*)"$/$1/; + return $f1[1]; +# return substr($f1[1],1,length($f1[1])-2); } } }