You are not logged in.

#1 2010-07-06 14:19:08

hwkiller
Member
Registered: 2009-07-21
Posts: 56

[SOLVED] "cp: cannot stat" when running makepkg

Why is this happening to my package when I try to make a package out of it.  I made a very simple script and decided to make a PKGBUILD for it, so that I could give it to anyone else who wants it on Arch.

PKGBUILD

pkgname=gdm-background-copy
pkgver=1
pkgrel=1
pkgdesc="Tool to use specified user's background for GDM login background"
arch=('x86_64' 'i686')
license=('GPL')
depends=('gdm>=2.8' 'sudo')
source=($pkgname-$pkgver.tar.gz)
md5sums=('43a747ba25d449cfacbd26d37d517647')

build() {
mkdir -p "%pkgdir/usr/bin/"
cp "%srcdir/gdm-background-copy" "%pkgdir/usr/bin"
chown root "%pkgdir/usr/bin/gdm-background-copy"
chgrp root "%pkgdir/usr/bin/gdm-background-copy"
chmod 755 "%pkgdir/usr/bin/gdm-background-copy"
}

# vim:set ts=2 sw=2 et:

Script

#!/bin/sh
echo "Enter your username (e.g.,[hwkiller] without the brackets)"
read USER


bkrnd=`sudo -u $USER gconftool-2 --get /desktop/gnome/background/picture_filename`
echo "Using $bkrnd"
if [ ! -e /usr/share/pixmaps/backgrounds/gnome/nature/gnome-background-default.jpg ]; then sudo cp /usr/share/pixmaps/backgrounds/gnome/background-default.jpg /usr/share/pixmaps/backgrounds/gnome/nature/gnome-background-default.jpg
fi

sudo cp $bkrnd /usr/share/pixmaps/backgrounds/gnome/background-default.jpg
echo "Finished."

I'm not necessarily a linux "noob," but I'm certainly new at BASH scripts beyond "#!/bin/sh sleep 15 conky" smile

When I run the makepkg I get the following:

==> Making package: gdm-background-copy 1-1 (Tue Jul  6 10:09:37 EDT 2010)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
  -> Found gdm-background-copy-1.tar.gz
==> Validating source files with md5sums...
    gdm-background-copy-1.tar.gz ... Passed
==> Extracting Sources...
  -> Extracting gdm-background-copy-1.tar.gz with bsdtar
==> Removing existing pkg/ directory...
==> Entering fakeroot environment...
==> Starting build()...
cp: cannot stat `%srcdir/gdm-background-copy': No such file or directory
    Aborting...

Oh, and here's the "ls -l" on the src directory.

-rw-r--r-- 1 hwkiller users 10240 Jul  2 18:46 gdm-background-copy
lrwxrwxrwx 1 hwkiller users    49 Jul  6 10:09 gdm-background-copy-1.tar.gz -> /home/hwkiller/Build/gdm-background-copy-1.tar.gz
drwxr-xr-x 3 hwkiller users  4096 Jul  6 10:08 %pkgdir

It seems to be making the %pkgdir in the %srcdir.

Last edited by hwkiller (2010-07-06 14:52:03)

Offline

#2 2010-07-06 14:21:29

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,543

Re: [SOLVED] "cp: cannot stat" when running makepkg

It appears that  %srcdir is undefined in your PKGBUILD

Offline

#3 2010-07-06 14:29:51

hwkiller
Member
Registered: 2009-07-21
Posts: 56

Re: [SOLVED] "cp: cannot stat" when running makepkg

I wasn't aware it had to be explicitly defined. 

I see that it extracted the .tar.gz to the ~/Build/src/ directory.  Shouldn't makepkg assume that is where %srcdir is?

Offline

#4 2010-07-06 14:48:58

jac
Member
From: /home/jac
Registered: 2009-05-19
Posts: 431
Website

Re: [SOLVED] "cp: cannot stat" when running makepkg

Why are you using '%' instead of '$' ? That could be the problem, unless I don't fully understand the shell's substitution methods.

Offline

#5 2010-07-06 14:49:58

hwkiller
Member
Registered: 2009-07-21
Posts: 56

Re: [SOLVED] "cp: cannot stat" when running makepkg

Oh for God's sake, seriously?

Why DID I do that?

Let me replace those and get back to you all.  *dunce cap*

*Edit* That worked.  I somehow managed to overlook that for an hour now.  I do believe I need some coffee.  Thanks!

Last edited by hwkiller (2010-07-06 14:51:35)

Offline

#6 2010-07-06 14:54:01

jac
Member
From: /home/jac
Registered: 2009-05-19
Posts: 431
Website

Re: [SOLVED] "cp: cannot stat" when running makepkg

You're welcome, I'm glad it got solved then. I had seen you used '$' properly in other places, so I thought it was probably just a typo (or some feature I didn't know about).

Offline

#7 2010-07-06 14:58:33

hwkiller
Member
Registered: 2009-07-21
Posts: 56

Re: [SOLVED] "cp: cannot stat" when running makepkg

Well, incase any of you all use gdm, that's a handy little script that will use the background of whatever user you input as the gdm login background. 

I couldn't get the gconf-method to work, so I wrote that.

I feel that the script I wrote is not quite of AUR-quality, so I probably won't upload that.

Offline

#8 2010-07-06 15:12:16

jac
Member
From: /home/jac
Registered: 2009-05-19
Posts: 431
Website

Re: [SOLVED] "cp: cannot stat" when running makepkg

You could add it to the Handy Command Line Utilities thread. I bet somebody would find it useful, especially if you still can't configure GDM in a normal way

Last edited by jac (2010-07-06 15:13:00)

Offline

Board footer

Powered by FluxBB