Initial commit
This commit is contained in:
154
README.md
Normal file
154
README.md
Normal file
@@ -0,0 +1,154 @@
|
||||
# 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:
|
||||
|
||||
```bash
|
||||
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:
|
||||
|
||||
```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 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.
|
||||
|
||||
## How to run this?
|
||||
|
||||
Via [uWSGI](https://github.com/unbit/uwsgi).
|
||||
|
||||
```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}
|
||||
|
||||
```
|
||||
|
||||
At least i use uwsgi for this. Starman suits well too and should work without any problems. You can also try
|
||||
[Nginx UNIT](https://unit.nginx.org/), but it was totally not tested.
|
||||
|
||||
## 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.
|
||||
|
||||
## What is missing here?
|
||||
|
||||
At least proper documentaion of metadata format generated by this particular application.
|
||||
Reference in New Issue
Block a user