Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abn/symboldb

ELF and Java symbol database
https://github.com/abn/symboldb

Last synced: 7 days ago
JSON representation

ELF and Java symbol database

Awesome Lists containing this project

README

        

Prerequisites
─────────────

In addition to the usual C++ build environment, you need the following
development packages:

- cmake
- curl-devel
- elfutils-devel
- elfutils-libelf-devel
- expat-devel
- gawk (for /usr/bin/awk)
- libarchive-devel
- nss-devel
- postgresql-devel
- postgresql-server
- rpm-devel
- vim-common (for /usr/bin/xxd)
- xmlto
- zlib-devel

Building
────────

Create a build directory, run cmake and make:

mkdir build
cd build
cmake ..
make
cd ..
build/runtests

Alternatively, you can use the Ninja build tool:

mkdir build
cd build
cmake -G Ninja -DCMAKE_MAKE_PROGRAM=ninja-build ..
ninja-build
cd ..
build/runtests

Running
───────

╔════════════════════════════════════════════════════════════════════╗
║ NOTE: The database schema is still evolving. I do not provide ║
║ automated schema migration support at this stage because I do not ║
║ assume that there are any users of this code. Please drop me a ║
║ note (at ) if you use this software, and I ║
║ will be more careful about database schema changes. ║
╚════════════════════════════════════════════════════════════════════╝

symboldb honors the PGUSER, PGDATABASE etc. variables generally used
by PostgreSQL applications. If you want to change the defaults, you
have to set those environment variables. The database schema is
currently hard-coded to "symboldb".

To create a database for your user account (named "USER"), run the
following commands as the "postgres" user:

createuser USER
createdb --lc-collate=C USER

(The symboldb SQL schema contains COLLATE "C" annotations in many
places, so re-using an existing database with another collation scheme
is possible without a performance loss.)

If you plan to load large repositories (such as Fedora releases), you
need to tune your PostgreSQL installation. At least the very least,
increase the "shared_buffers" and "checkpoint_segments" values.

Afterwards, as "USER", run "psql" to check if you can access the
database. The following commands have to be invoked as "USER", too.

This command creates the "symboldb" database schema:

symboldb --create-schema

This adds RPM files to the database, skipping already imported RPMs
(based on the content hash):

symboldb --load-rpm *.rpm

Multiple load commands can be executed in parallel, but imports will
occasionally fail (due to an aborted database transaction) if the same
RPM file is loaded concurrently.

RPMs can be assigned to a package set (roughly equivalent to a
compose) using:

symboldb --create-set=Fedora/18/x86_64 *.rpm

To load RPMs from a combination of composes, use this command

symboldb --create-set=Fedora/18/x86_64
symboldb --update-set-from-repo=Fedora/18/x86_64 \
http://download.fedoraproject.org/pub/fedora/linux/updates/18/x86_64/ \
http://download.fedoraproject.org/pub/fedora/linux/releases/18/Everything/x86_64/os/

This only downloads the latest version for each package
name/architecture combination. RPMs are cached in a directory under
~/.cache/symboldb by default.

A single package set can cover multiple architectures. The name of
the package set, Fedora/18/x86_64 in the example, just follows a
naming convention and is not interpreted by the tool.

A symboldb.1 manual page will be written to the build directory.
Examples for SQL queries are found in the doc/examples directory.

-- Florian Weimer