Codebase list osrframework / 413d35c debian / patches / upgrade-installation.patch
413d35c

Tree @413d35c (Download .tar.gz)

upgrade-installation.patch @413d35craw · history · blame

From: Sophie Brun <[email protected]>
Date: Thu, 23 Jan 2020 10:21:00 +0100
Subject: Improve installation

Last-Update: 2020-01-23

Upstream installs configuration files directly in the home user directory
but we can't / don't do that in packages.
Add a data_files in setup to manage the installation of config files in
/etc/osrframework. These files will be copied in the user directory at the
first launch.
---
 setup.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 8ed4965..716a9f5 100644
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@
 
 import os
 import sys
-
+import glob
 from setuptools import setup, find_packages
 
 try:
@@ -108,6 +108,11 @@ setup(
     long_description=read('README.md'),
     long_description_content_type="text/markdown",
     install_requires=requirements,
+    data_files=[
+        ("/etc/osrframework/default", glob.glob("config/*.cfg")),
+        ("/etc/osrframework/plugins/patterns", ["config/plugins/wrapper.py.sample"]),
+        ("/etc/osrframework/plugins/wrappers", ["config/plugins/wrapper_v2.py.sample"]),
+    ],
 )
 
 ############################