Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
Fixes #1195 and similar issue with db4o module
Browse files Browse the repository at this point in the history
  • Loading branch information
Dancho Penev authored and Thomas Eichstädt-Engelen committed Jul 17, 2014
1 parent d8c002b commit d8ac28d
Show file tree
Hide file tree
Showing 14 changed files with 152 additions and 6 deletions.
55 changes: 55 additions & 0 deletions bundles/persistence/org.openhab.persistence.db4o/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<bundle.namespace>org.openhab.persistence.db4o</bundle.namespace>
<deb.name>openhab-addon-persistence-db4o</deb.name>
<deb.description>${project.name}</deb.description>
<deb.depends>openhab-runtime</deb.depends>
</properties>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -29,6 +30,60 @@
<plugin>
<groupId>org.vafer</groupId>
<artifactId>jdeb</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jdeb</goal>
</goals>
<configuration>
<controlDir combine.self="override">${basedir}/src/deb/control</controlDir>
<dataSet combine.self="override">
<data>
<src>${basedir}/src/deb/etc/openhab/configurations/persistence/db4o.persist</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/etc/openhab/configurations/persistence</prefix>
<user>root</user>
<group>root</group>
<filemode>644</filemode>
</mapper>
</data>
<data>
<src>${basedir}/target/${project.artifactId}-${project.version}.jar</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/usr/share/openhab/addons</prefix>
<user>root</user>
<group>root</group>
<filemode>644</filemode>
</mapper>
</data>
<data>
<type>directory</type>
<src>${basedir}/src/deb/var/lib/openhab/persistence</src>
<excludes>**/.gitignore</excludes>
<mapper>
<type>perm</type>
<prefix>/var/lib/openhab/persistence</prefix>
<user>root</user>
<group>openhab</group>
<dirmode>2775</dirmode>
</mapper>
</data>
<data>
<!-- TODO better solution is to change db4o code to not save data files into configuration directory -->
<type>link</type>
<linkName>/etc/openhab/jetty/etc/db4o</linkName>
<linkTarget>/var/lib/openhab/persistence/db4o</linkTarget>
<symlink>true</symlink>
</data>
</dataSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/openhab/configurations/persistence/db4o.persist
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Package: [[deb.name]]
Version: [[version]]
Section: [[deb.section]]
Priority: optional
Architecture: all
Maintainer: [[deb.maintainer]]
Description: [[deb.description]]
Distribution: [[deb.distribution]]
Depends: [[deb.depends]]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Configuration file for "db4o" persistence module
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
55 changes: 55 additions & 0 deletions bundles/persistence/org.openhab.persistence.rrd4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<bundle.namespace>org.openhab.persistence.rrd4j</bundle.namespace>
<deb.name>openhab-addon-persistence-rrd4j</deb.name>
<deb.description>${project.name}</deb.description>
<deb.depends>openhab-runtime</deb.depends>
</properties>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -29,6 +30,60 @@
<plugin>
<groupId>org.vafer</groupId>
<artifactId>jdeb</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jdeb</goal>
</goals>
<configuration>
<controlDir combine.self="override">${basedir}/src/deb/control</controlDir>
<dataSet combine.self="override">
<data>
<src>${basedir}/src/deb/etc/openhab/configurations/persistence/rrd4j.persist</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/etc/openhab/configurations/persistence</prefix>
<user>root</user>
<group>root</group>
<filemode>644</filemode>
</mapper>
</data>
<data>
<src>${basedir}/target/${project.artifactId}-${project.version}.jar</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/usr/share/openhab/addons</prefix>
<user>root</user>
<group>root</group>
<filemode>644</filemode>
</mapper>
</data>
<data>
<type>directory</type>
<src>${basedir}/src/deb/var/lib/openhab/persistence</src>
<excludes>**/.gitignore</excludes>
<mapper>
<type>perm</type>
<prefix>/var/lib/openhab/persistence</prefix>
<user>root</user>
<group>openhab</group>
<dirmode>2775</dirmode>
</mapper>
</data>
<data>
<!-- TODO better solution is to change rrd4j code to not save data files into configuration directory -->
<type>link</type>
<linkName>/etc/openhab/jetty/etc/rrd4j</linkName>
<linkTarget>/var/lib/openhab/persistence/rrd4j</linkTarget>
<symlink>true</symlink>
</data>
</dataSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/openhab/configurations/persistence/rrd4j.persist
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Package: [[deb.name]]
Version: [[version]]
Section: [[deb.section]]
Priority: optional
Architecture: all
Maintainer: [[deb.maintainer]]
Description: [[deb.description]]
Distribution: [[deb.distribution]]
Depends: [[deb.depends]]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Configuration file for "rrd4j" persistence module
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
6 changes: 0 additions & 6 deletions distribution/src/deb/control-runtime/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@

set -e

DIRS="/var/lib/openhab/webapps/static /var/lib/openhab/workspace \
/var/log/openhab"

case "$1" in
configure)
for DIR in ${DIRS}; do
chmod g+ws "${DIR}"
done
update-rc.d openhab defaults > /dev/null 2>&1
;;
abort-deconfigure|abort-remove|abort-upgrade)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
4 changes: 4 additions & 0 deletions distribution/src/deb/var/lib/openhab/workspace/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
4 changes: 4 additions & 0 deletions distribution/src/deb/var/log/openhab/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

0 comments on commit d8ac28d

Please sign in to comment.