Skip to content

Commit

Permalink
Various tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Sep 19, 2024
1 parent cc0a001 commit 04f99b4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 25 deletions.
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,18 @@ else
STAGE=$(DESTDIR)
endif

# For deployment, the app and documentation
.PHONY: deploy
deploy: app $(DOC_TARGETS)

# Build just the app
.PHONY: app
app: $(BIN)/smax-postgres

# Build everything...
.PHONY: all
all: deploy check

.PHONY: deploy
deploy: app $(DOC_TARGETS)

# Remove intermediates
.PHONY: clean
clean:
Expand All @@ -61,8 +66,7 @@ SOURCES = $(SRC)/smax-postgres.c $(SRC)/logger-config.c $(SRC)/postgres-backend.
OBJECTS := $(subst $(SRC),$(OBJ),$(SOURCES))
OBJECTS := $(subst .c,.o,$(OBJECTS))

.PHONY: app
app: $(BIN)/smax-postgres


$(BIN)/smax-postgres: $(OBJECTS) | $(BIN)

Expand Down
45 changes: 26 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,44 @@
<br clear="all">


# Record SMA-X history in PostgreSQL / TimescaleDB
# smax-postgres

`smax-postgres` is a daemon application, which can collect data from an SMA-X realtime database and insert these into
a PostgreSQL database to create a time-series historical record for all or selected SMA-X variables. The program is
highly customizable and supports both regular updates for changing variables as well as regular snapshots of all
selected SMA-X variables.
Record SMA-X history in PostgreSQL / TimescaleDB.

- [API documentation](https://smithsonian.github.io/smax-postgres/apidoc/html/files.html)
- [Project page](https://smithsonian.github.io/smax-postgres) on github.io
- [Project pages](https://smithsonian.github.io/smax-postgres) on github.io

Author: Attila Kovacs

Last Updated: 18 September 2024

----------------------------------------------------------------------------------------------------------------------

## Table of Contents

- [Prerequisites](#prerequisites)
- [Buildinh smax-postgres](#building)
- [Installation](#installation)
- [Database organization (for clients)](#database-organization)
- [Configuration reference](#configuration-reference)
- [Instroduction](#introduction)
- [Prerequisites](#prerequisites)
- [Buildinh smax-postgres](#building)
- [Installation](#installation)
- [Database organization (for clients)](#database-organization)
- [Configuration reference](#configuration-reference)

----------------------------------------------------------------------------------------------------------------------

<a name="introduction"></a>
## Introduction

`smax-postgres` is a daemon application, which can collect data from an SMA-X realtime database and insert these into
a PostgreSQL database to create a time-series historical record for all or selected SMA-X variables. The program is
highly customizable and supports both regular updates for changing variables as well as regular snapshots of all
selected SMA-X variables.



<a name="prerequisites"></a>
## Prerequisites

The SMA-X C/C++ library has a build and runtime dependency on the following software:
The `smax-potgres` application has a build and runtime dependency on the following software:

- PostgreSQL installation and development files (`libpq.so` and `lipq.fe.h`).
- [Smithsonian/clib](https://github.com/Smithsonian/smax-clib)
Expand All @@ -58,9 +70,6 @@ Additionally, to configure your SMA-X server, you will need the
<a name="building"></a>
## Building smax-postgres

The __smax-clib__ library can be built either as a shared (`libsmax.so[.1]`) and as a static (`libsmax.a`) library,
depending on what suits your needs best.

You can configure the build, either by editing `config.mk` or else by defining the relevant environment variables
prior to invoking `make`. The following build variables can be configured:

Expand Down Expand Up @@ -99,10 +108,8 @@ prior to invoking `make`. The following build variables can be configured:

- `CHECKEXTRA`: Extra options to pass to `cppcheck` for the `make check` target

After configuring, you can simply run `make`, which will build the `shared` (`lib/libsmax.so[.1]`) and `static`
(`lib/libsmax.a`) libraries, local HTML documentation (provided `doxygen` is available), and performs static
analysis via the `check` target. Or, you may build just the components you are interested in, by specifying the
desired `make` target(s). (You can use `make help` to get a summary of the available `make` targets).
After configuring, you can simply run `make`, which will build `bin/smax-postgres`, and user documentation. You may
also build other `make` target(s). (You can use `make help` to get a summary of the available `make` targets).

Now you may compile `smax-postgres`:

Expand Down
2 changes: 1 addition & 1 deletion resources/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta charset="utf-8"/>
<meta name="description" content="PostgreSQL / TimescaleDB logger for SMA-X"/>
<meta name="description" content="Record SMA-X history in PostgreSQL / TimescaleDB"/>
<meta name="keywords" content="SMA-X PostgreSQL connector, structured data, data exchange, C, C++, C99, software library, open source, PostgreSQL, TimescaleDB, time-series history"/>
<meta name="author" content="Attila Kovacs"/>
<meta name="copyright" content="(C)2024 Attila Kovacs" />
Expand Down

0 comments on commit 04f99b4

Please sign in to comment.