\r
class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML\r
{\r
- protected $nwplatform = 'osx64';\r
- protected $nwversion = '0.29.0';\r
- protected $node_platform = 'mac';\r
- protected $exenameMaxlength = 28;\r
-\r
- public function __construct($book_id)\r
- {\r
- parent::__construct($book_id);\r
- $this->version = 'mac-exe-html';\r
-\r
- }\r
-\r
- public function makePackage($zip)\r
- {\r
- $this->preparePackage();\r
- $toDelete = ['chromedriver', 'credits.html', 'minidump_stackwalk', 'nwjc', 'payload', 'v8_context_snapshot.bin', 'natives_blob.bin'];\r
- foreach ($toDelete as $item) {\r
- $p = $this->getFinalPackageDir() . '/' . $item;\r
- `rm -rf "$p"`;\r
- }\r
- if ($zip) {\r
- $res = $this->zip(null);\r
- } else {\r
- $res = $this->getFinalPackageDir();\r
- }\r
- $this->postPackage();\r
- return $res;\r
- }\r
-\r
- public function getAppPath()\r
- {\r
- return $this->getFinalPackageDir() . '/' . $this->exeName . '.app';\r
- }\r
-\r
- public function getFinalPackageDir()\r
- {\r
- $res = parent::getFinalPackageDir();\r
- return $res;\r
- }\r
-\r
- protected function preparePackage()\r
- {\r
- $this->initTempDir();\r
- $this->copyFluidbookFiles();\r
- $this->makeJSON();\r
-\r
- $this->buildPath = WS_PACKAGER . '/nwbuild/' . $this->version . '/' . $this->book_id;\r
- if (!file_exists($this->buildPath)) {\r
- mkdir($this->buildPath, 0777, true);\r
- }\r
-\r
- $cl = new CubeIT_CommandLine('/data/extranet/node_modules/nw-builder/bin/nwbuild');\r
- $cl->setPath(CONVERTER_PATH);\r
- $cl->setArg('p', $this->nwplatform);\r
- $cl->setArg('o', $this->buildPath);\r
- $cl->setArg('v', $this->nwversion);\r
- $cl->setArg('winIco', $this->vdir . '/icon.ico');\r
- $cl->setArg('macIcns', $this->vdir . '/icon.icns');\r
- $cl->setArg(null, $this->vdir);\r
- $cl->execute();\r
- $cl->debug();\r
-\r
- $this->replaceFFMpeg();\r
-\r
- $this->signApp();\r
- }\r
-\r
- function replaceFFMpeg()\r
- {\r
- $v = $this->getAppPath() . '/Contents/Versions/';\r
- $dr = opendir($v);\r
- while ($f = readdir($dr)) {\r
- if ($f == '.' || $f == '..') {\r
- continue;\r
- }\r
- $path = $v . '/' . $f;\r
- if (is_dir($path)) {\r
- copy(WS_COMPILE_ASSETS . '/_exehtml/_ffmpeg/libffmpeg.dylib', $path . '/libffmpeg.dylib');\r
- }\r
- }\r
- }\r
-\r
- protected function signApp()\r
- {\r
- $local_root = '/Sign/';\r
- $dist_root = '/mnt/sshfs/macparis' . $local_root;\r
-\r
- $f = 'tmp_' . md5(rand(0, 1000000)) . ".app";\r
- $path = $dist_root . $f;\r
-\r
- // Copy app to mac\r
- $cp = new CubeIT_CommandLine('cp');\r
- $cp->setArg('r');\r
- $cp->setArg(null, $this->getAppPath());\r
- $cp->setArg(null, $path);\r
- $cp->execute();\r
- $cp->debug();\r
-\r
- // Sign app\r
- $cl = new CubeIT_CommandLine('/Sign/sign');\r
- $cl->setSSH('paris.cubedesigners.com', 'vincent', 'atacama', 22022);\r
- $cl->setArg(null, $local_root . $f);\r
- $cl->execute();\r
- $cl->debug();\r
-\r
- // Copy back signed\r
- $cp = new CubeIT_CommandLine('rsync');\r
- $cp->setArg('r');\r
- $cp->setArg('l');\r
- $cp->setArg('p');\r
- $cp->setArg('D');\r
- $cp->setArg('v');\r
- $cp->setArg(null, $path . '/');\r
- $cp->setArg(null, $this->getAppPath() . '/');\r
- $cp->setArg('delete');\r
- $cp->execute();\r
- $cp->debug();\r
-\r
- `rm -rf $path`;\r
-\r
-\r
-// $cert = WS_COMPILE_ASSETS . '/_exehtml/certificats/developer_id_application/';\r
-//\r
-// $cl = new CubeIT_CommandLine('/usr/local/bin/isign');\r
-// $cl->setArg('k', $cert . 'vincent@cubedesigners.com.key');\r
-// $cl->setArg('c', $cert . 'developerID_application.pem');\r
-// $cl->setArg('o', $this->getSignedAppPath());\r
-// $cl->setArg(null, $this->getAppPath());\r
-// $cl->execute();\r
-// $cl->debug();\r
-//\r
-// echo $cl->commande;\r
-// echo $cl->output;\r
-// exit;\r
- }\r
+ protected $nwplatform = 'osx64';\r
+ protected $nwversion = '0.29.0';\r
+ protected $node_platform = 'mac';\r
+ protected $exenameMaxlength = 28;\r
+\r
+ public function __construct($book_id)\r
+ {\r
+ parent::__construct($book_id);\r
+ $this->version = 'mac-exe-html';\r
+\r
+ }\r
+\r
+ public function makePackage($zip)\r
+ {\r
+ $this->preparePackage();\r
+ $toDelete = ['chromedriver', 'credits.html', 'minidump_stackwalk', 'nwjc', 'payload', 'v8_context_snapshot.bin', 'natives_blob.bin'];\r
+ foreach ($toDelete as $item) {\r
+ $p = $this->getFinalPackageDir() . '/' . $item;\r
+ `rm -rf "$p"`;\r
+ }\r
+ if ($zip) {\r
+ $res = $this->zip(null);\r
+ } else {\r
+ $res = $this->getFinalPackageDir();\r
+ }\r
+ $this->postPackage();\r
+ return $res;\r
+ }\r
+\r
+ public function getAppPath()\r
+ {\r
+ return $this->getFinalPackageDir() . '/' . $this->exeName . '.app';\r
+ }\r
+\r
+ public function getFinalPackageDir()\r
+ {\r
+ $res = parent::getFinalPackageDir();\r
+ return $res;\r
+ }\r
+\r
+ protected function preparePackage()\r
+ {\r
+ $this->initTempDir();\r
+ $this->copyFluidbookFiles();\r
+ $this->makeJSON();\r
+\r
+ $this->buildPath = WS_PACKAGER . '/nwbuild/' . $this->version . '/' . $this->book_id;\r
+ if (!file_exists($this->buildPath)) {\r
+ mkdir($this->buildPath, 0777, true);\r
+ }\r
+\r
+ $cl = new CubeIT_CommandLine('/data/extranet/node_modules/nw-builder/bin/nwbuild');\r
+ $cl->setPath(CONVERTER_PATH);\r
+ $cl->setArg('p', $this->nwplatform);\r
+ $cl->setArg('o', $this->buildPath);\r
+ $cl->setArg('v', $this->nwversion);\r
+ $cl->setArg('winIco', $this->vdir . '/icon.ico');\r
+ $cl->setArg('macIcns', $this->vdir . '/icon.icns');\r
+ $cl->setArg(null, $this->vdir);\r
+ $cl->execute();\r
+ $cl->debug();\r
+\r
+ $this->replaceFFMpeg();\r
+\r
+ $this->signApp();\r
+ }\r
+\r
+ function replaceFFMpeg()\r
+ {\r
+ $v = $this->getAppPath() . '/Contents/Versions/';\r
+ $dr = opendir($v);\r
+ while ($f = readdir($dr)) {\r
+ if ($f == '.' || $f == '..') {\r
+ continue;\r
+ }\r
+ $path = $v . '/' . $f;\r
+ if (is_dir($path)) {\r
+ copy(WS_COMPILE_ASSETS . '/_exehtml/_ffmpeg/libffmpeg.dylib', $path . '/libffmpeg.dylib');\r
+ }\r
+ }\r
+ }\r
+\r
+ protected function signApp()\r
+ {\r
+ self::_signApp($this->getAppPath());\r
+ }\r
+\r
+ public static function _signApp($appPath)\r
+ {\r
+ $local_root = '/Users/vincent/Sign/';\r
+ $dist_root = '/mnt/sshfs/macparis' . $local_root;\r
+\r
+ $f = 'tmp_' . md5(rand(0, 1000000)) . ".app";\r
+ $path = $dist_root . $f;\r
+\r
+ // Copy app to mac\r
+ $cp = new CubeIT_CommandLine('cp');\r
+ $cp->setArg('r');\r
+ $cp->setArg(null, $appPath);\r
+ $cp->setArg(null, $path);\r
+ $cp->execute();\r
+ $cp->debug();\r
+\r
+ // Sign app\r
+ $cl = new CubeIT_CommandLine($local_root . 'sign');\r
+ $cl->setSSH('paris.cubedesigners.com', 'vincent', 'atacama', 22022);\r
+ $cl->setArg(null, $local_root . $f);\r
+ $cl->execute();\r
+ $cl->debug();\r
+\r
+ // Copy back signed\r
+ $cp = new CubeIT_CommandLine('rsync');\r
+ $cp->setArg('r');\r
+ $cp->setArg('l');\r
+ $cp->setArg('p');\r
+ $cp->setArg('D');\r
+ $cp->setArg('v');\r
+ $cp->setArg(null, $path . '/');\r
+ $cp->setArg(null, $appPath . '/');\r
+ $cp->setArg('delete');\r
+ $cp->execute();\r
+ $cp->debug();\r
+\r
+ `rm -rf $path`;\r
+ }\r
}\r
<?php\r
\r
-class wsPackagerMacEXE extends wsPackager {\r
- protected $exeName;\r
-\r
- public function __construct($book_id) {\r
- parent::__construct($book_id);\r
- $this->version = 'mac-exe';\r
- $this->book->parametres->alwaysHTML5 = false;\r
-\r
- $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, 30));\r
- }\r
-\r
- protected function preparePackage() {\r
- parent::preparePackage();\r
-\r
- $this->copyFluidbookFiles();\r
- $this->copyOtherFiles(array('Fluidbook.app.zip'));\r
- }\r
-\r
- public function makePackage($zip) {\r
- parent::makePackage($zip);\r
- $res = $this->zip($this->vdir . 'Fluidbook.app.zip');\r
- $this->postPackage();\r
- return $res;\r
- }\r
-}\r
+class wsPackagerMacEXE extends wsPackager\r
+{\r
+ protected $exeName;\r
+\r
+ public function __construct($book_id)\r
+ {\r
+ parent::__construct($book_id);\r
+ $this->version = 'mac-exe';\r
+ $this->book->parametres->alwaysHTML5 = false;\r
+\r
+ $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, 30));\r
+ }\r
+\r
+ protected function preparePackage()\r
+ {\r
+ parent::preparePackage();\r
+\r
+ $this->copyFluidbookFiles();\r
+ $this->copyOtherFiles(array('Fluidbook.app.zip'));\r
\r
-?>
\ No newline at end of file
+ $this->signApp();\r
+ }\r
+\r
+ public function makePackage($zip)\r
+ {\r
+ parent::makePackage($zip);\r
+ $res = $this->zip($this->vdir . 'Fluidbook.app.zip');\r
+ $this->postPackage();\r
+ return $res;\r
+ }\r
+\r
+ public function getAppPath()\r
+ {\r
+ return $this->getFinalPackageDir() . '/Fluidbook.app';\r
+ }\r
+\r
+ protected function signApp()\r
+ {\r
+ wsPackagerMacEXEHTML::_signApp($this->getAppPath());\r
+ }\r
+}\r