forked from hyperspy/hyperspy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease_debian
executable file
·27 lines (21 loc) · 895 Bytes
/
release_debian
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! /usr/bin/python3
# To produce a binary-only deb file
# Requires python-stdeb, debhelper, dpkg-dev and python-argparser
import argparse
from glob import glob
parser = argparse.ArgumentParser(description='Creates a debian package')
parser.add_argument('-i', '--install', action='store_true',
help='Installs the program after packing it')
args = parser.parse_args()
import os
from subprocess import call
import hyperspy.Release as Release
release_name = 'hyperspy-' + Release.version.replace('.dev', '~dev')
# Delete the deb_dist folder to avoid an error if it contains
# directories from a previous packaging
os.system("rm -rf deb_dist")
os.system('python3 setup.py --command-packages=stdeb.command bdist_deb')
if args.install is True:
os.system('sudo gdebi %s' % glob('deb_dist/*.deb')[0])
# Install the dependencies
# os.system('sudo apt-get install -f')