mirror of
https://github.com/SELinuxProject/setools
synced 2025-02-15 19:48:06 +00:00
Enable installing setools in virtualenv
When installed from virtualenv, setools fails to write into /usr/share/setools. This fix uses sys.prefix to install data_files either system wide or inside the virtualenv.
This commit is contained in:
parent
79320ba0cc
commit
0583fc7fda
4
setup.py
4
setup.py
@ -6,6 +6,8 @@ from distutils.core import Extension
|
|||||||
from distutils.cmd import Command
|
from distutils.cmd import Command
|
||||||
from setuptools.command.build_ext import build_ext
|
from setuptools.command.build_ext import build_ext
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
from os.path import join
|
||||||
|
|
||||||
|
|
||||||
class YaccCommand(Command):
|
class YaccCommand(Command):
|
||||||
@ -126,7 +128,7 @@ setup(name='setools',
|
|||||||
'build_ext': BuildExtCommand},
|
'build_ext': BuildExtCommand},
|
||||||
packages=['setools', 'setools.policyrep'],
|
packages=['setools', 'setools.policyrep'],
|
||||||
scripts=['seinfo', 'seinfoflow', 'sesearch', 'sedta'],
|
scripts=['seinfo', 'seinfoflow', 'sesearch', 'sedta'],
|
||||||
data_files=[('/usr/share/setools', ['data/perm_map'])],
|
data_files=[(join(sys.prefix, 'share/setools'), ['data/perm_map'])],
|
||||||
ext_modules=ext_py_mods,
|
ext_modules=ext_py_mods,
|
||||||
test_suite='tests',
|
test_suite='tests',
|
||||||
license='GPLv2+, LGPLv2.1+',
|
license='GPLv2+, LGPLv2.1+',
|
||||||
|
Loading…
Reference in New Issue
Block a user