summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-07-05 15:22:40 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-07-05 15:22:40 +0200
commite39b9a8a405fa8e5f73c32bb03a3f349f7f9f92d (patch)
tree970ba428c8a6a9a3d0179817f456ba09f1d06fb0
parent1fa692d9c31c1958d2f572242eac0f030e770062 (diff)
Docs: Add RPM documentation to a Package Formats section
-rw-r--r--Makefile2
-rw-r--r--docs/src/SUMMARY.md1
-rw-r--r--docs/src/gettingstarted/building/packageformats.md41
3 files changed, 43 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 6b485b5..cc6afcc 100644
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,7 @@ srpm:
# Cleanup
rm -rf dist/*
-# build SRPM and RPM and copy to dist
+# build SRPM and copy to dist
rpmbuild -bs eduvpncommon.spec
cp ~/rpmbuild/SRPMS/* dist/
echo "Done building SRPM, go to ./dist/ to view it"
diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md
index bbe4917..dc3bbc9 100644
--- a/docs/src/SUMMARY.md
+++ b/docs/src/SUMMARY.md
@@ -6,6 +6,7 @@
- [Go library](./gettingstarted/building/go.md)
- [Python wrapper](./gettingstarted/building/python.md)
- [Example from scratch](./gettingstarted/building/example.md)
+ - [Package Formats](./gettingstarted/building/packageformats.md)
- [Testing](./gettingstarted/testing.md)
- [Debugging](./gettingstarted/debugging/README.md)
- [Logging](./gettingstarted/debugging/logging.md)
diff --git a/docs/src/gettingstarted/building/packageformats.md b/docs/src/gettingstarted/building/packageformats.md
new file mode 100644
index 0000000..70516d9
--- /dev/null
+++ b/docs/src/gettingstarted/building/packageformats.md
@@ -0,0 +1,41 @@
+# Package formats
+
+We support the following additional package formats: RPM (Linux, Fedora) and Deb (Linux, Debian derivatives)
+
+# Linux: RPM
+To build a RPM, issue the following commands:
+
+```bash
+# Make sure we have make
+sudo dnf install -y make
+
+# Install dependencies to build RPMs
+sudo make rpm-depends
+
+# Create RPM
+make rpm
+```
+
+This outputs RPMs (the Go library and each wrapper) and a SRPM to the `dist/` folder.
+
+To install these rpms, use ```rpm -i``` where you first install the `libeduvpncommon` RPM and then the associated wrapper. We provide a COPR to make this whole process easy:
+
+```bash
+sudo dnf copr enable jwijenbergh/eduvpn-common
+
+# E.g. install the python wrapper
+# This automatically installs the Go shared library ('libeduvpncommon') as well
+sudo dnf install python3-eduvpncommon
+```
+
+To cross compile manually (without COPR), use the ```make rpm-mock``` target instead of ```make rpm```. This uses the [mock](https://github.com/rpm-software-management/mock) utility which runs each build in a separate environment. The target distro and architecture can be changed with the ```MOCK_TARGET``` flag. E.g:
+
+```bash
+# Create a rpm for centos stream 8 aarch64
+# You will be prompted for a password if you're not in the 'mock' group
+make rpm-mock MOCK_TARGET=centos-stream-8-aarch64
+```
+
+A list of targets can be found in ```/etc/mock/*.cfg```. The default target is `fedora-36-x86_64`
+
+# Linux: Deb