commit 4e38820d062a7fcea3cd0c09637dde982a64cdae Author: Jan Pokorny jpokorny@redhat.com Date: Mon Oct 25 14:35:01 2010 +0200
spec/initscript makefile: user/group parameterized
init.d/Makefile | 10 +++++++++- luci.spec | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) --- diff --git a/init.d/Makefile b/init.d/Makefile index 0fdd546..1f390d1 100644 --- a/init.d/Makefile +++ b/init.d/Makefile @@ -1,10 +1,18 @@ TARGET = luci +RUN_USER ?= luci +RUN_GROUP ?= ${RUN_USER} sysconfdir ?= ${DESTDIR}/etc
+.PHONY = all install set_group clean + all:
-install: +install: set_usergroup /usr/bin/install -d ${sysconfdir}/rc.d/init.d /usr/bin/install ${TARGET} ${sysconfdir}/rc.d/init.d
+set_usergroup: + sed -ni "s/(LUCI_USER=)[^$]*$/\1${RUN_USER}/;" \ + "s/(LUCI_GROUP=)[^$]*$/\1${RUN_GROUP}/;" ${TARGET} + clean: diff --git a/luci.spec b/luci.spec index ad94aac..1a09ffc 100644 --- a/luci.spec +++ b/luci.spec @@ -61,7 +61,7 @@ python setup.py build rm -rf %{buildroot} mkdir -p %{buildroot}/var/log/luci python setup.py install --skip-build --root %{buildroot} -cd init.d && make DESTDIR=%{buildroot} install;cd .. +cd init.d && make DESTDIR=%{buildroot} RUNUSER=%{username} RUNGROUP=%{groupname} install;cd .. cd config && make DESTDIR=%{buildroot} install;cd .. cd lucipam && python setup.py install --root %{buildroot}; cd ..
luci-commits@lists.fedorahosted.org