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

Start moving Arch build responsibility to Robo

Also clean up the generic packaging task
This commit is contained in:
J. King 2021-05-19 08:51:17 -04:00
parent 19ab9df063
commit 79391446cd
2 changed files with 33 additions and 27 deletions

View file

@ -149,7 +149,7 @@ class RoboFile extends \Robo\Tasks {
* *
* The version to package may be any Git tree-ish identifier: a tag, a branch, * The version to package may be any Git tree-ish identifier: a tag, a branch,
* or any commit hash. If none is provided on the command line, Robo will prompt * or any commit hash. If none is provided on the command line, Robo will prompt
* for a commit to package; the default is "head". * for a commit to package; the default is "HEAD".
* *
* Note that while it is possible to re-package old versions, the resultant tarball * Note that while it is possible to re-package old versions, the resultant tarball
* may not be equivalent due to subsequent changes in the exclude list, or because * may not be equivalent due to subsequent changes in the exclude list, or because
@ -164,7 +164,9 @@ class RoboFile extends \Robo\Tasks {
// create a temporary directory // create a temporary directory
$dir = $t->tmpDir().\DIRECTORY_SEPARATOR; $dir = $t->tmpDir().\DIRECTORY_SEPARATOR;
// create a Git worktree for the selected commit in the temp location // create a Git worktree for the selected commit in the temp location
$t->taskExec("git worktree add ".escapeshellarg($dir)." ".escapeshellarg($version)); $t->taskExec("git worktree add ".escapeshellarg($dir)." ".escapeshellarg($version))
->completion($this->taskFilesystemStack()->remove($dir))
->completion($this->taskExec("git worktree prune"));
// perform Composer installation in the temp location with dev dependencies // perform Composer installation in the temp location with dev dependencies
$t->taskComposerInstall()->dir($dir); $t->taskComposerInstall()->dir($dir);
// generate the manual // generate the manual
@ -195,13 +197,36 @@ class RoboFile extends \Robo\Tasks {
]); ]);
// generate a sample configuration file // generate a sample configuration file
$t->taskExec(escapeshellarg(\PHP_BINARY)." arsse.php conf save-defaults config.defaults.php")->dir($dir); $t->taskExec(escapeshellarg(\PHP_BINARY)." arsse.php conf save-defaults config.defaults.php")->dir($dir);
// remove any existing archive
$t->taskFilesystemStack()->remove($archive);
// package it all up // package it all up
$t->taskPack($archive)->addDir("arsse", $dir); $t->taskPack($archive)->addDir("arsse", $dir);
// execute the collection // execute the collection
$out = $t->run(); return $t->run();
// clean the Git worktree list }
$this->_exec("git worktree prune");
return $out; /** Packages a given commit of the software into an Arch package
*
* The version to package may be any Git tree-ish identifier: a tag, a branch,
* or any commit hash. If none is provided on the command line, Robo will prompt
* for a commit to package; the default is "HEAD".
*
* Note that while it is possible to re-package old versions, the resultant tarball
* may not be equivalent due to subsequent changes in the exclude list, or because
* of new tooling.
*/
public function packageArch(string $version = null): Result {
// establish which commit to package
$version = $version ?? $this->askDefault("Commit to package:", "HEAD");
$archive = BASE."arsse-$version.tar.gz";
// start a collection
$t = $this->collectionBuilder();
// create a tarball
$t->addCode(function() use ($version) {
return $this->package($version);
});
// extract PKGBUILD and run it; todo
return $t->run();
} }
/** Generates static manual pages in the "manual" directory /** Generates static manual pages in the "manual" directory

23
dist/arch/PKGBUILD vendored
View file

@ -1,42 +1,23 @@
pkgname="arsse" pkgname="arsse"
pkgver=0.9.1.r16.d1fd6e9 pkgver=0.9.1
pkgrel=1 pkgrel=1
epoch= epoch=
pkgdesc="RSS/Atom newsfeed synchronization server" pkgdesc="RSS/Atom newsfeed synchronization server"
arch=("any") arch=("any")
url="https://thearsse.com/" url="https://thearsse.com/"
license=("MIT") license=("MIT")
groups=()
depends=() depends=()
makedepends=("git" "php" "php-intl" "composer") makedepends=("git" "php" "php-intl" "composer")
checkdepends=() checkdepends=()
optdepends=("php-pgsql: PostgreSQL database support" optdepends=("php-pgsql: PostgreSQL database support"
"nginx: HTTP server" "nginx: HTTP server"
"apache: HTTP server") "apache: HTTP server")
provides=()
conflicts=()
replaces=()
backup=("etc/webapps/arsse/config.php" "etc/php/php-fpm.d/arsse.conf") backup=("etc/webapps/arsse/config.php" "etc/php/php-fpm.d/arsse.conf")
options=()
install= install=
changelog= changelog=
source=("git+file://$(dirname $(dirname $(pwd)))") source=("arsse-0.9.1.tar.gz")
noextract=()
md5sums=("SKIP") md5sums=("SKIP")
pkgver() {
git describe --tags | sed 's/\([^-]*-\)g/r\1/;s/-/./g'
}
build() {
cd "$srcdir/arsse"
composer install
./robo manual
composer install --no-dev -o -n --no-scripts
php arsse.php conf save-defaults config.defaults.php
rm -r vendor/bin
}
package() { package() {
depends=("php" "php-intl" "php-sqlite" "php-fpm") depends=("php" "php-intl" "php-sqlite" "php-fpm")
cd "$pkgdir" cd "$pkgdir"