|
|
|
@ -19,6 +19,7 @@
|
|
|
|
|
import setuptools |
|
|
|
|
import os |
|
|
|
|
import sys |
|
|
|
|
from shutil import copyfile |
|
|
|
|
|
|
|
|
|
print(sys.argv) |
|
|
|
|
|
|
|
|
@ -41,7 +42,10 @@ if "PREFIX" not in os.environ and sys.platform == 'linux':
|
|
|
|
|
rmdir("/usr/share/applications/test") |
|
|
|
|
os.environ["PREFIX"] = "/usr/share" |
|
|
|
|
except: |
|
|
|
|
os.environ["PREFIX"] = os.environ["HOME"] + "/.local/share" |
|
|
|
|
if ".pybuild" in os.environ["HOME"]: # Launchpad building. |
|
|
|
|
os.environ["PREFIX"] = "/usr/share" |
|
|
|
|
else: |
|
|
|
|
os.environ["PREFIX"] = os.environ["HOME"] + "/.local/share" |
|
|
|
|
|
|
|
|
|
from LogarithmPlotter import __VERSION__ as pkg_version |
|
|
|
|
|
|
|
|
@ -81,6 +85,7 @@ def package_data():
|
|
|
|
|
for d,folders,files in os.walk("LogarithmPlotter/i18n"): |
|
|
|
|
d = d[17:] |
|
|
|
|
pkg_data += [os.path.join(d, f) for f in files] |
|
|
|
|
|
|
|
|
|
return pkg_data |
|
|
|
|
|
|
|
|
|
data_files = [] |
|
|
|
@ -95,7 +100,6 @@ if sys.platform == 'linux':
|
|
|
|
|
data_files.append((os.environ["PREFIX"] + '/icons/hicolor/scalable/apps/', ['logplotter.svg'])) |
|
|
|
|
if len(sys.argv) > 1: |
|
|
|
|
if sys.argv[1] == "install": |
|
|
|
|
from shutil import copyfile |
|
|
|
|
os.makedirs(os.environ["PREFIX"] + '/applications/', exist_ok=True) |
|
|
|
|
os.makedirs(os.environ["PREFIX"] + '/mime/packages/', exist_ok=True) |
|
|
|
|
os.makedirs(os.environ["PREFIX"] + '/icons/hicolor/scalable/mimetypes/', exist_ok=True) |
|
|
|
@ -113,8 +117,7 @@ if sys.platform == 'linux':
|
|
|
|
|
else: |
|
|
|
|
copyfile(current_dir + '/linux/eu.ad5001.LogarithmPlotter.metainfo.xml', |
|
|
|
|
os.environ["PREFIX"] + '/metainfo/eu.ad5001.LogarithmPlotter.metainfo.xml') |
|
|
|
|
copyfile(current_dir + '/linux/logarithmplotter.desktop', |
|
|
|
|
os.environ["PREFIX"] + '/applications/logarithmplotter.desktop') |
|
|
|
|
#copyfile(current_dir + '/linux/logarithmplotter.desktop', os.environ["PREFIX"] + '/applications/logarithmplotter.desktop') |
|
|
|
|
elif sys.argv[1] == "uninstall": |
|
|
|
|
os.remove(os.environ["PREFIX"] + '/applications/logarithmplotter.desktop') |
|
|
|
|
os.remove(os.environ["PREFIX"] + '/mime/packages/x-logarithm-plot.xml') |
|
|
|
|