You are not logged in.

#1 2006-01-28 08:45:25

AndyRTR
Developer
From: Magdeburg/Germany
Registered: 2005-10-07
Posts: 1,641

How to prevent a file from stripping?

I'm building vacation for Arch64 but should be the same for 32bit. PKGBUILD looks like this:

# $Id: PKGBUILD,v 1.1 2004/01/21 15:43:15 dale Exp $
# Maintainer: dale <dale@archlinux.org>

pkgname=vacation
pkgver=1.2.6.1
pkgrel=1
pkgdesc="an automatic mail-answering program"
depends=(gdbm)
url="http://www.tosn.org/projects/vacation/"
source=(http://www.tosn.org/projects/vacation/files/$pkgname-$pkgver.tar.gz vacation.patch)

build() {
    cd $startdir/src/$pkgname
        mkdir -p $startdir/pkg/usr/{bin,man/man1}
        # keeps binary from building
        rm -rf vacation
    # fixing the Makefile - not only for arch64 
    sed -i -e 's: -m486::; s:CFLAGS.*= (.*):CFLAGS += 1:' $startdir/src/$pkgname/Makefile
    sed -i -e "s:/usr/bin:$startdir/pkg/usr/bin:g" $startdir/src/$pkgname/Makefile
    mv vacation.man vacation.1
    make install
}

These file have been created:

[andyrtr@workstation64 vacation]$ ls -lRA pkg/
pkg/:
insgesamt 0
drwxr-xr-x  4 andyrtr users 96 2006-01-28 09:32 usr

pkg/usr:
insgesamt 0
drwxr-xr-x  2 andyrtr users 96 2006-01-28 09:32 bin
drwxr-xr-x  3 andyrtr users 72 2006-01-28 09:32 man

pkg/usr/bin:
insgesamt 24
-rwxr-xr-x  1 andyrtr users 16864 2006-01-28 09:32 vacation
-rw-------  1 andyrtr users   470 2006-01-28 09:32 vaclook

pkg/usr/man:
insgesamt 0
drwxr-xr-x  2 andyrtr users 48 2006-01-28 09:32 man1

pkg/usr/man/man1:
insgesamt 0
[andyrtr@workstation64 vacation]$


I get this error:

==> Starting build()...
gcc -march=x86-64 -O2 -pipe  -Wall  -Xlinker -warn-common -D_PATH_VACATION="/var/abs/extra/system/vacation/pkg/usr/bin/vacation" -o vacation vacation.c -lgdbm
install -s -m 755 vacation /var/abs/extra/system/vacation/pkg/usr/bin/vacation
install -s -m 755 vaclook /var/abs/extra/system/vacation/pkg/usr/bin/vaclook
strip: /var/abs/extra/system/vacation/pkg/usr/bin/vaclook: File format not recognized
install: strip fehlgeschlagen
make: *** [install] Fehler 1
==> ERROR: Build Failed.  Aborting...

Krusader detects it as a Perl program. Any idea?

AndyRTR

Offline

#2 2006-01-28 09:45:29

mpie
Member
From: 404 Not found
Registered: 2005-03-06
Posts: 649

Re: How to prevent a file from stripping?

Posted: Sat Jan 28, 2006 8:45 am    Post subject: How to prevent a file from stripping?

--------------------------------------------------------------------------------

I'm building vacation for Arch64 but should be the same for 32bit. PKGBUILD looks like this:

Code:
# $Id: PKGBUILD,v 1.1 2004/01/21 15:43:15 dale Exp $
# Maintainer: dale <dale@archlinux.org>

pkgname=vacation
pkgver=1.2.6.1
pkgrel=1
pkgdesc="an automatic mail-answering program"
depends=(gdbm)
url="http://www.tosn.org/projects/vacation/"
source=(http://www.tosn.org/projects/vacation/files/$pkgname-$pkgver.tar.gz vacation.patch)

build() {
   cd $startdir/src/$pkgname
        mkdir -p $startdir/pkg/usr/{bin,man/man1}
        # keeps binary from building
        rm -rf vacation
   # fixing the Makefile - not only for arch64
   sed -i -e 's: -m486::; s:CFLAGS.*= (.*):CFLAGS += 1:' $startdir/src/$pkgname/Makefile
   sed -i -e "s:/usr/bin:$startdir/pkg/usr/bin:g" $startdir/src/$pkgname/Makefile
   mv vacation.man vacation.1
   make install
}

These file have been created:
Code:
[andyrtr@workstation64 vacation]$ ls -lRA pkg/
pkg/:
insgesamt 0
drwxr-xr-x  4 andyrtr users 96 2006-01-28 09:32 usr

pkg/usr:
insgesamt 0
drwxr-xr-x  2 andyrtr users 96 2006-01-28 09:32 bin
drwxr-xr-x  3 andyrtr users 72 2006-01-28 09:32 man

pkg/usr/bin:
insgesamt 24
-rwxr-xr-x  1 andyrtr users 16864 2006-01-28 09:32 vacation
-rw-------  1 andyrtr users   470 2006-01-28 09:32 vaclook

pkg/usr/man:
insgesamt 0
drwxr-xr-x  2 andyrtr users 48 2006-01-28 09:32 man1

pkg/usr/man/man1:
insgesamt 0
[andyrtr@workstation64 vacation]$

I get this error:

==> Starting build()...
gcc -march=x86-64 -O2 -pipe -Wall -Xlinker -warn-common -D_PATH_VACATION="/var/abs/extra/system/vacation/pkg/usr/bin/vacation" -o vacation vacation.c -lgdbm
install -s -m 755 vacation /var/abs/extra/system/vacation/pkg/usr/bin/vacation
install -s -m 755 vaclook /var/abs/extra/system/vacation/pkg/usr/bin/vaclook
strip: /var/abs/extra/system/vacation/pkg/usr/bin/vaclook: File format not recognized
install: strip fehlgeschlagen
make: *** [install] Fehler 1
==> ERROR: Build Failed. Aborting...

Looks like its tring to install to /var/abs/extra/system/vacation/pkg/usr/bin....... ????

try make DESTDIR=$startdir/pkg/usr install

Offline

#3 2006-01-28 11:30:51

AndyRTR
Developer
From: Magdeburg/Germany
Registered: 2005-10-07
Posts: 1,641

Re: How to prevent a file from stripping?

No changes :-(

Offline

#4 2006-01-28 12:11:17

mpie
Member
From: 404 Not found
Registered: 2005-03-06
Posts: 649

Re: How to prevent a file from stripping?

remove the sed line refering to usr/bin and try again

Offline

#5 2006-01-28 12:26:53

AndyRTR
Developer
From: Magdeburg/Germany
Registered: 2005-10-07
Posts: 1,641

Re: How to prevent a file from stripping?

:-(

I don't think it's related to the make install process. All files are at the right place. Post install the stripping fails. Should be something different

Offline

#6 2006-01-28 13:41:20

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: How to prevent a file from stripping?

'makepkg -n' prevents makepkg from stripping.

Offline

#7 2006-01-28 18:17:51

AndyRTR
Developer
From: Magdeburg/Germany
Registered: 2005-10-07
Posts: 1,641

Re: How to prevent a file from stripping?

Ok. I think I've solved it. It's not related to makepkg. That's why makepkg -n won't help here. It's an issue inside the Makefile. But good to know there's such an option ;-)

Thank you

So when the Makefile is quiet unusable I've dicided to install the files by hand and it's loking like this:

# $Id: PKGBUILD,v 1.1 2004/01/21 15:43:15 dale Exp $
# Maintainer: dale <dale@archlinux.org>

pkgname=vacation
pkgver=1.2.6.1
pkgrel=1
pkgdesc="an automatic mail-answering program"
depends=(gdbm)
url="http://www.tosn.org/projects/vacation/"
source=(http://www.tosn.org/projects/vacation/files/$pkgname-$pkgver.tar.gz)
md5sums=('0c14379b8fa09bea1a6a264330c7bd11')

build() {
    cd $startdir/src/$pkgname
    mkdir -p $startdir/pkg/usr/{bin,man/man1}
    make || return 1
    install -s -m 755 vacation     $startdir/pkg/usr/bin/vacation
    install -m 755 vaclook         $startdir/pkg/usr/bin/vaclook
    install -m 444 vacation.man    $startdir/pkg/usr/man/man1/vacation.1
    install -m 444 vaclook.man     $startdir/pkg/usr/man/man1/vaclook.1
}

Offline

Board footer

Powered by FluxBB