diff --git a/GUI/xephem/Makefile b/GUI/xephem/Makefile
index 274269b..cbfa930 100644
--- a/GUI/xephem/Makefile
+++ b/GUI/xephem/Makefile
@@ -48,6 +48,17 @@ LDFLAGS = $(LIBLNK) $(CLDFLAGS) -L$(MOTIFL) $(PLATL)
XLIBS = -lXm -lXt -lXext -lXmu -lX11
LIBS = $(XLIBS) $(LIBLIB) -lm -lssl
+# Variables installation for Linux
+# For install XEphem without root permission, use a directory local
+# such $(HOME)/local or another of your preference in the prefix variable.
+ifeq ($(UNAME_S),Linux)
+ prefix = $(HOME)/local
+ bindir = $(prefix)/bin
+ datadir = $(prefix)/share
+ mandir = $(datadir)/man
+ export datadir
+endif
+
# static linking on Apple using X11 libs from ports
# CC = gcc
# OLI = /opt/local/include
@@ -203,7 +214,7 @@ xephem: $(INCS) $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
xephem.1: xephem.man
- nroff -man $? > $@
+ cp $? $@
libs:
cd ../../libastro; make
@@ -218,3 +229,24 @@ clean:
clobber: clean
rm -fr xephem xephem.1
+
+# Installation in Linux systems
+ifeq ($(UNAME_S),Linux)
+install: install-binary install-man install-data install-desktopfiles
+
+install-binary:
+ install -Dm 755 xephem -t $(DESTDIR)$(bindir)
+
+install-man:
+ install -Dm 644 xephem.1 -t $(DESTDIR)$(mandir)/man1
+
+install-data:
+ install -dm 755 $(DESTDIR)$(datadir)/xephem
+ @for d in auxil catalogs fifos fits gallery help lo; do \
+ echo "cp -R $$d $(DESTDIR)$(datadir)/xephem"; \
+ cp -R $$d $(DESTDIR)$(datadir)/xephem; \
+ done
+
+install-desktopfiles:
+ cd ../../desktopfiles; make DESTDIR=$(DESTDIR) install
+endif
diff --git a/desktopfiles/Makefile b/desktopfiles/Makefile
new file mode 100644
index 0000000..05b2be9
--- /dev/null
+++ b/desktopfiles/Makefile
@@ -0,0 +1,39 @@
+# Makefile for manage desktop files
+#
+# Requires convert program of the package ImageMagick.
+
+CONVERT = convert
+
+SRCPNGICON = ../GUI/xephem/XEphem.png
+PNGICONS = \
+ 32x32/apps/xephem.png \
+ 48x48/apps/xephem.png \
+ 64x64/apps/xephem.png \
+ 128x128/apps/xephem.png
+DESKTOPFILE = io.github.xephem.desktop
+METAINFOFILE = io.github.xephem.metainfo.xml
+
+iconsdir = $(DESTDIR)$(datadir)/icons/hicolor
+applicationsdir = $(DESTDIR)$(datadir)/applications
+metainfodir = $(DESTDIR)$(datadir)/metainfo
+
+
+all:
+
+install: install-icons install-desktopfile install-metainfo
+
+install-icons: $(PNGICONS)
+
+$(PNGICONS): $(SRCPNGICON)
+ @d=$(iconsdir)/$(shell dirname $@); \
+ s=$(shell echo $@ | sed -e 's/[a-z]*\([0-9]*\).*/\1/'); \
+ echo "install -m 755 -d $$d"; \
+ install -m 755 -d $$d; \
+ echo "convert -geometry $${s}x$${s} -depth 8 -background none $< $(iconsdir)/$@"; \
+ $(CONVERT) -geometry $${s}x$${s} -depth 8 -background none $< $(iconsdir)/$@
+
+install-desktopfile:
+ install -Dm 644 $(DESKTOPFILE) -t $(applicationsdir)
+
+install-metainfo:
+ install -Dm 644 $(METAINFOFILE) -t $(metainfodir)
diff --git a/desktopfiles/io.github.xephem.desktop b/desktopfiles/io.github.xephem.desktop
new file mode 100644
index 0000000..12dbe88
--- /dev/null
+++ b/desktopfiles/io.github.xephem.desktop
@@ -0,0 +1,13 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=XEphem
+GenericName=X Window Ephemeris
+GenericName[es]=Ventana X de Efemérides
+Comment=Interactive astronomical ephemeris software
+Comment[es]=Software Interactivo de efemérides astrónomicas
+Exec=xephem
+Icon=xephem
+Terminal=false
+Categories=Science;Astronomy;Motif;
+Keywords=Astronomy;
diff --git a/desktopfiles/io.github.xephem.metainfo.xml b/desktopfiles/io.github.xephem.metainfo.xml
new file mode 100644
index 0000000..c290ca2
--- /dev/null
+++ b/desktopfiles/io.github.xephem.metainfo.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+