You are not logged in.

#1 2018-11-27 11:15:52

turbopollux
Member
Registered: 2016-01-19
Posts: 11

How to make package in PKGBUILD?

Hello everyone! I wanna to make package using PKGBUILD

What i have? I have some tgz arch and i just wanna to repack it
It archive have many rpms and i all it extraccted in pkg directory and in result i have folders /opt /usr etc

How i must add it to package?

My current pkgbuild file


# Maintainer: Roman Pastushkov <junglefromlondon@yandex.ru>
pkgname=CRYPTOPROCSP
pkgver=5.0
pkgrel=1
epoch=
pkgdesc="All in one CRYPTOPRO CSP 5.0 package"
arch=(x86_64)
url=""
license=('')
groups=()
depends=()
makedepends=()
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=(#"linux-amd64.tgz"
      ) # "$pkgname-$pkgver.patch")
noextract=()
md5sums=()
validpgpkeys=()
prepare() {
    echo "Extracting";   
    cd ../
    tar xf linux-amd64.tgz
    cp extract.sh linux-amd64   
    cd linux-amd64   
    $PWD/extract.sh   

    #cd "$pkgname-$pkgver"
    #patch -p1 -i "$srcdir/$pkgname-$pkgver.patch"
    echo "==>Extract complete "
}

build() {
    echo $PWD
    echo "NOTHING TO BUILD!"
}

check() {
    echo $PWD
    echo "NOTHING TO CHECK!"
}

package() {
    echo "LEts package!"
    cd ../
    cp -R linux-amd64/* pkg
    echo "Copying files..."   
    #cd "$pkgname-$pkgver"    WHAT THIS MUST BE??????
}

When i run makepkg i got in result empty archive conaining only .buildinfo .mtree and pkginfo files but nothing from pkg directory

Offline

#2 2018-11-27 12:08:02

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: How to make package in PKGBUILD?

turbopollux wrote:

When i run makepkg i got in result empty archive conaining only .buildinfo .mtree and pkginfo files but nothing from pkg directory

Was there anything in pkg/CRYPTOPROCSP for makepkg to package?
Please also use code tags.
Looking at the PKGBUILD please remove unused variables,  use the sources array work inside $srcdir and $pkgdir.

Offline

#3 2018-11-27 17:27:41

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: How to make package in PKGBUILD?

This PKGBUILD is wrong in every possible respect, and contains absolutely nothing that can be recycled into a new PKGBUILD.

Please start over completely from scratch, but this time follow the instructions from https://wiki.archlinux.org/index.php/Creating_packages


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#4 2018-11-27 17:48:54

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: How to make package in PKGBUILD?

I don't know about that, the pkgver, pkgrel, and arch may be fine. That's about it, though.

turbopollux, start with understanding what $srcdir and $pkgdir are, as well as what a URL is.

Last edited by Scimmia (2018-11-27 17:51:25)

Offline

#5 2018-11-28 06:15:48

turbopollux
Member
Registered: 2016-01-19
Posts: 11

Re: How to make package in PKGBUILD?

https://wiki.archlinux.org/index.php/Creating_packages in this link about building from sources. This preapare() build() etc

I just wanna to package raw ready binaries. I just have it in folders /usr/bin /opt /etc  in pkg directory

make DESTDIR="$pkgdir/" install  not works cause i havenot makefile

Whewre i can read about packaging from ready binaries? Skipping downloading sources patches bulding etc?

Offline

#6 2018-11-28 15:45:57

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: How to make package in PKGBUILD?

Look for packages with a -bin suffix, those usually install binary stuff adjusted to work on archlinux .

Normally skipping downloads is frowned upon, but there is some software where this is the only way.

In source array you can use local::/   for files that should never be downloaded but be present locally.

Last edited by Lone_Wolf (2018-11-28 15:46:47)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB