Files
entropy/rigo/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

48 lines
1.6 KiB
Makefile

SUBDIRS = data po
PREFIX = /usr
BINDIR = $(PREFIX)/bin
LIBDIR = $(PREFIX)/lib
PYTHON_SITEDIR = $(LIBDIR)
RIGO_PYDIR = $(PYTHON_SITEDIR)/_entropy
DESTDIR =
all:
for d in $(SUBDIRS); do $(MAKE) -C $$d; done
install:
install -d $(DESTDIR)$(BINDIR)/
install -d $(DESTDIR)$(RIGO_PYDIR)/rigo/ \
$(DESTDIR)$(RIGO_PYDIR)/rigo/controllers \
$(DESTDIR)$(RIGO_PYDIR)/rigo/models \
$(DESTDIR)$(RIGO_PYDIR)/rigo/ui/gtk3/controllers \
$(DESTDIR)$(RIGO_PYDIR)/rigo/ui/gtk3/models \
$(DESTDIR)$(RIGO_PYDIR)/rigo/ui/gtk3/widgets \
install -m 644 $(wildcard rigo/*.py) $(DESTDIR)$(RIGO_PYDIR)/rigo/
install -m 644 $(wildcard rigo/models/*.py) \
$(DESTDIR)$(RIGO_PYDIR)/rigo/models/
install -m 644 $(wildcard rigo/controllers/*.py) \
$(DESTDIR)$(RIGO_PYDIR)/rigo/controllers/
install -m 644 $(wildcard rigo/ui/*.py) \
$(DESTDIR)$(RIGO_PYDIR)/rigo/ui/
install -m 644 $(wildcard rigo/ui/gtk3/*.py) \
$(DESTDIR)$(RIGO_PYDIR)/rigo/ui/gtk3/
install -m 644 $(wildcard rigo/ui/gtk3/models/*.py) \
$(DESTDIR)$(RIGO_PYDIR)/rigo/ui/gtk3/models/
install -m 644 $(wildcard rigo/ui/gtk3/controllers/*.py) \
$(DESTDIR)$(RIGO_PYDIR)/rigo/ui/gtk3/controllers/
install -m 644 $(wildcard rigo/ui/gtk3/widgets/*.py) \
$(DESTDIR)$(RIGO_PYDIR)/rigo/ui/gtk3/widgets/
install -m 755 rigo_app.py $(DESTDIR)$(BINDIR)/rigo
install -d $(DESTDIR)/usr/share/applications
install -d $(DESTDIR)/usr/share/mime/packages
install -m 644 data/desktop/rigo.desktop $(DESTDIR)/usr/share/applications/
install -m 644 data/desktop/rigo-mimetypes.xml $(DESTDIR)/usr/share/mime/packages/
for d in $(SUBDIRS); do $(MAKE) -C $$d install; done
clean:
for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done