diff --git a/.distignore b/.distignore
new file mode 100644
index 000000000..683375753
--- /dev/null
+++ b/.distignore
@@ -0,0 +1,16 @@
+build
+thirdparty
+clients
+
+.git
+.gitmodules
+.gitignore
+.dockerignore
+
+.DS_Store
+*~
+
+*.o
+*.d
+
+villas-*
\ No newline at end of file
diff --git a/.dockerignore b/.dockerignore
index bec958ec2..33849337c 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,4 +1,5 @@
*
+!build/release/packaging/rpm/*
!thirdparty/libxil/
!thirdparty/criterion/
!thirdparty/libwebsockets/
\ No newline at end of file
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e9a1324ab..64a7c661b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,7 +17,6 @@ stages:
# Build docker image which is used to build & test VILLASnode
docker-image:
stage: prepare
- # Must match the docker version on the build machine!
before_script:
- git submodule sync --recursive
- git submodule update --recursive --init
@@ -107,14 +106,25 @@ website:
tags:
- villas-deploy
+packaging:
+ stage: deploy
+ script:
+ - make rpm
+ tags:
+ - shell
+ - fedora
+
deliver:
stage: deploy
script:
- rsync -r build/release/doc/html/ $DEPLOY_PATH/doc/$CI_BUILD_REF_NAME/
- rsync -r build/release-coverage/coverage/ $DEPLOY_PATH/coverage/$CI_BUILD_REF_NAME/
+ - rsync -r build/release/packaging/rpm/RPMS $DEPLOY_PATH/../packages
+ - createrepo $DEPLOY_PATH/../packages
dependencies:
- docs
- coverage
+ - packaging
tags:
- villas-deploy
diff --git a/Dockerfile b/Dockerfile
index d3f6d1f00..6b31aae8a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,86 +1,37 @@
-# Dockerfile for VILLASnode development and testing
+# Dockerfile for VILLASnode dependencies.
#
-# Use this Dockerfile running:
-# $ make docker
+# This Dockerfile builds an image which contains all library dependencies
+# and tools to build VILLASnode.
+# However, VILLASnode itself it not part of the image.
#
# @author Steffen Vogel
-# @copyright 2016, Institute for Automation of Complex Power Systems, EONERC
+# @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
###################################################################################
FROM fedora:latest
MAINTAINER Steffen Vogel
-# Expose ports for HTTP and WebSocket frontend
+# Install dependencies
+RUN dnf -y update && \
+ dnf -y install \
+ libconfig \
+ libnl3 \
+ libcurl \
+ jansson
+
+# Some additional tools required for running VILLASnode
+RUN dnf -y update && \
+ dnf -y install \
+ iproute \
+ openssl \
+ kernel-modules-extra
+
+# Install our own RPMs
+COPY build/release/packaging/rpm/RPMS/ /rpms/
+RUN rpm -i /rpms/x86_64/{libxil,libwebsockets,villas-node,villas-node-doc}-[0-9]*; rm -rf /rpms/
+
+# For WebSocket / API access
EXPOSE 80
EXPOSE 443
-# Toolchain & dependencies
-RUN dnf -y update && \
- dnf -y install \
- pkgconfig \
- gcc \
- make \
- wget \
- tar \
- cmake \
- openssl-devel \
- libconfig-devel \
- libnl3-devel \
- libcurl-devel \
- jansson-devel
-
-# Tools for documentation
-RUN dnf -y update && \
- dnf -y install \
- doxygen \
- dia \
- graphviz
-
-# Tools for deployment / packaging
-RUN dnf -y update && \
- dnf -y install \
- openssh-clients \
- rpmdevtools \
- rpm-build
-
-# Tools to build dependencies
-RUN dnf -y update && \
- dnf -y install \
- git \
- gcc-c++ \
- autoconf \
- automake \
- autogen \
- libtool \
- flex \
- bison \
- texinfo
-
-# Tools for coverage and profiling
-RUN dnf -y update && \
- dnf -y install \
- python-pip && \
- pip install \
- gcovr
-
-ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
-ENV LD_LIBRARY_PATH /usr/local/lib
-
-# Build & Install libxil
-COPY thirdparty/libxil /tmp/libxil
-RUN mkdir -p /tmp/libxil/build && cd /tmp/libxil/build && cmake .. && make install
-
-# Build & Install Criterion
-COPY thirdparty/criterion /tmp/criterion
-RUN mkdir -p /tmp/criterion/build && cd /tmp/criterion/build && cmake .. && make install
-
-# Build & Install libwebsockets
-COPY thirdparty/libwebsockets /tmp/libwebsockets
-RUN mkdir -p /tmp/libwebsockets/build && cd /tmp/libwebsockets/build && cmake .. && make install
-
-# Cleanup intermediate files from builds
-RUN rm -rf /tmp/*
-
-WORKDIR /villas
-
-ENTRYPOINT make clean && make install && villas node; bash
+ENTRYPOINT ["villas"]
\ No newline at end of file
diff --git a/Dockerfile.dev b/Dockerfile.dev
new file mode 100644
index 000000000..15e798543
--- /dev/null
+++ b/Dockerfile.dev
@@ -0,0 +1,85 @@
+# Dockerfile for VILLASnode development.
+#
+# This Dockerfile builds an image which contains all library dependencies
+# and tools to build VILLASnode.
+# However, VILLASnode itself it not part of the image.
+#
+# This image can be used for developing VILLASnode
+# by running:
+# make docker
+#
+# @author Steffen Vogel
+# @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
+###################################################################################
+
+FROM fedora:latest
+MAINTAINER Steffen Vogel
+
+# Toolchain
+RUN dnf -y update && \
+ dnf -y install \
+ gcc pkgconfig make cmake \
+ git \
+ gcc-c++ \
+ autoconf automake autogen libtool \
+ flex bison \
+ texinfo
+
+# Dependencies
+RUN dnf -y update && \
+ dnf -y install \
+ openssl \
+ openssl-devel \
+ libconfig-devel \
+ libnl3-devel \
+ libcurl-devel \
+ jansson-devel
+
+# Several tools only needed for developement and testing
+RUN dnf -y update && \
+ dnf -y install \
+ doxygen \
+ dia \
+ graphviz \
+ openssh-clients \
+ rpmdevtools \
+ rpm-build \
+ jq \
+ iproute \
+ python-pip \
+ valgrind \
+ gdb
+
+# Tools for debugging, coverage, profiling
+RUN pip install \
+ gcovr
+
+ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
+ENV LD_LIBRARY_PATH /usr/local/lib
+
+# Build & Install libxil
+COPY thirdparty/libxil /tmp/libxil
+RUN mkdir -p /tmp/libxil/build && cd /tmp/libxil/build && cmake .. && make install
+
+# Build & Install Criterion
+COPY thirdparty/criterion /tmp/criterion
+RUN mkdir -p /tmp/criterion/build && cd /tmp/criterion/build && cmake .. && make install
+
+# Build & Install libwebsockets
+COPY thirdparty/libwebsockets /tmp/libwebsockets
+RUN mkdir -p /tmp/libwebsockets/build && cd /tmp/libwebsockets/build && cmake .. && make install
+
+# Cleanup intermediate files from builds
+RUN rm -rf /tmp/*
+
+# Expose ports for HTTP and WebSocket frontend
+EXPOSE 80
+EXPOSE 443
+
+ADD https://villas.0l.de/packages/villas.repo /etc/yum.repos.d/
+
+ENTRYPOINT villas
+
+WORKDIR /villas
+
+ENTRYPOINT bash
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 2461a5735..f97f20880 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@
###################################################################################
# Project modules
-MODULES = lib plugins src tests thirdparty tools
+MODULES = lib plugins src tests thirdparty tools packaging doc etc web
# Default prefix for install target
PREFIX ?= /usr/local
@@ -26,14 +26,12 @@ BUILDDIR ?= build
# Default debug level for executables
V ?= 2
-# Version of VILLASnode
-VERSION = 0.7
-
# Common flags
LDLIBS =
-CFLAGS += -std=c11 -Iinclude -Iinclude/villas -I. -MMD -mcx16
+CFLAGS += -I. -Iinclude -Iinclude/villas
+CFLAGS += @$(BUILDDIR)/defines
+CFLAGS += -std=c11 -MMD -mcx16
CFLAGS += -Wall -Werror -fdiagnostics-color=auto
-CFLAGS += -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE=1 -DV=$(V)
LDFLAGS += -L$(BUILDDIR)
# We must compile without optimizations for gcov!
@@ -63,25 +61,24 @@ ifdef COVERAGE
VARIANTS += coverage
endif
-SPACE :=
-SPACE +=
-VARIANT = $(subst $(SPACE),-,$(strip $(VARIANTS)))
+EMPTY :=
+SPACE := $(EMPTY) $(EMPTY)
+VARIANT = $(subst $(SPACE),-,$(strip $(VARIANTS)))
BUILDDIR := $(BUILDDIR)/$(VARIANT)
SRCDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
# Add git revision and build variant defines
+VERSION = $(shell git describe --tags --abbrev=0 --match v*)
+VERSION_NUM = $(shell VERSION=$(VERSION); echo $${VERSION:1})
+
ifdef CI
GIT_REV = ${CI_BUILD_REF:0:7}
VARIANT = ci-$(VARIANT)
else
- ifneq ($(shell type -p git),)
-# GIT_REV = $(shell git describe --tags)
- GIT_REV = $(shell REV=$$(git rev-parse HEAD); echo $${REV:0:7})
- endif
+ GIT_REV = $(shell REV=$$(git rev-parse HEAD); echo $${REV:0:7})
endif
-CFLAGS += -D_VERSION='$(VERSION)' -D_VARIANT='"$(VARIANT)"' -D_GIT_REV='"$(GIT_REV)"'
# pkg-config dependencies
PKGS = libconfig
@@ -89,36 +86,47 @@ PKGS = libconfig
######## Targets ########
# Add flags by pkg-config
-CFLAGS += $(addprefix -DWITH_, $(shell echo ${PKGS} | tr a-z- A-Z_ | tr -dc ' A-Z0-9_' ))
CFLAGS += $(shell pkg-config --cflags ${PKGS})
LDLIBS += $(shell pkg-config --libs ${PKGS})
-all: src plugins | lib
+all: src plugins tools
-# Build everything with different profiles: debug, coverage, ...
+# Build all variants: debug, coverage, ...
everything:
$(MAKE) RELEASE=1
$(MAKE) DEBUG=1
$(MAKE) COVERAGE=1
$(MAKE) PROFILE=1
-docker:
- docker build -t villas .
- docker run -it -p 80:80 -p 443:443 -p 1234:1234 --privileged --cap-add sys_nic --ulimit memlock=1073741824 --security-opt seccomp:unconfined -v $(PWD):/villas villas
-
-doc: | $(BUILDDIR)/doc/
- ( cat Doxyfile ; echo "OUTPUT_DIRECTORY=$(BUILDDIR)/doc/" ) | doxygen -
-
# Create non-existent directories
+.SECONDEXPANSION:
+.PRECIOUS: %/
%/:
mkdir -p $@
-.PHONY: all everything clean install docker doc
-.PRECIOUS: %/
-.SECONDEXPANSION:
+define DEFINES
+-DV=$(V)
-install: $(addprefix install-,$(filter-out thirdparty,$(MODULES)))
-clean: $(addprefix clean-,$(filter-out thirdparty,$(MODULES)))
+-DPLUGIN_PATH=\"$(PREFIX)/share/villas/node/plugins\"
+-DWEB_PATH=\"$(PREFIX)/share/villas/node/web\"
+-DSYSFS_PATH=\"/sys\"
+-DPROCFS_PATH=\"/proc\"
+-DBUILDID=\"$(VERSION)-$(GIT_REV)-$(VARIANT)\"
+
+-D_POSIX_C_SOURCE=200809L
+-D_GNU_SOURCE=1
+endef
+export DEFINES
+
+$(BUILDDIR)/defines: | $$(dir $$@)
+ echo "$${DEFINES}" > $@
+ echo -e "$(addprefix \n-DWITH_, $(shell echo ${PKGS} | tr a-z- A-Z_ | tr -dc ' A-Z0-9_' ))" >> $@
+ echo -e "$(addprefix \n-DWITH_, $(shell echo ${LIB_PKGS} | tr a-z- A-Z_ | tr -dc ' A-Z0-9_' ))" >> $@
+
+install: $(addprefix install-,$(filter-out thirdparty doc,$(MODULES)))
+clean: $(addprefix clean-,$(filter-out thirdparty doc,$(MODULES)))
+
+.PHONY: all everything clean install
-include $(wildcard $(BUILDDIR)/**/*.d)
--include $(addsuffix /Makefile.inc,$(MODULES))
+-include $(addsuffix /Makefile.inc,$(MODULES))
\ No newline at end of file
diff --git a/config.h b/config.h
index 88369094d..6a5d9bd1c 100644
--- a/config.h
+++ b/config.h
@@ -10,9 +10,6 @@
#pragma once
-/** The version number of VILLASnode */
-#define VERSION_STR "v" XSTR(_VERSION) "-" _GIT_REV "-" _VARIANT
-
/** Default number of values in a sample */
#define DEFAULT_VALUES 64
#define DEFAULT_QUEUELEN 1024
@@ -31,26 +28,12 @@
#define IPPROTO_VILLAS 137
#define ETH_P_VILLAS 0xBABE
-#define SYSFS_PATH "/sys"
-#define PROCFS_PATH "/proc"
+#define USER_AGENT "VILLASnode (" BUILDID ")"
-#define USER_AGENT "VILLASnode " VERSION_STR
-
-/* Required kernel version */
+/*ID Required kernel version */
#define KERNEL_VERSION_MAJ 3
#define KERNEL_VERSION_MIN 6
-/* Some hard-coded configuration for the FPGA benchmarks */
-#define BENCH_DM 3
-// 1 FIFO
-// 2 DMA SG
-// 3 DMA Simple
-
-#define BENCH_RUNS 3000000
-#define BENCH_WARMUP 100
-#define BENCH_DM_EXP_MIN 0
-#define BENCH_DM_EXP_MAX 20
-
/** PCIe BAR number of VILLASfpga registers */
#define FPGA_PCI_BAR 0
#define FPGA_PCI_VID_XILINX 0x10ee
diff --git a/doc/Makefile.inc b/doc/Makefile.inc
new file mode 100644
index 000000000..b57d906e6
--- /dev/null
+++ b/doc/Makefile.inc
@@ -0,0 +1,11 @@
+doc: | $(BUILDDIR)/doc/
+ ( cat Doxyfile ; echo "OUTPUT_DIRECTORY=$(BUILDDIR)/doc/" ) | doxygen -
+
+install-doc: doc
+ mkdir -p $(DESTDIR)$(PREFIX)/share/villas/node/doc/
+ cp -R $(BUILDDIR)/doc/html/* $(DESTDIR)$(PREFIX)/share/villas/node/doc/
+
+clean-doc:
+ rm -rf $(BUILDDIR)/doc/
+
+.PHONY: doc install-doc clean-doc
\ No newline at end of file
diff --git a/etc/Makefile.inc b/etc/Makefile.inc
new file mode 100644
index 000000000..cf2fe8073
--- /dev/null
+++ b/etc/Makefile.inc
@@ -0,0 +1,8 @@
+etc:
+
+install-etc:
+ install -D -t $(DESTDIR)/etc/villas/node etc/*.conf
+
+clean-etc:
+
+.PHONY: etc install-etc clean-etc
\ No newline at end of file
diff --git a/lib/Makefile.inc b/lib/Makefile.inc
index bcce31a13..6b2408e4e 100644
--- a/lib/Makefile.inc
+++ b/lib/Makefile.inc
@@ -1,5 +1,7 @@
-# Libraries
-LIBS = $(BUILDDIR)/libvillas.so
+LIB_NAME = libvillas
+LIB_ABI_VERSION = 1
+
+LIB = $(BUILDDIR)/$(LIB_NAME).so
# Object files for libvillas
LIB_SRCS = $(addprefix lib/nodes/, file.c cbuilder.c) \
@@ -12,7 +14,7 @@ LIB_SRCS = $(addprefix lib/nodes/, file.c cbuilder.c) \
LIB_CFLAGS = $(CFLAGS) -fPIC
LIB_LDFLAGS = -shared
-LIB_LDLIBS = $(LDLIBS) -ldl -lrt
+LIB_LDLIBS = $(LDLIBS) -ldl -lrt -Wl,-soname,$(LIB_NAME).so.$(LIB_ABI_VERSION)
-include lib/hooks/Makefile.inc
-include lib/apis/Makefile.inc
@@ -74,30 +76,28 @@ endif
endif
# Add flags by pkg-config
-LIB_CFLAGS += $(addprefix -DWITH_, $(shell echo ${LIB_PKGS} | tr a-z- A-Z_ | tr -dc ' A-Z0-9_' ))
LIB_CFLAGS += $(shell pkg-config --cflags ${LIB_PKGS})
LIB_LDLIBS += $(shell pkg-config --libs ${LIB_PKGS})
LIB_OBJS = $(patsubst %.c, $(BUILDDIR)/%.o, $(LIB_SRCS))
-lib: $(LIBS)
-
-# Compile
-$(BUILDDIR)/lib/%.o: lib/%.c | $$(dir $$@)
- $(CC) $(LIB_CFLAGS) -c $< -o $@
+lib: $(LIB)
# Link
-$(LIBS): $(LIB_OBJS)
+$(LIB): $(LIB_OBJS)
$(CC) $(LIB_LDFLAGS) -o $@ $^ $(LIB_LDLIBS)
-
+
+# Compile
+$(BUILDDIR)/lib/%.o: lib/%.c $(BUILDDIR)/defines | $$(dir $$@)
+ $(CC) $(LIB_CFLAGS) -c $< -o $@
+
# Install
install-lib: lib
- install -m 0644 $(LIBS) $(PREFIX)/lib
- install -m 0755 -d $(PREFIX)/include/villas/
- install -m 0644 include/villas/*.h $(PREFIX)/include/villas/
- ldconfig
+ install -m 0755 -D -T $(LIB) $(DESTDIR)$(PREFIX)/lib/$(LIB_NAME).so.$(LIB_ABI_VERSION)
+ install -m 0644 -D -t $(DESTDIR)$(PREFIX)/include/villas/ include/villas/*.h
+ ln -srf $(DESTDIR)$(PREFIX)/lib/$(LIB_NAME).so.$(LIB_ABI_VERSION) $(DESTDIR)$(PREFIX)/lib/$(LIB_NAME).so
clean-lib:
- rm -rf $(BUILDDIR)/lib $(LIBS)
+ rm -rf $(BUILDDIR)/lib $(LIB)
-.PHONY: lib lib-tests lib-tests
+.PHONY: lib install-lib clean-lib $(BUILDDIR)/lib/defines
diff --git a/lib/super_node.c b/lib/super_node.c
index 5e7b5b582..ee9546a4d 100644
--- a/lib/super_node.c
+++ b/lib/super_node.c
@@ -63,9 +63,6 @@ int super_node_init(struct super_node *sn)
sn->stats = 0;
sn->hugepages = DEFAULT_NR_HUGEPAGES;
- sn->web.port = 80;
- sn->web.htdocs = "/villas/web/socket/";
-
sn->state = STATE_INITIALIZED;
return 0;
diff --git a/lib/utils.c b/lib/utils.c
index 83111f891..6b15abbb8 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -21,8 +21,8 @@
void print_copyright()
{
printf("VILLASnode %s (built on %s %s)\n",
- BLU(VERSION_STR), MAG(__DATE__), MAG(__TIME__));
- printf(" copyright 2014-2016, Institute for Automation of Complex Power Systems, EONERC\n");
+ BLU(BUILDID), MAG(__DATE__), MAG(__TIME__));
+ printf(" Copyright 2014-2017, Institute for Automation of Complex Power Systems, EONERC\n");
printf(" Steffen Vogel \n");
}
diff --git a/packaging/Makefile.inc b/packaging/Makefile.inc
new file mode 100644
index 000000000..0d823382d
--- /dev/null
+++ b/packaging/Makefile.inc
@@ -0,0 +1,42 @@
+TAROPTS = --exclude-ignore-recursive=.distignore --transform='s|^\.|villas-node-$(VERSION_NUM)|' --show-transformed-names
+
+TAR_VILLAS = $(BUILDDIR)/packaging/villas-node-$(VERSION_NUM).tar.gz
+
+DEPLOY_HOST = root@villas.0l.de
+DEPLOY_PATH = /var/www/villas
+
+packaging: rpm dist
+
+deploy: deploy-dist deploy-rpm
+
+# Source tarballs
+dist: $(TAR_VILLAS)
+
+$(TAR_VILLAS): | $$(dir $$@)
+ tar $(TAROPTS) -C $(SRCDIR) -czf $@ .
+
+deploy-dist: $(TAR_VILLAS)
+ rsync $(TAR_VILLAS) $(DEPLOY_HOST):$(DEPLOY_PATH)/node/src
+
+deploy-rpm:
+ rsync -a --progress $(RPMDIR)/RPMS/ $(DEPLOY_HOST):$(DEPLOY_PATH)/packages/
+ ssh $(DEPLOY_HOST) createrepo $(DEPLOY_PATH)/packages
+
+# Docker targets
+run-docker-dev:
+ docker run -it -p 80:80 -p 443:443 -p 1234:1234 --privileged --cap-add sys_nic --ulimit memlock=1073741824 --security-opt seccomp:unconfined -v $(PWD):/villas villas-dev
+
+docker-dev:
+ docker build -f Dockerfile.dev -t villas-dev $(SRCDIR)
+
+docker:
+ docker build -f Dockerfile -t villas $(SRCDIR)
+
+clean-packaging:
+ rm -f $(BUILDDIR)/packaging/villas-node-$(VERSION_NUM).tar.gz
+
+install-packaging:
+
+.PHONY: packaging install-packaging clean-packaging deploy deploy-dist deploy-rpm dist docker docker-dev run-docker-dev $(TAR_VILLAS)
+
+-include packaging/rpm/Makefile.inc
\ No newline at end of file
diff --git a/packaging/rpm/Makefile.inc b/packaging/rpm/Makefile.inc
new file mode 100644
index 000000000..556ec72c2
--- /dev/null
+++ b/packaging/rpm/Makefile.inc
@@ -0,0 +1,37 @@
+RPMDIR = $(BUILDDIR)/packaging/rpm
+
+SPEC_VILLAS = $(BUILDDIR)/packaging/rpm/villas-node.spec
+
+# Increment this number for minor release bumps
+MINOR = 2
+
+rpm: rpm-villas rpm-libwebsockets rpm-libxil
+
+rpm-villas: $(TAR_VILLAS) $(SPEC_VILLAS) | $(RPMDIR)/SOURCES/
+ cp $(BUILDDIR)/packaging/villas-node-$(VERSION_NUM).tar.gz $(RPMDIR)/SOURCES
+ rpmbuild -ba --define="_topdir $$(pwd)/$(RPMDIR)" $(BUILDDIR)/packaging/rpm/villas-node.spec
+
+rpm-libxil: $(BUILDDIR)/thirdparty/libxil/
+ cmake -DCMAKE_INSTALL_PREFIX:PATH=$(PREFIX) \
+ -H$(SRCDIR)/thirdparty/libxil \
+ -B$(BUILDDIR)/thirdparty/libxil $(CMAKE_OPTS)
+ make -C$(BUILDDIR)/thirdparty/libxil package_source
+ cp $(BUILDDIR)/thirdparty/libxil/libxil-*.tar.gz $(RPMDIR)/SOURCES
+ rpmbuild -ba --define="_topdir $$(pwd)/$(RPMDIR)" $(SRCDIR)/thirdparty/libxil/libxil.spec
+
+rpm-libwebsockets: | $(RPMDIR)/RPMS $(BUILDDIR)/thirdparty/libwebsockets/
+ cmake -DCMAKE_INSTALL_PREFIX:PATH=$(PREFIX) \
+ -H$(SRCDIR)/thirdparty/libwebsockets \
+ -B$(BUILDDIR)/thirdparty/libwebsockets $(CMAKE_OPTS)
+ make -C$(BUILDDIR)/thirdparty/libwebsockets libwebsockets_rpm
+ mv $(BUILDDIR)/thirdparty/libwebsockets/RPM/RPMS/x86_64/libwebsockets-*.rpm $(RPMDIR)/RPMS/x86_64/
+
+# We patch version number and release fields of the spec file based on the current Git commit
+$(SPEC_VILLAS): $(SRCDIR)/packaging/rpm/villas-node.spec | $$(dir $$@)
+ sed -e "s/§VERSION§/$(VERSION_NUM)/g" \
+ -e "s/§RELEASE§/$(MINOR).$(VARIANT).$$(date +%Y%m%d)git$$(echo $(GIT_REV) | cut -b1-7)/g" < $^ > $@
+
+clean-rpm:
+ rm -rf $(RPMDIR)
+
+.PHONY: rpm clean-rpm rpm-libwebsockets rpm-libxil
\ No newline at end of file
diff --git a/packaging/rpm/villas-node.spec b/packaging/rpm/villas-node.spec
new file mode 100644
index 000000000..ecfe5341f
--- /dev/null
+++ b/packaging/rpm/villas-node.spec
@@ -0,0 +1,79 @@
+Name: villas-node
+Version: §VERSION§
+Vendor: Institute for Automation of Complex Power Systems
+Packager: Steffen Vogel
+Release: §RELEASE§%{?dist}
+Summary: This is VILLASnode, a gateway for processing and forwardning simulation data between real-time simulators.
+
+License: LGPLv2
+URL: https://git.rwth-aachen.de/VILLASframework/VILLASnode
+Source0: villas-node-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires: gcc pkgconfig make
+
+Requires: iproute kernel-modules-extra
+
+BuildRequires: openssl-devel libconfig-devel libnl3-devel libcurl-devel jansson-devel libxil-devel libwebsockets-devel
+Requires: openssl libconfig libnl3 libcurl jansson libxil libwebsockets
+
+%description
+
+%package doc
+
+Summary: HTML documentation for users and developers.
+Group: Documentation
+
+%package devel
+
+Summary: Headers and libraries for building apps that use libvillas.
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+
+The development headers for libvillas.
+
+%description doc
+
+%prep
+%setup -q
+
+%build
+make PREFIX=/usr
+
+%install
+rm -rf %{?buildroot}
+make PREFIX=/usr DESTDIR=%{?buildroot} install
+make PREFIX=/usr DESTDIR=%{?buildroot} install-doc
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%clean
+rm -rf %{?buildroot}
+
+%files
+/usr/bin/villas
+/usr/bin/villas-*
+/usr/bin/conf2json
+
+/usr/lib/libvillas.so
+/usr/lib/libvillas.so.*
+
+/usr/share/villas/node/web/
+/usr/share/villas/node/plugins/
+
+%config /etc/villas/node/*.conf
+%license COPYING.md
+
+%files doc
+%docdir /usr/share/villas/node/doc/
+/usr/share/villas/node/doc/
+
+%files devel
+/usr/include/villas/
+
+%changelog
+* Fri Mar 17 2017 Steffen Vogel &2
+ echo "Usage: villas [TOOL]" 1>&2
+ echo " TOOL is one of ${TOOLS}"
+ echo
+ echo "For detailed documentation, please run 'villas node'"
+ echo " and point your web browser to http://localhost:80"
+ echo
+ # Show VILLASnode copyright and contact info
+ villas-node --help | tail -n3
exit 1
fi
diff --git a/web/Makefile.inc b/web/Makefile.inc
new file mode 100644
index 000000000..ae5127641
--- /dev/null
+++ b/web/Makefile.inc
@@ -0,0 +1,6 @@
+install-web:
+ cp -R web $(DESTDIR)$(PREFIX)/share/villas/node
+
+clean-web:
+
+.PHONY: web install-web clean-web
\ No newline at end of file
diff --git a/web/acs_eonerc_logo.svg b/web/acs_eonerc_logo.svg
new file mode 100644
index 000000000..cd1a34370
--- /dev/null
+++ b/web/acs_eonerc_logo.svg
@@ -0,0 +1,267 @@
+
+
+
+
\ No newline at end of file
diff --git a/web/doc b/web/doc
new file mode 120000
index 000000000..f4307558c
--- /dev/null
+++ b/web/doc
@@ -0,0 +1 @@
+../doc/
\ No newline at end of file
diff --git a/web/index.html b/web/index.html
index 98e3e6f68..9dbeeb2bc 100644
--- a/web/index.html
+++ b/web/index.html
@@ -2,21 +2,57 @@
- VILLASnode
+ VILLASnode: Connecting real-time power grid simulation equipment
+
-
+ VILLASnode: Connecting real-time power grid simulation equipment
+
+
+
- VILLASnode
-
- Source Code
-
-
-
-
-
-
+
+ Contact
+
+
+
+
+
+
diff --git a/web/socket/acs_eonerc_logo.svg b/web/socket/acs_eonerc_logo.svg
new file mode 120000
index 000000000..e0cc4708a
--- /dev/null
+++ b/web/socket/acs_eonerc_logo.svg
@@ -0,0 +1 @@
+../acs_eonerc_logo.svg
\ No newline at end of file
diff --git a/web/socket/doc b/web/socket/doc
deleted file mode 120000
index 81ac46d2b..000000000
--- a/web/socket/doc
+++ /dev/null
@@ -1 +0,0 @@
-../../doc/html
\ No newline at end of file
diff --git a/web/socket/index.html b/web/socket/index.html
index 0fd7aae49..2a44c27fc 100644
--- a/web/socket/index.html
+++ b/web/socket/index.html
@@ -17,7 +17,7 @@
diff --git a/web/socket/logo.svg b/web/socket/logo.svg
deleted file mode 120000
index c47aaa22e..000000000
--- a/web/socket/logo.svg
+++ /dev/null
@@ -1 +0,0 @@
-../../doc/pictures/acs_eonerc_logo.svg
\ No newline at end of file