Skip to content

Commit

Permalink
2021-05-19 Fred Gleason <[email protected]>
Browse files Browse the repository at this point in the history
	* Hacked the build system to make the PyPAD module install
	correctly on Debian-ish systems.

Signed-off-by: Fred Gleason <[email protected]>
  • Loading branch information
ElvishArtisan committed May 20, 2021
1 parent 70d773d commit cb4f8fe
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 15 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -21715,3 +21715,6 @@
2021-05-19 Fred Gleason <[email protected]>
* Removed the 'LOCAL_PREFIX' and 'RD_LIB_PATH' Autoconf
substitutions from the build system.
2021-05-19 Fred Gleason <[email protected]>
* Hacked the build system to make the PyPAD module install
correctly on Debian-ish systems.
8 changes: 7 additions & 1 deletion acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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],[]
[
Expand All @@ -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])
]
)

Expand Down
25 changes: 22 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 28 additions & 6 deletions get_distro.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
# See https://www.freedesktop.org/software/systemd/man/os-release.html
# for a description of the various fields.
#
# (C) Copyright 2012-2021 Fred Gleason <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
Expand All @@ -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;
Expand Down Expand Up @@ -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(<RELEASE>) {
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);
}
}
}
Expand Down

0 comments on commit cb4f8fe

Please sign in to comment.