1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 21:22:40 +00:00

Prototype Debian rules file

This commit is contained in:
J. King 2021-05-21 12:51:20 -04:00
parent 3537e74d49
commit 3c9f4dd66f
2 changed files with 26 additions and 0 deletions

View file

@ -246,6 +246,26 @@ class RoboFile extends \Robo\Tasks {
return $t->run(); return $t->run();
} }
/** Packages a release tarball into a Debian package */
public function packageDeb(string $tarball): Result {
$t = $this->collectionBuilder();
$dir = $t->tmpDir().\DIRECTORY_SEPARATOR;
// name the "orig" tarball
$orig = $dir.str_replace(".tar.gz", ".orig.tar.gz", str_replace("arsse-", "arsse_", basename($tarball)));
// copy the tarball
$t->addTask($this->taskFilesystemStack()->copy($tarball, $orig));
// extract the tarball and keep all "dist files"
$t->addCode(function() use ($tarball, $dir) {
// because Robo doesn't support extracting a single file we have to do it ourselves
(new \Archive_Tar($tarball))->extract($dir, false);
// perform a do-nothing filesystem operation since we need a Robo task result
return $this->taskFilesystemStack()->rename($dir."arsse", $dir."src")->run();
});
$t->addTask($this->taskFilesystemStack()->mirror($dir."src/dist", $dir));
$t->addTask($this->taskExec("deber")->dir($dir));
return $t->run();
}
/** Generates static manual pages in the "manual" directory /** Generates static manual pages in the "manual" directory
* *
* The resultant files are suitable for offline viewing and inclusion into release builds * The resultant files are suitable for offline viewing and inclusion into release builds

6
dist/debian/rules vendored Normal file
View file

@ -0,0 +1,6 @@
#!/usr/bin/make -f
DH_VERBOSE = 1
%:
dh $@