You are not logged in.

#1 2009-07-21 00:36:50

derelict
Member
Registered: 2006-07-25
Posts: 81

permissions errors during PKGBUILD make install process

I'm trying to make the squidguard package from AUR to build correctly, but I keep receiving the following error:

Installing squidGuard
cp: cannot create regular file `/usr/bin/squidGuard': Permission denied
make: *** [install-build] Error 1
==> ERROR: Build Failed.
    Aborting...

I think the install-build script is not understanding the 'prefix=' parameter, or is re-reading it incorrectly. Can anyone confirm this or provide any additional insight?
Here is my modified version of the PKGBUILD:

# Contributor: osmano807 <osmano807@gmail.com>
pkgname=squidguard-1.4
pkgver=1.4
pkgrel=1
pkgdesc=" An ultrafast and free filter, redirector and access controller for Squid "
url="http://www.squidguard.org/"
license=""
arch=('i686' 'x86_64')
license=('GPL')
depends=(db)
makedepends=()
conflicts=()
replaces=()
backup=()
install=
source=(http://squidguard.org/Downloads/squidGuard-1.4.tar.gz)
md5sums=('de834150998c1386c30feae196f16b06')


build() {
    cd $srcdir
    mv squidGuard-$pkgver squidguard-$pkgver
    cd squidguard-$pkgver
    ./configure --prefix=/usr --with-squiduser=proxy \
    --with-sg-config=${pkgdir}/etc/squid/squidguard.conf \
    --with-sg-logdir=${pkgdir}/var/log/squidguard \
    --with-sg-dbhome=${pkgdir}/var/blacklists
    make || return 1
    make DESTDIR=$pkgdir install
}

Offline

#2 2009-07-21 01:02:01

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: permissions errors during PKGBUILD make install process

Change the build function to this:

  cd "$srcdir/squidGuard-$pkgver"
  sed -i '19,24 s/@[se]/$(DESTDIR)&/; /SQUIDUSER/d' Makefile.in
  ./configure --prefix=/usr \
     --with-sg-config=/etc/$pkgname.conf \
     --with-sg-logdir=/var/log/$pkgname \
     --with-sg-dbhome=/var/$pkgname/db
  make || return 1
  make DESTDIR="$pkgdir" install

and then do the squiduser creation and chown'ing in an .install file.

Also, why did you submit this package to the AUR?  It's just a version bump of squidguard, and it doesn't even work yet.  In the future, you should mail the aur-general mailing list to request that a package be orphaned instead of submitting the same package with a new name.

Last edited by tdy (2009-07-21 01:40:13)

Offline

#3 2009-07-21 05:19:06

derelict
Member
Registered: 2006-07-25
Posts: 81

Re: permissions errors during PKGBUILD make install process

Thanks for the sed script. That resolves a bunch of issues I was having with this package. It's an elegantly simple solution. I'm guessing you've had experience with this?
I'm not actually the one who submitted it to the AUR, I just couldn't get it to biuild. I never got the old version to build either.

Is it best practices to put the user creation in the .install file even when there is a configure option? Or does it just make things simpler with this particular package?
The reason I ask is because I'm also trying to build a derivative of squidguard called ufdbguard and I've run into similar issues, no doubt due to the similar origins. I've posted about it here: http://bbs.archlinux.org/viewtopic.php?id=76287

Offline

#4 2009-07-21 06:02:34

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: permissions errors during PKGBUILD make install process

double post

Last edited by tdy (2009-07-21 06:31:17)

Offline

#5 2009-07-21 06:10:13

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: permissions errors during PKGBUILD make install process

derelict wrote:

Is it best practices to put the user creation in the .install file even when there is a configure option?

The main problem with doing it inside the PKGBUILD is that it would require root privileges to create the user.

derelict wrote:

I'm not actually the one who submitted it to the AUR, I just couldn't get it to biuild.

I see, sorry for the misunderstanding.

derelict wrote:

The reason I ask is because I'm also trying to build a derivative of squidguard called ufdbguard and I've run into similar issues, no doubt due to the similar origins.

I took a brief look at the ufdbguard source, and quite frankly I don't have the time/desire to fix it up right now.  Sorry, hopefully someone else can help you with it.

Cheers

Last edited by tdy (2009-07-21 06:31:01)

Offline

#6 2009-07-25 06:27:31

djszapi
Member
From: Cambridge, United Kingdom
Registered: 2009-06-14
Posts: 1,439
Website

Re: permissions errors during PKGBUILD make install process

# Maintainer: osmano807 <osmano807@gmail.com>
pkgname=squidguard
pkgver=1.4
pkgrel=1
pkgdesc=" An ultrafast and free filter, redirector and access controller for Squid "
url="http://www.squidguard.org/"
arch=('i686' 'x86_64')
license=('GPL')
depends=(db)
source=(http://squidguard.org/Downloads/${pkgname}-${pkgver}.tar.gz)
md5sums=('de834150998c1386c30feae196f16b06')

Well:

1. Contributor -> Maintainer
2. Pkgname is package name variable without version information in normal case.
3. Remove the duplicated license variable
4. Remove blank variables.
5. You can use mostly the pkgname, pkgver variable in source line too.

Correct it, or report it to the author.

It's just for a cleaner PKGBUILD on aur wink

Offline

Board footer

Powered by FluxBB