4.9 KiB
Slackmetarep - Slackware repository metadata generator
About
Slackware repository metadata generator and upload server.
What for?
For receiving package uploads and creating metadata for slackware package repositories.
Main idea is to use it in automated CI process.
What this application is not for?
It is not designed for large scale repositories or for use as a public service.
How it works?
Upload file to repository via PUT request:
curl -X PUT --data-binary "@/bin/bash" -H 'auth: welcometothejungle' http://reposerver.tld/api/upload/repository/file.ext
Where repository is same that set in config.json and file.ext is package or piece of metadata
When all chunks of metadata and package are uploaded, you may issue metagen command:
curl -H 'repo: repository' 'http://reposerver.tld/api/metagen'
What metadata?
As an example for building this application data format in AlienBob repository is taken. There is some different files that contain pieces of information for generating metadata comptible with one used for Slackware-14.2 repositories.
More detailed information in docs/metadata_en.md
So this tool needs these metadata chunks to properly write metadata:
- packagename-version-arch-suffix.lst
- packagename-version-arch-suffix.meta
- packagename-version-arch-suffix.tgz.md5
- packagename-version-arch-suffix.txt
Additional JSON-formatted metadata if required for buildinfo module to work. An example of it:
{
"dmenu" : {
"SRC" : [
"dmenu-4.8.tar.gz"
]
},
"docker" : {
"DEPS" : [
"containerd",
"docker-proxy",
"tini",
"google-go-lang"
],
"GROUP" : {
"docker" : "281"
},
"SRC" : [
"docker-ce-19.03.13.tar.gz"
],
"USER" : {
"docker" : {
"GROUP" : "docker",
"HOME" : "/var/lib/docker",
"SHELL" : "/bin/false",
"UID" : "281"
}
}
},
"perf" : {
"DEPS" : [
"libunwind",
"kernel-headers",
"kernel-source"
]
}
}
But this data intended to help in package build script that prepares build environment, runs SlackBuilds, upload files to repo and kicks metadata generation process.
All metadata required and generated by this application very-very close to one found in AlienBob's repositories, except no changelogs and rss are generated.
Installation
In order to run this application, you need to "bootstrap" it - download and build all required dependencies and libraries.
You'll need "Development Tools" or similar group of packages, perl, perl-devel, perl-local-lib, perl-app-cpanm, zlib-devel, openssl-devel, libdb4-devel (Berkeley DB devel), make.
After installng required dependencies it is possible to run:
bash bootstrap.sh
and all libraries should be downloaded, built, tested and installed.
This application is tested and runs okay on Slackware64-14.2.
How to run this?
Via uWSGI.
#!/bin/ash
exec 2>&1
LOGDIR=/var/log/uwsgi
PIDDIR=/var/run/uwsgi
WORKDIR=/var/www/slackmetarep
mkdir -p $LOGDIR
chown -R apache:apache $LOGDIR
mkdir -p $PIDDIR
cd $WORKDIR
# for 100% sure
export PERL5LIB="${WORKDIR}/vendor_perl"
export PERL_LIB="$PERL5LIB"
exec sudo -u apache -g apache /usr/bin/uwsgi \
--yaml ${WORKDIR}/slackmetarep.yaml \
--pidfile ${PIDDIR}/slackmetarep.pid \
--perl-local-lib ${PERL5LIB}
At least i use uwsgi-2.0.19 for this. Starman suits well too and should work without any problems. You can also try Nginx UNIT, but it was totally not tested.
As mentioned above this application tested on Slackware Linux 14.2 for x86_64. At least you'll need perl-AnyEvent, perl-Coro, perl-Devel-StackTrace, perl-local-lib, cpanminus, perl-common-sense, perl-Guard, perl-EV, perl-Canary-Stability, perl-event. You can get SlackBuilds for them on SBo. After installing all these packages you'll be able to bootatrap and run slackmetarep.
How to contribute?
Got something about this project? Make PR.
Who should i thank?
Slackware mainatiners for their continous labour. Notably AlienBob and SBo team.
What is missing here?
At least proper documentaion of metadata format generated by this particular application. :)