summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/polkit/Makefile
blob: b70cc96c4ac0b58af2ba26c351562a51f85d30e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
BINDIR = /usr/bin
LIBEXECDIR = /usr/libexec
BINDEST = $(PREFIX)$(BINDIR)
POLKITPOLICYDEST = $(PREFIX)/usr/share/polkit-1/actions

POLICY_IN := $(wildcard *.policy.in)
POLICY = $(POLICY_IN:.policy.in=.policy)
WRAPPERS = $(patsubst org.mageia.%.policy,%,$(POLICY))

all: $(WRAPPERS) $(POLICY)

clean:
	rm -f  $(WRAPPERS) $(POLICY)

%: org.mageia.%.policy.in
	@echo -e '#!/bin/sh\nif  [[ "$(id -u)" != "0" ]] ; then" >\n    exec $(BINDIR)/pkexec $(LIBEXECDIR)/$@ $$""*\nelse\n    exec $(LIBEXECDIR)/$@ $$""*\nfi\n' > $@

%.policy: %.policy.in
	intltool-merge --utf8 ../po $< $@ -x -u -c ../po/.intltool-merge-cache

install: all
	install -d $(BINDEST) $(POLKITPOLICYDEST)
	install -m755 $(WRAPPERS) $(BINDEST)
	install -m644 $(POLICY) $(POLKITPOLICYDEST)