diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2019-07-29 18:06:53 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2019-08-05 11:46:21 -0400 |
commit | d5f06cc47dcdfa4b61219ffbf280157a312e0efa (patch) | |
tree | e37e01bca8bf43ecf92357d959b8bf5377efb8ec /branding/templates/debian/generate.py | |
parent | e709b4209e710eb1bb5e7facff73f72adae66d65 (diff) |
[pkg] debian template
Diffstat (limited to 'branding/templates/debian/generate.py')
-rwxr-xr-x | branding/templates/debian/generate.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/branding/templates/debian/generate.py b/branding/templates/debian/generate.py new file mode 100755 index 0000000..141d8f9 --- /dev/null +++ b/branding/templates/debian/generate.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3
+"""
+generate.py
+
+Generate a snap package for a given provider.
+"""
+
+import json
+import os
+from string import Template
+
+
+TEMPLATES = ('app.desktop', 'changelog', 'control', 'rules')
+
+
+here = os.path.split(os.path.realpath(__file__))[0]
+data = json.load(open(os.path.join(here, 'data.json')))
+
+
+def write_from_template(target):
+ template = Template(open(target + '-template').read())
+
+ with open(target, 'w') as output:
+ output.write(template.safe_substitute(data))
+
+
+for target in TEMPLATES:
+ write_from_template(target)
+
+
+print("[+] Debian files written to {path}".format(
+ path=os.path.abspath(here)))
|