Files
entropy/matter/Makefile
Sławomir Nizio 6d4a3f09e6 makefiles: establish a layout for sitedir installs
The idea is that:
- entropy.* imports will work as before (so any 3rd party clients will
  work as always) - installed in "entropy" package,
- new "_entropy" package to hold a namespace for private modules (like
  ones that required adding special directories to sys.path).
  (Underscored name for a top level Python module is not very common...
  anyway, it was inspired by "_emerge.")

Layout:
site-packages/
    entropy (backwards compatible)
	const.py
	...
    kswitch (also toplevel to keep compatibility)
	...
    _entropy
	eit
	magneto
	matter
	rigo
	RigoDaemon
	solo

(Note that site-packages does not need to be actually Python's
site-packages directory but anything as it is controlled by an argument
to make. It is however intended to be the sitedir.)

Another idea for a layout would be one that mimics sources checkout, but
the layout there is somewhat scattered. (And some ugliness would be
needed to make them modules before implicit namespaces from Python 3.3.
Anyway, imports would be long and ugly.)

Now, the layout of installed Entropy is lean; installation to virtualenv
is also possible (though there would be a need to call scripts like
"python equo.py" as shebangs are not converted).

Follow up changes are needed to make it work.
2018-11-26 20:15:36 +01:00

40 lines
965 B
Makefile

SUBDIRS =
PREFIX = /usr
LIBDIR = $(PREFIX)/lib
PYTHON_SITEDIR = $(LIBDIR)
SBINDIR = $(PREFIX)/sbin
DESTDIR =
MATTER_PYDIR = $(DESTDIR)$(PYTHON_SITEDIR)/_entropy
all:
for d in $(SUBDIRS); do $(MAKE) -C $$d; done
install:
mkdir -p $(MATTER_PYDIR)/matter
mkdir -p $(MATTER_PYDIR)/matter/binpms
mkdir -p $(DESTDIR)$(SBINDIR)
install -m 644 matter/*.py $(MATTER_PYDIR)/matter/
install -m 644 matter/binpms/__init__.py \
$(MATTER_PYDIR)/matter/binpms/
install -m 755 matter_app.py $(DESTDIR)$(SBINDIR)/matter
install -m 755 antimatter.py $(DESTDIR)$(SBINDIR)/antimatter
for d in $(SUBDIRS); do $(MAKE) -C $$d install; done
base-install:
mkdir -p $(MATTER_PYDIR)/matter/binpms
install -m 644 matter/binpms/base.py \
$(MATTER_PYDIR)/matter/binpms/
entropysrv-install:
mkdir -p $(MATTER_PYDIR)/matter/binpms
install -m 644 matter/binpms/entropysrv.py \
$(MATTER_PYDIR)/matter/binpms/
clean:
for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done