You are not logged in.

#1 2009-03-01 02:05:55

Square
Member
Registered: 2008-06-11
Posts: 435

Razercfg PKGBUILD... help please.

I was attempting to make a pkgbuild for this little utility. A friend wanted it for controlling his mouse, so I decided to take it on and see what I could do.

Everything goes smoothly, except the make install process does something strange with a script. Instead of installing everything to the DESTDIR like it should, it does this:

-- Installing: /home/square/abs/razercfg/pkg/usr/local/lib/librazer.so          
running /usr/bin/python2.6 /home/square/abs/razercfg/src/razercfg-001/pyrazer/in
stall.py /home/square/abs/razercfg/src/razercfg-001/pyrazer  2>&1               
Python module path found in /usr/lib/python2.6/site-packages                    
ERROR: Could not install module "pyrazer.so"                                    
[Errno 13] Permission denied: '/usr/lib/python2.6/site-packages/pyrazer.so'     
CMake Error at pyrazer/cmake_install.cmake:40 (message):                        
  Failed to install python module pyrazer                                       
Call Stack (most recent call first):                                            
  cmake_install.cmake:38 (INCLUDE)                                              
                                                                                
                                                                                
make: *** [install] Error 1

i'm not sure how to handle this and correct the behavior. Here is my pkgbuild:

pkgname=razercfg
pkgver=001
pkgrel=1
pkgdesc="Configuration tool for the Razer mouse"
arch=('i686')
url="http://bu3sch.de/razercfg.php"
license=('GPL' 'BSD')
depends=('libusb' 'libconfig')
builddepends=('cmake')
optdepends=('qt')
source=(http://bu3sch.de/$pkgname/$pkgname-$pkgver.tar.bz2)
md5sums=('bcf7d9e0b5a6fe15f26c6df04720c60f')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  cmake .
  make || return 1
  make DESTDIR="$pkgdir/" install
}

Note: This was meant for just personal use, so if anyone wants to take anything fixed afterward and put it in the AUR, I don't mind.

Help would be appreciated, and thank you ahead of time.

Last edited by Square (2009-03-01 03:48:38)


 

Offline

#2 2009-03-01 03:14:15

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: Razercfg PKGBUILD... help please.

You will need to pass --root=$pkgdir to the python install script. Not sure how to do that using cmake. You may need to patch razercfg-001/pyrazer/CMakeLists.txt or pass it a destination variable somehow. Not sure how.

Last edited by mikesd (2009-03-01 03:48:48)

Offline

#3 2009-03-01 18:37:37

Square
Member
Registered: 2008-06-11
Posts: 435

Re: Razercfg PKGBUILD... help please.

Hmm... I'm not sure whether it needs to be addressed through cmake or the install script. Anyone familiar with cmake have any ideas?


 

Offline

#4 2009-03-10 11:22:01

WhiteMagic
Member
Registered: 2007-03-01
Posts: 85

Re: Razercfg PKGBUILD... help please.

I tried building the same app today myself, and I used the git version, since the 001 tarball had a cmake file that wasn't quite up to date so I took the git version which fixed that. The PKGBUILD is as follows:

pkgname=razercfg-git
pkgver=20090310
pkgrel=1
pkgdesc="Razercfg is a tool to configure razer mice."
url="http://bu3sch.de/razercfg.php"
license="GPL2"
depends=('python' 'libusb' 'pyqt')
makedepends=('git' 'cmake')
arch=('i686')
source=()
md5sums=()

_gitroot=http://bu3sch.de/git/razer.git
_gitname=razer

build() {
    cd ${srcdir}
    msg "Connecting to GIT server ..."

    if [ -d ${srcdir}/$_gitname ] ; then
        cd $_gitname && git pull origin
        msg "The local files are updated."
    else
        git clone $_gitroot
    fi
    msg "GIT checkout done or server timeout"

    git clone $_gitname $_gitname-build
    cd ${srcdir}/$_gitname-build

    cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TYPE=Release . || return 1
    make || return 1
    make DESTDIR=${pkgdir} install || return 1

    install -D -m644 ui/pyrazer.py ${pkgdir}/usr/lib/python2.6/site-packages/pyrazer.py || return 1
    install -D -m755 razerd/razerd ${pkgdir}/usr/bin/razerd || return 1

}

For me it compiles and installs fine, the only problem is that the app itself is not working for me because somehow my mouse isn't picked up. Why I haven't figured out yet. I also didn't bother with the udev rules file yet, but that it would only required a quick sed and install directive to use I suppose.

Offline

#5 2009-03-10 20:32:37

Square
Member
Registered: 2008-06-11
Posts: 435

Re: Razercfg PKGBUILD... help please.

In order for the app to work, you must have the new firmware installed on your mouse (and of course, it must be the correct brand). So far, I know of no way to update the firmware in linux. The author intends to be the first to implement the ability to do so with this very tool in the future.

And, thank you for your work. You may consider submitting and maintaining an AUR package for this, but that's completely up to you. I don't plan on doing so myself.

Last edited by Square (2009-03-10 20:32:57)


 

Offline

#6 2009-03-11 16:04:09

WhiteMagic
Member
Registered: 2007-03-01
Posts: 85

Re: Razercfg PKGBUILD... help please.

After a reboot the mouse was found but I still didn't manage to change any settings but I didn't try that hard. Updating the firmware isn't a problem, I still have a Windows partition flying around.

As for putting it on AUR I might do that when I polished it a little, might be good to add a script for /etc/rc.d for the razerd daemon that's needed to interact with the mouse.

Offline

Board footer

Powered by FluxBB