Bug fixes for debian package builder script. Added package build to pipeline.
This commit is contained in:
parent
2f00e3517b
commit
e70b38cf5f
|
@ -5,12 +5,14 @@ use strict;
|
||||||
my $VERSION="2.2.4";
|
my $VERSION="2.2.4";
|
||||||
my $INSTALL_PREFIX="/tmp/fceux";
|
my $INSTALL_PREFIX="/tmp/fceux";
|
||||||
my $CTL_FILENAME="$INSTALL_PREFIX/DEBIAN/control";
|
my $CTL_FILENAME="$INSTALL_PREFIX/DEBIAN/control";
|
||||||
|
my $ARCH="amd64";
|
||||||
|
my $PKG_OUTPUT_FILE="fceux-$VERSION-$ARCH.deb";
|
||||||
|
|
||||||
my $SO_LIST=`objdump -x $INSTALL_PREFIX/usr/bin/fceux`;
|
my $SO_LIST=`objdump -x $INSTALL_PREFIX/usr/bin/fceux`;
|
||||||
|
|
||||||
#print "$SO_LIST";
|
#print "$SO_LIST";
|
||||||
|
|
||||||
my $i; my $j; my $k; my $PKG;
|
my $i; my $j; my $k; my $pkg;
|
||||||
my @fd = split /\n/, $SO_LIST;
|
my @fd = split /\n/, $SO_LIST;
|
||||||
my @libls;
|
my @libls;
|
||||||
|
|
||||||
|
@ -27,67 +29,84 @@ for ($i=0; $i<=$#fd; $i++)
|
||||||
$libls[$#libls] = $1; $#libls++;
|
$libls[$#libls] = $1; $#libls++;
|
||||||
}
|
}
|
||||||
|
|
||||||
#$PKG=`dpkg-query -S $fd[$i] | cut -d ':' -f1`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
my @rpm;
|
my %pkghash; my $pkgsearch;
|
||||||
my @rpmfile;
|
my @pkglist; my @pkgdeps;
|
||||||
my @rpmfilelist;
|
my $pkg; my $filepath;
|
||||||
my $rpmlist = `rpm -qa`;
|
|
||||||
@rpm = split /\n/, $rpmlist;
|
|
||||||
|
|
||||||
$#rpmfilelist = 0;
|
$#pkgdeps=0;
|
||||||
|
|
||||||
for ($i=0; $i<=$#rpm; $i++)
|
|
||||||
{
|
|
||||||
#print "$fd[$i]\n";
|
|
||||||
#$pkg = `rpm -qf --queryformat '%{NAME}'`;
|
|
||||||
#
|
|
||||||
$rpmfilelist[ $#rpmfilelist ] = `rpm -ql $rpm[$i]`;
|
|
||||||
$#rpmfilelist++;
|
|
||||||
}
|
|
||||||
|
|
||||||
for ($i=0; $i<$#libls; $i++)
|
for ($i=0; $i<$#libls; $i++)
|
||||||
{
|
{
|
||||||
for ($j=0; $j<$#rpmfilelist; $j++)
|
$pkgsearch=`dpkg-query -S $libls[$i]`;
|
||||||
{
|
|
||||||
@rpmfile = split /\n/, $rpmfilelist[$j];
|
|
||||||
|
|
||||||
for ($k=0; $k<=$#rpmfile; $k++)
|
@pkglist = split /\n/, $pkgsearch;
|
||||||
|
|
||||||
|
for ($j=0; $j<=$#pkglist; $j++)
|
||||||
|
{
|
||||||
|
#$pkghash{$pkg} = 1;
|
||||||
|
#print " $libls[$i] '$pkglist[$j]' \n";
|
||||||
|
|
||||||
|
if ( $pkglist[$j] =~ m/(.*):$ARCH:\s+(.*)/ )
|
||||||
{
|
{
|
||||||
if ( $rpmfile[$k] =~ m/$libls[$i]/ )
|
$pkg = $1;
|
||||||
{
|
$filepath = $2;
|
||||||
print "FOUND: $rpmfile[$k] in $rpm[$j]\n";
|
|
||||||
|
$filepath =~ s/^.*\///;
|
||||||
|
|
||||||
|
if ( $libls[$i] eq $filepath )
|
||||||
|
{
|
||||||
|
#print "PKG: '$pkg' '$libls[$i]' == '$filepath' \n";
|
||||||
|
$pkgdeps[ $#pkgdeps ] = $pkg; $#pkgdeps++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#for LIB in $LDD_LIST
|
|
||||||
#do
|
|
||||||
# PKG+=`dpkg-query -S $LIB | cut -d ':' -f1`;
|
|
||||||
#done
|
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
system("mkdir -p $INSTALL_PREFIX/DEBIAN");
|
system("mkdir -p $INSTALL_PREFIX/DEBIAN");
|
||||||
|
|
||||||
open CTL, ">$CTL_FILENAME" or die "Error: Could not open file '$CTL_FILENAME'\n";
|
open CTL, ">$CTL_FILENAME" or die "Error: Could not open file '$CTL_FILENAME'\n";
|
||||||
#
|
#
|
||||||
print CTL "Package: fceux";
|
print CTL "Package: fceux\n";
|
||||||
print CTL "Version: $VERSION";
|
print CTL "Version: $VERSION\n";
|
||||||
print CTL "Section: games";
|
print CTL "Section: games\n";
|
||||||
print CTL "Priority: extra";
|
print CTL "Priority: extra\n";
|
||||||
print CTL "Architecture: amd64";
|
print CTL "Architecture: $ARCH\n";
|
||||||
print CTL "Homepage: http://fceux.com/";
|
print CTL "Homepage: http://fceux.com/\n";
|
||||||
print CTL "Essential: no";
|
print CTL "Essential: no\n";
|
||||||
print CTL "Installed-Size: 1024";
|
#print CTL "Installed-Size: 1024\n";
|
||||||
print CTL "Maintainer: mjbudd77";
|
print CTL "Maintainer: mjbudd77\n";
|
||||||
print CTL "Description: fceux is an emulator of the original (8-bit) Nintendo Entertainment System (NES)";
|
print CTL "Description: fceux is an emulator of the original (8-bit) Nintendo Entertainment System (NES)\n";
|
||||||
print CTL "Depends: liblua5.1-0, libsdl1.2debian, libsdl2-2.0-0, libminizip1, libgtk-3-0 ";
|
print CTL "Depends: $pkgdeps[0]";
|
||||||
|
|
||||||
|
for ($i=1; $i<$#pkgdeps; $i++)
|
||||||
|
{
|
||||||
|
print CTL ", $pkgdeps[$i]";
|
||||||
|
}
|
||||||
|
print CTL "\n";
|
||||||
|
|
||||||
close CTL;
|
close CTL;
|
||||||
|
|
||||||
|
#system("cat $CTL_FILENAME");
|
||||||
#
|
#
|
||||||
#cd /tmp;
|
chdir "/tmp";
|
||||||
#dpkg-deb --build fceux
|
system("dpkg-deb --build fceux ");
|
||||||
#mv fceux.deb fceux-$VERSION.deb
|
if ( !(-e "/tmp/fceux.deb") )
|
||||||
#dpkg-deb -I fceux-$VERSION.deb
|
{
|
||||||
|
die "Error: Failed to create package $PKG_OUTPUT_FILE\n";
|
||||||
|
}
|
||||||
|
system("mv fceux.deb $PKG_OUTPUT_FILE");
|
||||||
|
system("dpkg-deb -I $PKG_OUTPUT_FILE");
|
||||||
#
|
#
|
||||||
|
if ( -e "/tmp/$PKG_OUTPUT_FILE" )
|
||||||
|
{
|
||||||
|
print "**********************************************\n";
|
||||||
|
print "Created deb package: /tmp/$PKG_OUTPUT_FILE\n";
|
||||||
|
print "**********************************************\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
die "Error: Failed to create package $PKG_OUTPUT_FILE\n";
|
||||||
|
}
|
||||||
|
|
|
@ -4,6 +4,10 @@ id
|
||||||
pwd
|
pwd
|
||||||
cat /etc/os-release
|
cat /etc/os-release
|
||||||
|
|
||||||
|
SCRIPT_DIR=$( cd $(dirname $BASH_SOURCE[0]); pwd );
|
||||||
|
|
||||||
|
#echo $SCRIPT_DIR;
|
||||||
|
|
||||||
gcc --version
|
gcc --version
|
||||||
python2 --version
|
python2 --version
|
||||||
python3 --version
|
python3 --version
|
||||||
|
@ -95,7 +99,16 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo '**************************************************************'
|
echo '**************************************************************'
|
||||||
echo 'Printing Packaged Files '
|
echo 'Printing To Be Packaged Files '
|
||||||
echo '**************************************************************'
|
echo '**************************************************************'
|
||||||
find $INSTALL_PREFIX
|
find $INSTALL_PREFIX
|
||||||
|
|
||||||
|
echo '**************************************************************'
|
||||||
|
echo 'Creating Debian Package'
|
||||||
|
echo '**************************************************************'
|
||||||
|
$SCRIPT_DIR/debpkg.pl;
|
||||||
|
|
||||||
|
echo '**************************************************************'
|
||||||
|
echo 'Testing Install of Package'
|
||||||
|
echo '**************************************************************'
|
||||||
|
dpkg -i /tmp/fceux*.deb
|
||||||
|
|
Loading…
Reference in New Issue