diff mbox series

[2/2] gui: Install .desktop files to /usr/share/applications by default

Message ID 20190305163856.395-2-plautrba@redhat.com (mailing list archive)
State Superseded
Headers show
Series [1/2] gui: Install polgengui.py to /usr/bin/selinux-polgengui | expand

Commit Message

Petr Lautrbach March 5, 2019, 4:38 p.m. UTC
/usr/share/applications is a standard directory for .desktop files.
Installation path can be changed using DESKTOPDIR variable in installation
phase, e.g.

make DESKTOPDIR=/usr/local/share/applications install

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
 gui/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Nicolas Iooss March 17, 2019, 1:35 p.m. UTC | #1
On Tue, Mar 5, 2019 at 5:39 PM Petr Lautrbach <plautrba@redhat.com> wrote:
>
> /usr/share/applications is a standard directory for .desktop files.
> Installation path can be changed using DESKTOPDIR variable in installation
> phase, e.g.
>
> make DESKTOPDIR=/usr/local/share/applications install
>
> Signed-off-by: Petr Lautrbach <plautrba@redhat.com>

Thanks for your patch and sorry for the delay (I have been on holidays
the last two weeks). I agree with moving .desktop files to
/usr/share/applications/ by default and your patch looks good, but it
does not create the directory if it does not exist (Travis-CI fails
with "install: target
'/home/travis/build/fishilico/selinux/installdir/usr/share/applications'
is not a directory"). Could you please add "-mkdir -p
$(DESTDIR)$(DESKTOPDIR)" next to the other mkdir commands?

Nicolas

> ---
>  gui/Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gui/Makefile b/gui/Makefile
> index b2375fbf..5e64c3a1 100644
> --- a/gui/Makefile
> +++ b/gui/Makefile
> @@ -5,6 +5,7 @@ BINDIR ?= $(PREFIX)/bin
>  SHAREDIR ?= $(PREFIX)/share/system-config-selinux
>  DATADIR ?= $(PREFIX)/share
>  MANDIR ?= $(PREFIX)/share/man
> +DESKTOPDIR ?= $(PREFIX)/share/applications
>
>  TARGETS= \
>  booleansPage.py \
> @@ -44,7 +45,7 @@ install: all
>         install -m 644 system-config-selinux.png $(DESTDIR)$(DATADIR)/pixmaps
>         install -m 644 system-config-selinux.png $(DESTDIR)$(DATADIR)/icons/hicolor/24x24/apps
>         install -m 644 system-config-selinux.png $(DESTDIR)$(DATADIR)/system-config-selinux
> -       install -m 644 *.desktop $(DESTDIR)$(DATADIR)/system-config-selinux
> +       install -m 644 *.desktop $(DESTDIR)$(DESKTOPDIR)
>         -mkdir -p $(DESTDIR)$(DATADIR)/pixmaps
>         install -m 644 sepolicy_256.png $(DESTDIR)$(DATADIR)/pixmaps/sepolicy.png
>         for i in 16 22 32 48 256; do \
> --
> 2.20.1
>
diff mbox series

Patch

diff --git a/gui/Makefile b/gui/Makefile
index b2375fbf..5e64c3a1 100644
--- a/gui/Makefile
+++ b/gui/Makefile
@@ -5,6 +5,7 @@  BINDIR ?= $(PREFIX)/bin
 SHAREDIR ?= $(PREFIX)/share/system-config-selinux
 DATADIR ?= $(PREFIX)/share
 MANDIR ?= $(PREFIX)/share/man
+DESKTOPDIR ?= $(PREFIX)/share/applications
 
 TARGETS= \
 booleansPage.py \
@@ -44,7 +45,7 @@  install: all
 	install -m 644 system-config-selinux.png $(DESTDIR)$(DATADIR)/pixmaps
 	install -m 644 system-config-selinux.png $(DESTDIR)$(DATADIR)/icons/hicolor/24x24/apps
 	install -m 644 system-config-selinux.png $(DESTDIR)$(DATADIR)/system-config-selinux
-	install -m 644 *.desktop $(DESTDIR)$(DATADIR)/system-config-selinux
+	install -m 644 *.desktop $(DESTDIR)$(DESKTOPDIR)
 	-mkdir -p $(DESTDIR)$(DATADIR)/pixmaps
 	install -m 644 sepolicy_256.png $(DESTDIR)$(DATADIR)/pixmaps/sepolicy.png
 	for i in 16 22 32 48 256; do \