Ticket #5981: MythTV-win32_packager.pl-mysql.patch

File MythTV-win32_packager.pl-mysql.patch, 6.5 KB (added by Jonathan Martens <jonathan@…>, 15 years ago)
  • Win32/build/win32-packager.pl

     
    172172my $mythtv  = 'C:/mythtv/';       # this is where the entire SVN checkout lives
    173173                                  # so c:/mythtv/mythtv/ is the main codebase.
    174174my $build   = 'C:/mythtv/build/'; # where 'make install' installs into
     175my $mysql   = 'C:/Program Files/MySQL/MySQL Server 5.0/';
    175176
    176177# Where is the users home?
    177178# Script later creates $home\.mythtv\mysql.txt
     
    192193my $dossources = perl2dos($sources);
    193194my $dosmingw   = perl2dos($mingw);
    194195my $dosmythtv  = perl2dos($mythtv);
     196my $dosmysql   = perl2dos($mysql);
    195197
    196198# Unix/MSys equiv. versions of the paths (for when we shell to MSYS/UNIX mode):
    197199my $unixmsys  = '/';       # MSys root is always mounted here,
     
    204206my $unixmythtv  = perl2unix($mythtv);
    205207my $unixhome    = perl2unix($home);
    206208my $unixbuild   = perl2unix($build);
     209my $unixmysql   = perl2unix($mysql);
    207210
    208211# The installer for MinGW:
    209212my $MinGWinstaller = 'MinGW-5.1.4.exe';
     
    431434[ archive => $sources.'mysql-essential-5.0.67-win32.msi',
    432435  'fetch' => 'http://mirror.services.wisc.edu/mysql/Downloads/MySQL-5.0/mysql-essential-5.0.67-win32.msi',
    433436  comment => 'fetch mysql binaries - this is a big download(23MB) so it might take a while' ],
    434 [ file    => "c:/Program Files/MySQL/MySQL Server 5.0/bin/libmySQL.dll",
     437[ file    => $dosmysql . "bin/libmySQL.dll",
    435438  exec    => $dossources.'mysql-essential-5.0.67-win32.msi INSTALLLEVEL=2',
    436439  comment => 'Install mysql - be sure to choose to do a "COMPLETE" install. You should also choose NOT to "configure the server now" ' ],
    437440
    438441# after mysql install
    439 [ filesame => [$mingw.'bin/libmySQL.dll','c:/Program Files/MySQL/MySQL Server 5.0/bin/libmySQL.dll'], 
     442[ filesame => [$mingw.'bin/libmySQL.dll', $dosmysql . 'bin/libmySQL.dll'], 
    440443  copy     => [''=>'',
    441444  comment  => 'post-mysql-install'] ],
    442 [ filesame => [$mingw.'lib/libmySQL.dll','c:/Program Files/MySQL/MySQL Server 5.0/bin/libmySQL.dll'], 
     445[ filesame => [$mingw.'lib/libmySQL.dll', $dosmysql . 'bin/libmySQL.dll'], 
    443446  copy     => [''=>'',
    444447  comment  => 'post-mysql-install'] ],
    445 [ filesame => [$mingw.'lib/libmysql.lib','c:/Program Files/MySQL/MySQL Server 5.0/lib/opt/libmysql.lib'], 
     448[ filesame => [$mingw.'lib/libmysql.lib', $dosmysql . 'lib/opt/libmysql.lib'], 
    446449  copy     => [''=>''] ],
    447450[ file     => $mingw.'include/mysql.h'  ,   
    448   exec     => 'copy /Y "c:\Program Files\MySQL\MySQL Server 5.0\include\*" '.$dosmingw."include" ],
     451  exec     => 'copy /Y "' . $dosmysql . 'include\*" '.$dosmingw."include" ],
    449452 
    450453 
    451454# make sure that /mingw is mounted in MSYS properly before trying to use the /mingw folder
     
    491494  shell   => ["cd /mingw/include","patch -p0 < mysql___h.patch"],
    492495  comment => 'Apply mysql.h patch file, if not already applied....' ],
    493496
    494 
    495497# fetch it
    496498[ dir     => $sources.'pthread',
    497499  mkdirs  => $sources.'pthread' ],
     
    16251627[ grep   => ['SERVICE_NAME',$mythtv.'testmysqlsrv.bat'],
    16261628  exec   => ['sc start mysql','nocheck']],
    16271629[ grep   => ['does not exist',$mythtv.'testmysqlsrv.bat'],
    1628   exec   => ['C:\Program Files\MySQL\MySQL Server 5.0\bin\MySQLd-nt.exe'.
     1630  exec   => [$dosmysql . 'bin\MySQLd-nt.exe'.
    16291631             ' --standalone  -console','nocheck']],
    16301632
    16311633 
     
    16351637echo testing connection to a local mysql server...
    16361638sleep 5
    16371639del '.$dosmythtv.'_mysqlshow_err.txt
    1638 "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqlshow.exe" -u mythtv --password=mythtv 2> '.$dosmythtv.'_mysqlshow_err.txt  > '.$dosmythtv.'_mysqlshow_out.txt
     1640"' . $dosmysql . 'bin\mysqlshow.exe" -u mythtv --password=mythtv 2> '.$dosmythtv.'_mysqlshow_err.txt  > '.$dosmythtv.'_mysqlshow_out.txt
    16391641type '.$dosmythtv.'_mysqlshow_out.txt >> '.$dosmythtv.'_mysqlshow_err.txt
    16401642del '.$dosmythtv.'_mysqlshow_out.txt
    16411643sleep 1
     
    16491651# if the connection was good, or the permissions were wrong, but the server
    16501652# was there, there's no need to reconfigure the server!
    16511653[ grep    => ['(\+--------------------\+|Access denied for user)',$mythtv.'_mysqlshow_err.txt'],
    1652   exec    => ['C:\Program Files\MySQL\MySQL Server 5.0\bin\MySQLd-nt.exe --standalone  -console','nocheck'],
     1654  exec    => [$dosmysql . 'bin\MySQLd-nt.exe --standalone  -console','nocheck'],
    16531655  comment => 'See if we couldnt connect to a local mysql server. Please re-configure the MySQL server to start as a service.'],
    16541656
    16551657# try again to connect as mythtv/mythtv first (the best case scenario) - the
     
    16731675echo REPLACE INTO user VALUES ('localhost','mythtv', PASSWORD('mythtv'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); >>resetmythtv.sql
    16741676echo INSERT IGNORE INTO user VALUES ('\%\%','mythtv', PASSWORD('mythtv'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); >>resetmythtv.sql
    16751677echo REPLACE INTO user VALUES ('\%\%','mythtv', PASSWORD('mythtv'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); >>resetmythtv.sql
    1676 echo trying to reset mythtv/mythtv passwords:
    1677 \"C:\\Program Files\\MySQL\\MySQL Server 5.0\\bin\\mysqld-nt.exe\" --no-defaults --bind-address=127.0.0.1 --bootstrap --console --skip-grant-tables --skip-innodb --standalone <resetmythtv.sql
     1678echo trying to reset mythtv/mythtv passwords:" .
     1679'"' . $dosmysql . 'bin\mysqld-nt.exe" --no-defaults --bind-address=127.0.0.1 --bootstrap --console --skip-grant-tables --skip-innodb --standalone <resetmythtv.sql
    16781680del resetmythtv.sql
    16791681echo trying to re-start mysql
    16801682rem net stop MySQL
    16811683net start MySQL
    16821684rem so that the server has time to start before we query it again
    16831685echo.
    16841686echo Password for user 'mythtv' was reset to 'mythtv'
    16851687echo.
     
    17051707# this has the 'nocheck' flag because the creation of the DB doesn't
    17061708# instantly reflect in the .txt file we are looking at:
    17071709[ grep    => ['mythconverg',$mythtv.'_mysqlshow_err.txt'],
    1708   exec    => [ 'echo create database mythconverg; | "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql.exe" -u mythtv --password=mythtv','nocheck'],
     1710  exec    => [ 'echo create database mythconverg; | "' . $dosmysql . 'bin\mysql.exe" -u mythtv --password=mythtv','nocheck'],
    17091711  comment => ' does the mythconverg database exist? (and can this user see it?) '],
    17101712
    17111713# Make mysql.txt file required for testing