diff --git a/.gitignore b/.gitignore
index 51f37025df78bdd65bc60f8213a00e9232abfcea..557180d62395353b44b7a2153dad381f4857ada4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,9 @@
 # General
 build/
-include/libcaosdbConfig.h
+*.tar.gz
+
+# Caches
+.*cache
 
 # CMake
 CMakeLists.txt.user
diff --git a/Makefile b/Makefile
index 1d5197bc37d983038cc308f2a7d9380c84ed34a4..2d5cb2afc66714614e38bfd9f7538bea3dab1f60 100644
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,12 @@ doc:
 .PHONY: style
 style:
 	mh_style --octave src
+	mh_style --octave pkg
 
 .PHONY: test
 test:
 	cd src && octave Run_Test.m
+
+.PHONY: pkg
+pkg:
+	tar -czf caosdb.tar.gz --exclude-from=.gitignore pkg
diff --git a/pkg/.miss_hit b/pkg/.miss_hit
new file mode 100644
index 0000000000000000000000000000000000000000..f15ccfe29ff4a2e193fb4ae51ca5a7bd1cc3a88d
--- /dev/null
+++ b/pkg/.miss_hit
@@ -0,0 +1,7 @@
+# -*- mode:conf; -*-
+# See https://florianschanda.github.io/miss_hit/style_checker.html
+
+line_length: 100
+regex_function_name: "[a-z]+(_[a-z]+)*"
+suppress_rule: "whitespace_comments"
+tab_width: 2
diff --git a/pkg/CITATION b/pkg/CITATION
new file mode 100644
index 0000000000000000000000000000000000000000..cc9f500a073385b4e5fb5c8bc9494635eab2913e
--- /dev/null
+++ b/pkg/CITATION
@@ -0,0 +1 @@
+caosdb-octavelib, an Octave library for CaosDB. IndiScale GmbH (2021)
diff --git a/src/Example.m b/pkg/COPYING
similarity index 65%
rename from src/Example.m
rename to pkg/COPYING
index 6b6abe11364cf8df1e00aed202dd1612b7324a7f..fdc78ab5320388b58602b151deadc1b981eeb5a4 100644
--- a/src/Example.m
+++ b/pkg/COPYING
@@ -1,8 +1,8 @@
-% (C) Copyright 2021 IndiScale GmbH <info@indiscale.com>
-% (C) Copyright 2021 Daniel Hornung <d.hornung@indiscale.com>
-%
 % This file is a part of the CaosDB Project.
 %
+% Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
+% Copyright (C) 2021 Daniel Hornung <d.hornung@indiscale.com>
+%
 % This program is free software: you can redistribute it and/or modify
 % it under the terms of the GNU Affero General Public License as
 % published by the Free Software Foundation, either version 3 of the
@@ -15,12 +15,3 @@
 %
 % You should have received a copy of the GNU Affero General Public License
 % along with this program. If not, see <https://www.gnu.org/licenses/>.
-
-%% Example file with dummy code from https://www.gnu.org/software/octave/
-
-x = -10:0.1:10;  % Create an evenly-spaced vector from -10..10
-y = sin(x);      % y is also a vector
-plot (x, y);
-title ("Simple 2-D Plot");
-xlabel ("x");
-ylabel ("sin (x)");
diff --git a/pkg/ChangeLog b/pkg/ChangeLog
new file mode 120000
index 0000000000000000000000000000000000000000..699cc9e7b7c5bf63c3549abe36e3eecf8efab625
--- /dev/null
+++ b/pkg/ChangeLog
@@ -0,0 +1 @@
+../../CHANGELOG.md
\ No newline at end of file
diff --git a/pkg/DESCRIPTION b/pkg/DESCRIPTION
new file mode 100644
index 0000000000000000000000000000000000000000..d34b56bb8f35b36c3632c5be96dfc5b1f76d1b55
--- /dev/null
+++ b/pkg/DESCRIPTION
@@ -0,0 +1,12 @@
+# See https://octave.org/doc/interpreter/The-DESCRIPTION-File.html
+Name: caosdb
+Version: 0.1.0
+Date: 2021-07-09
+Author: Daniel Hornung <d.hornung@indiscale.com>
+Maintainer: Daniel Hornung <d.hornung@indiscale.com>
+Title: Octave and Matlab library for CaosDB
+Description: This package contains utility functions to interact with CaosDB.
+License: AGPLv3
+Categories: data management
+Url: https://gitlab.com/caosdb/caosdb-octavelib
+BuildRequires: libcaosdb
diff --git a/pkg/LICENSE.md b/pkg/LICENSE.md
new file mode 120000
index 0000000000000000000000000000000000000000..f0608a63ae16053f55e32ab4abf40e7a61f2dccb
--- /dev/null
+++ b/pkg/LICENSE.md
@@ -0,0 +1 @@
+../../LICENSE.md
\ No newline at end of file
diff --git a/src/doc/Gen_HTML.m b/pkg/doc/Gen_HTML.m
similarity index 92%
rename from src/doc/Gen_HTML.m
rename to pkg/doc/Gen_HTML.m
index 062322ddccd86444869717c95c0b54502275cfe4..ac9fe83420392443c0b2dc91031e24e5d18f9e1c 100644
--- a/src/doc/Gen_HTML.m
+++ b/pkg/doc/Gen_HTML.m
@@ -19,5 +19,5 @@
 % ------------------------------------------------------------------------
 % Build the HTML documentation.
 
-pkg load generate_doc
-generate_package_html("caosdb", "_build_octave/")
+pkg load generate_doc;
+generate_package_html("caosdb", "_build_octave/");
diff --git a/src/doc/Makefile b/pkg/doc/Makefile
similarity index 100%
rename from src/doc/Makefile
rename to pkg/doc/Makefile
diff --git a/src/doc/conf.py b/pkg/doc/conf.py
similarity index 100%
rename from src/doc/conf.py
rename to pkg/doc/conf.py
diff --git a/src/doc/index.rst b/pkg/doc/index.rst
similarity index 100%
rename from src/doc/index.rst
rename to pkg/doc/index.rst
diff --git a/src/dummy/some_function.m b/pkg/inst/some_function.m
similarity index 100%
rename from src/dummy/some_function.m
rename to pkg/inst/some_function.m
diff --git a/pkg/src/configure b/pkg/src/configure
new file mode 100755
index 0000000000000000000000000000000000000000..0a272ab170de3241d32886ad662423cb54affc80
--- /dev/null
+++ b/pkg/src/configure
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+echo "Nothing is implemented yet."
+
+# See https://octave.org/doc/interpreter/Creating-Packages.html
diff --git a/src/Run_Test.m b/src/Run_Test.m
index 6854f196f81a9167ae7d286a8f500ff40e2eb00c..b70b918652718418faf7ffe5044b45994d6bd22f 100644
--- a/src/Run_Test.m
+++ b/src/Run_Test.m
@@ -19,12 +19,12 @@
 % ------------------------------------------------------------------------
 % Run the tests, exit with their value.
 
-addpath("dummy");
+addpath('../pkg/inst/');
 
 [n, nmax, nxfail, nbug, nskip, nrtskip, nregression] = ...
-  test("some_function.m", "verbose");
+  test('some_function.m', 'verbose');
 
-disp(["Passed " num2str(n) " out of " num2str(nmax) " tests."]);
+disp(['Passed ' num2str(n) ' out of ' num2str(nmax) ' tests.']);
 if n == nmax
   exit(0);
 end