# 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. ## How it works? Upload file to repository via PUT request: ```bash curl -X PUT --data-binary "@/tmp/pv-1.6.20-x86_64-1_SBo.tgz" -H 'auth: welcometothejungle' http://reposerver.tld/api/upload/repository/pv-1.6.20-x86_64-1_SBo.tgz ``` 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: ```bash 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](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: ```json { "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 is very-very close to one found in AlienBob's [repositories](http://www.slackware.com/~alien/slackbuilds/), 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 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](https://github.com/unbit/uwsgi) 2.0.19. ```bash #!/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} ``` 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, uwsgi. You can get SlackBuilds for them on [SBo](https://slackbuilds.org/repository/14.2/). 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](https://docs.slackware.com/wiki:user:alienbob) and [SBo team](https://slackbuilds.org/contributors/). ## What is missing here? At least proper documentaion of metadata format generated by this particular application. :)