On Wed, 2011-03-09 at 03:21 -0500, Kamil Paral wrote:
----- Original Message -----
> Only root can chgrp files, and since mock doesn't allow running as
> root,
> 'install -g autotest' was failing. This patch moves the group
> permission
> adjustment into %attr in the %files section of the rpm. Anyone running
> autoqa
> without rpm's installed will need to manually adjust the permissions.
> ---
> Makefile | 2 +-
> autoqa.spec | 5 ++---
> 2 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 4a2134a..4153590 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -23,7 +23,7 @@ install: build
> install autoqa $(PREFIX)/usr/bin/
> install -d $(PREFIX)/etc/autoqa
> [ -f $(PREFIX)/etc/autoqa/autoqa.conf ] || install -m 0644 autoqa.conf
> $(PREFIX)/etc/autoqa/
> - [ -f $(PREFIX)/etc/autoqa/fas.conf ] || install -m 0640 -g autotest
> fas.conf $(PREFIX)/etc/autoqa
> + [ -f $(PREFIX)/etc/autoqa/fas.conf ] || install -m 0640 fas.conf
> $(PREFIX)/etc/autoqa
Can we add conditional chgrp when running as root (after installing that file), or is it
too much hassle?
I thought about it as well, but decided against it due to laziness and I
didn't feel up for maintaining two solutions (rpm and 'make install').
But if you have a suggestion, I'll definitely add it to the set of
patches.
> install -m 0644 repoinfo.conf $(PREFIX)/etc/autoqa/
> install -d $(PREFIX)$(HOOK_DIR)
> for h in hooks/*; do cp -a $$h $(PREFIX)$(HOOK_DIR); done
> diff --git a/autoqa.spec b/autoqa.spec
> index ffe22c2..f45c2cf 100644
> --- a/autoqa.spec
> +++ b/autoqa.spec
> @@ -15,7 +15,6 @@ Requires: autotest
> Requires: koji
> Requires: python-fedora
> Requires: mod_wsgi
> -BuildRequires: autotest
> BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
> BuildArch: noarch
>
> @@ -38,7 +37,7 @@ make build PYTHON=%{__python}
> rm -rf $RPM_BUILD_ROOT
> make install PREFIX=$RPM_BUILD_ROOT TEST_DIR=%{testdir}
> HOOK_DIR=%{hookdir} PYTHON=%{__python}
> install -m 644 autoqa.conf repoinfo.conf
> $RPM_BUILD_ROOT%{_sysconfdir}/autoqa/
> -install -m 640 -g autotest fas.conf
> $RPM_BUILD_ROOT%{_sysconfdir}/autoqa/
> +install -m 640 fas.conf $RPM_BUILD_ROOT%{_sysconfdir}/autoqa/
I don't know much about packaging, maybe a silly question - why do we install all
those config files again, when it was already done by "make install" command?
Not a silly question, good catch. It might be just code that aged and
isn't needed anymore. I'll make an attempt to avoid duplication in the
next build, or at least try to remember why this is in two places. If
it's more than a simple change ... I'll likely punt to a ticket for
later work.
Thanks,
James