You are not logged in.

#1 2008-09-30 13:34:23

kramerxiita
Member
Registered: 2008-02-14
Posts: 89

Help with PKGBUILD (SOLVED)

I make a package to install my configs files with pacman. Someone files are install in my home folder (like openbox configs), but when i install this with pacman, files change permission to root.

I try make a install file with command chown in post_install, but still don't work.

How make files install in home don't change group and ower to root?

My pkg

pkgname=myconfigs
pkgver=08.09.29
pkgrel=1
pkgdesc="My configs"
arch=('i686' 'x86_64')
license=('GPL')
makedepends=('pkgconfig')
install=myconfigs.install
source=(Configs.tar.gz)

build() {
  cd ${srcdir}/Configs/

  cp -HR ${srcdir}/Configs/* ${startdir}/pkg/ || return 1
}

My install:

pre_install() {
  #Add user
  gpasswd -a myuser users
  gpasswd -a myuser audio
  gpasswd -a myuser video
  gpasswd -a myuser floppy
  gpasswd -a myuser optical
  gpasswd -a myuser storage
  gpasswd -a myuser power
  gpasswd -a myuser network
  #Shortcuts
  chmod -c +s /sbin/shutdown
  ln -sf /sbin/shutdown /usr/bin/shutdown
  ln -sf /dev/null /root/.bash_history
  ln -sf /dev/null /home/MyHome/.bash_history
  ln -sf /dev/null /home/MyHome/.fbrun_history
  ln -sf /dev/null /home/MyHome/.recently-used.xbel
  #Update clock
  ntpdate ntp.usp.br
}

op=$1
shift

$op $*

Last edited by kramerxiita (2008-10-01 11:10:12)

Offline

#2 2008-09-30 13:43:47

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,717

Re: Help with PKGBUILD (SOLVED)

kramerxiita wrote:

How make files install in home don't change group and ower to root?

you should use install instead of cp for installing the files.
With the -m flag of install you can set the permissions, with the -o flag the ownership of the files.

Offline

#3 2008-09-30 15:00:43

kramerxiita
Member
Registered: 2008-02-14
Posts: 89

Re: Help with PKGBUILD (SOLVED)

Error: install: omiting directory ...

How to make install copy folders?

Offline

#4 2008-09-30 19:21:02

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,717

Re: Help with PKGBUILD (SOLVED)

kramerxiita wrote:

Error: install: omiting directory ...

How to make install copy folders?

if you want to install all files into a specific folder you need to create a folder, you need first to create the directory with something like (guess you can also specify ownership if you need)

install -d $pkgdir/path/to/folder || return 1

If you just want to copy a single file, you can do something like (add ownership if you need it)

install -Dm644 $srcdir/path/to/file $pkgdir/path/to/new/location || return 1

Please take a look at the manpage if you need more information.

Last edited by pressh (2008-09-30 19:22:06)

Offline

#5 2008-10-01 11:10:39

kramerxiita
Member
Registered: 2008-02-14
Posts: 89

Re: Help with PKGBUILD (SOLVED)

Thanks, pressh.

Offline

Board footer

Powered by FluxBB