Commit 69996037 authored by Seblu's avatar Seblu

Add sudo config

This add sudo config to allow member of devtools group to run build commands as
root without password
parent 9727b684
......@@ -16,3 +16,4 @@ zsh_completion
find-libdeps
crossrepomove
arch-nspawn
sudoers
......@@ -67,7 +67,7 @@ BASHCOMPLETION_LINKS = \
archco \
communityco
all: $(BINPROGS) bash_completion zsh_completion
all: $(BINPROGS) bash_completion zsh_completion sudoers
edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/devtools|g"
......@@ -79,8 +79,15 @@ edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/devtools|g"
@chmod +x "$@"
@bash -O extglob -n "$@"
sudoers: sudoers.in
@echo "GEN $@"
@$(RM) "$@"
@m4 -D PREFIX='$(PREFIX)/bin' -D BIN='makechrootpkg $(ARCHBUILD_LINKS)' $@.in > $@
@chmod a-w "$@"
clean:
rm -f $(BINPROGS) bash_completion zsh_completion
rm -f $(BINPROGS) sudoers bash_completion zsh_completion
install:
install -dm0755 $(DESTDIR)$(PREFIX)/bin
......@@ -95,6 +102,8 @@ install:
for l in ${BASHCOMPLETION_LINKS}; do ln -sf devtools $(DESTDIR)/usr/share/bash-completion/completions/$$l; done
install -Dm0644 zsh_completion $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
ln -sf archco $(DESTDIR)$(PREFIX)/bin/communityco
install -dm750 $(DESTDIR)/etc/sudoers.d
install -Dm0644 sudoers $(DESTDIR)/etc/sudoers.d/50-devtools
uninstall:
for f in ${BINPROGS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
......@@ -106,6 +115,7 @@ uninstall:
rm $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
rm -f $(DESTDIR)$(PREFIX)/bin/communityco
rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides
rm -f $(DESTDIR)$/etc/sudoers.d/50-devtools
dist:
git archive --format=tar --prefix=devtools-$(V)/ $(V) | gzip -9 > devtools-$(V).tar.gz
......
define(`prep',dnl
`ifelse(index(`$1', ` '),-1,PREFIX/$1,PREFIX/substr($1,0,index(`$1',` '))`, 'dnl
`$0(substr(`$1', eval(index(`$1',` ')+1)))')'dnl
)dnl
Cmnd_Alias DEVTOOLS = prep(BIN)
Defaults!DEVTOOLS umask_override
%devtools ALL=(root) NOPASSWD: DEVTOOLS
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment