mirror of https://github.com/OISF/suricata
python: install without distutils
Instead of using distutils/setuptools for installing the Python code,
just install it into our own Python directory.
Distutils is being removed from Python, and setuptools doesn't work well
when trying to install into your own location. For our usage its just
simpler to install with make.
In addition to removing the configure check for distutils, also remove
the check for pyyaml. This lets the user install pyyaml after Suricata
is installed, and Suricata-Update does handle this case gracefully.
Issue: #5313
(cherry picked from commit 9a1d6af858)
pull/7820/head
parent
8762699edf
commit
c8a3aa608e
@ -1,34 +1,47 @@
|
||||
EXTRA_DIST = setup.py \
|
||||
bin \
|
||||
suricata \
|
||||
suricatasc
|
||||
LIBS = \
|
||||
suricata/__init__.py \
|
||||
suricata/config/__init__.py \
|
||||
suricata/ctl/__init__.py \
|
||||
suricata/ctl/filestore.py \
|
||||
suricata/ctl/loghandler.py \
|
||||
suricata/ctl/main.py \
|
||||
suricata/ctl/test_filestore.py \
|
||||
suricata/sc/__init__.py \
|
||||
suricata/sc/specs.py \
|
||||
suricata/sc/suricatasc.py \
|
||||
suricatasc/__init__.py
|
||||
|
||||
BINS = \
|
||||
suricatasc \
|
||||
suricatactl
|
||||
|
||||
EXTRA_DIST = $(LIBS) bin suricata/config/defaults.py
|
||||
|
||||
if HAVE_PYTHON
|
||||
if HAVE_PYTHON_DISTUTILS
|
||||
all-local:
|
||||
cd $(srcdir) && \
|
||||
$(HAVE_PYTHON) setup.py build --build-base "$(abs_builddir)"
|
||||
|
||||
install-exec-local:
|
||||
cd $(srcdir) && \
|
||||
$(HAVE_PYTHON) setup.py build --build-base "$(abs_builddir)" \
|
||||
install --prefix $(DESTDIR)$(prefix)
|
||||
install -d -m 0755 "$(DESTDIR)$(prefix)/lib/suricata/python/suricata/config"
|
||||
install -d -m 0755 "$(DESTDIR)$(prefix)/lib/suricata/python/suricata/ctl"
|
||||
install -d -m 0755 "$(DESTDIR)$(prefix)/lib/suricata/python/suricata/sc"
|
||||
install -d -m 0755 "$(DESTDIR)$(prefix)/lib/suricata/python/suricatasc"
|
||||
install -d -m 0755 "$(DESTDIR)$(prefix)/bin"
|
||||
for src in $(LIBS); do \
|
||||
install $(srcdir)/$$src "$(DESTDIR)$(prefix)/lib/suricata/python/$$src"; \
|
||||
done
|
||||
install suricata/config/defaults.py \
|
||||
"$(DESTDIR)$(prefix)/lib/suricata/python/suricata/config/defaults.py"
|
||||
for bin in $(BINS); do \
|
||||
cat "$(srcdir)/bin/$$bin" | \
|
||||
sed -e "1 s,.*,#"'!'" ${HAVE_PYTHON}," > "${DESTDIR}$(bindir)/$$bin"; \
|
||||
chmod 0755 "$(DESTDIR)$(bindir)/$$bin"; \
|
||||
done
|
||||
|
||||
uninstall-local:
|
||||
rm -f $(DESTDIR)$(bindir)/suricatactl
|
||||
rm -f $(DESTDIR)$(bindir)/suricatasc
|
||||
rm -rf $(DESTDIR)$(prefix)/lib*/python*/site-packages/suricata
|
||||
rm -rf $(DESTDIR)$(prefix)/lib*/python*/site-packages/suricatasc
|
||||
rm -rf $(DESTDIR)$(prefix)/lib*/python*/site-packages/suricata-[0-9]*.egg-info
|
||||
rm -rf $(DESTDIR)$(prefix)/lib/suricata/python
|
||||
|
||||
clean-local:
|
||||
cd $(srcdir) && \
|
||||
$(HAVE_PYTHON) setup.py clean \
|
||||
--build-base "$(abs_builddir)"
|
||||
rm -rf scripts-* lib* build
|
||||
find . -name \*.pyc -print0 | xargs -0 rm -f
|
||||
|
||||
distclean-local:
|
||||
rm -f version
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -1,30 +1,62 @@
|
||||
if HAVE_PYTHON
|
||||
if HAVE_PYTHON_DISTUTILS
|
||||
if HAVE_PYTHON_YAML
|
||||
LIBS = \
|
||||
suricata/__init__.py \
|
||||
suricata/update/commands/__init__.py \
|
||||
suricata/update/commands/addsource.py \
|
||||
suricata/update/commands/checkversions.py \
|
||||
suricata/update/commands/disablesource.py \
|
||||
suricata/update/commands/enablesource.py \
|
||||
suricata/update/commands/listsources.py \
|
||||
suricata/update/commands/removesource.py \
|
||||
suricata/update/commands/updatesources.py \
|
||||
suricata/update/compat/__init__.py \
|
||||
suricata/update/compat/ordereddict.py \
|
||||
suricata/update/compat/argparse/__init__.py \
|
||||
suricata/update/compat/argparse/argparse.py \
|
||||
suricata/update/configs/__init__.py \
|
||||
suricata/update/config.py \
|
||||
suricata/update/data/__init__.py \
|
||||
suricata/update/data/index.py \
|
||||
suricata/update/data/update.py \
|
||||
suricata/update/__init__.py \
|
||||
suricata/update/engine.py \
|
||||
suricata/update/exceptions.py \
|
||||
suricata/update/extract.py \
|
||||
suricata/update/loghandler.py \
|
||||
suricata/update/main.py \
|
||||
suricata/update/maps.py \
|
||||
suricata/update/matchers.py \
|
||||
suricata/update/net.py \
|
||||
suricata/update/notes.py \
|
||||
suricata/update/osinfo.py \
|
||||
suricata/update/parsers.py \
|
||||
suricata/update/rule.py \
|
||||
suricata/update/sources.py \
|
||||
suricata/update/util.py \
|
||||
suricata/update/version.py
|
||||
|
||||
BINS = suricata-update
|
||||
|
||||
all-local:
|
||||
cd $(srcdir) && \
|
||||
$(HAVE_PYTHON) setup.py build --build-base $(abs_builddir)
|
||||
if HAVE_PYTHON
|
||||
|
||||
install-exec-local:
|
||||
cd $(srcdir) && \
|
||||
$(HAVE_PYTHON) setup.py build --build-base "$(abs_builddir)" \
|
||||
install --prefix $(DESTDIR)$(prefix)
|
||||
install -d -m 0755 "$(DESTDIR)$(prefix)/lib/suricata/python/suricata/update/commands"
|
||||
install -d -m 0755 "$(DESTDIR)$(prefix)/lib/suricata/python/suricata/update/compat/argparse"
|
||||
install -d -m 0755 "$(DESTDIR)$(prefix)/lib/suricata/python/suricata/update/configs"
|
||||
install -d -m 0755 "$(DESTDIR)$(prefix)/lib/suricata/python/suricata/update/data"
|
||||
for lib in $(LIBS); do \
|
||||
install $(srcdir)/$$lib "$(DESTDIR)$(prefix)/lib/suricata/python/$$lib"; \
|
||||
done
|
||||
for bin in $(BINS); do \
|
||||
cat "$(srcdir)/bin/$$bin" | \
|
||||
sed -e "1 s,.*,#"'!'" ${HAVE_PYTHON}," > "${DESTDIR}$(bindir)/$$bin"; \
|
||||
chmod 0755 "$(DESTDIR)$(bindir)/$$bin"; \
|
||||
done
|
||||
|
||||
uninstall-local:
|
||||
rm -f $(DESTDIR)$(bindir)/suricata-update
|
||||
rm -rf $(DESTDIR)$(prefix)/lib*/python*/site-packages/suricata-update
|
||||
rm -rf $(DESTDIR)$(prefix)/lib*/python*/site-packages/suricata_update-[0-9]*.egg-info
|
||||
rm -rf $(DESTDIR)$(prefix)/lib/suricata/python
|
||||
|
||||
clean-local:
|
||||
cd $(srcdir) && \
|
||||
$(HAVE_PYTHON) setup.py clean \
|
||||
--build-base "$(abs_builddir)"
|
||||
rm -rf scripts-* lib* build
|
||||
find . -name \*.pyc -print0 | xargs -0 rm -f
|
||||
|
||||
distclean-local:
|
||||
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
Loading…
Reference in New Issue