You are not logged in.

#1 2014-05-25 09:30:03

lzlarryli
Member
Registered: 2014-05-25
Posts: 6

Is this PKGBUILD ok?

This is the first time I am submitting a package. So I want to make sure it is not messed up.
A game I am playing (Witcher 2 from Steam) needs the 32-bit version of libcurl-gnutls. There is no 32-bit multilib version of it in AUR. I did some minimal modification to the 32/64-bit native version in AUR:
https://aur.archlinux.org/packages/libcurl-gnutls/

The following PKGBUILD compiles, correctly generats a package, and installs. The game runs with it.
I did not touch the patches, so they are not included here.
Thanks~

(edited on May 25, 2014)

# based on Jose Riha <jose1711 gmail com> native package
# Maintainer: Larry Li <lzlarryli gmail com>

_pkgbasename=libcurl-gnutls
pkgname=lib32-$_pkgbasename
_pkgname=curl
_curlbuild=curlbuild-32.h
pkgver=7.32.0
pkgrel=1
pkgdesc="An URL retrieval utility and library"
arch=('i686' 'x86_64')
url="http://curl.haxx.se"
license=(custom)
makedepends=('gcc-multilib')
depends=('lib32-libssh2' 'lib32-gnutls')
options=('!libtool' '!strip')
source=("http://curl.haxx.se/download/$_pkgname-$pkgver.tar.gz"{,.asc}
        curlbuild.h
        01_runtests_gdb.patch
        02_art_http_scripting.patch
        03_keep_symbols_compat.patch
        04_workaround_as_needed_bug.patch
        06_always-disable-valgrind.patch
        07_do-not-disable-debug-symbols.patch
        90_gnutls.patch
        99_nss.patch)

md5sums=('f77cf3cb59cf2bfe686b80338323fd40'
         'SKIP'
         '751bd433ede935c8fae727377625a8ae'
         '7ad5ff89674f5f08b232064c515767ce'
         '5cadcf82367cef12738fc3b0ef27483f'
         '955b12e575215735b6bd563ee2e3af2a'
         'fd110c854e055d0375798c2857bd260e'
         '798ec0e687d6193f1fa537f82d2b132f'
         'eb393f4dcd524916372c6bdd66c78c0b'
         '85ca09852fb72376c444ac8dea0da3d2'
         '2e71a1e566212e28f0a9756b3366900d')

prepare() {
  cd "$_pkgname-$pkgver"
  # apply debian patches
  for i in ../*patch
	do
	patch -p1 < "$i"
	done
}

build() {
  cd "$_pkgname-$pkgver"
  export CC="gcc -m32"
  export CXX="g++ -m32"
  export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
  ./configure \
      --libdir=/usr/lib32 \
      --prefix=/usr \
      --mandir=/usr/share/man \
      --disable-dependency-tracking \
      --enable-versioned-symbols \
      --disable-ldap \
      --disable-ldaps \
      --enable-ipv6 \
      --enable-manual \
      --enable-threaded-resolver \
      --without-libidn \
      --with-random=/dev/urandom \
      --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
      --without-ssl \
      --with-gnutls=/usr
  make
}

package() {
  install -Dm644 $srcdir/$_pkgname-$pkgver/lib/.libs/libcurl.so.4.3.0 $pkgdir/usr/lib32/libcurl-gnutls.so.4.3.0
  ln -s libcurl-gnutls.so.4.3.0 $pkgdir/usr/lib32/libcurl-gnutls.so.4

  install -D -m644 $srcdir/$_pkgname-$pkgver/docs/LICENSE-MIXING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

Last edited by lzlarryli (2014-05-25 19:45:57)

Offline

#2 2014-05-25 09:33:59

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Is this PKGBUILD ok?

It's called a PKGBUILD. Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Fo … s_and_Code


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-05-25 09:39:20

lzlarryli
Member
Registered: 2014-05-25
Posts: 6

Re: Is this PKGBUILD ok?

Thank you for pointing that out. It is fixed~ The mind is not properly working at 4am.....

Offline

#4 2014-05-25 18:26:20

lzlarryli
Member
Registered: 2014-05-25
Posts: 6

Re: Is this PKGBUILD ok?

I made more changes to it. Now both PKGBUILD and the resulting package pass namcap, except for a missing cumstom license dir complaint, which the original PKGBUILD also has. The code license is MIT, is this a problem?

Offline

#5 2014-05-25 19:10:04

Stebalien
Member
Registered: 2010-04-27
Posts: 1,239
Website

Re: Is this PKGBUILD ok?

You need to include the MIT license file. Also, the patches should be applied in the `prepare` function.


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C

Offline

#6 2014-05-25 19:38:19

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,373
Website

Re: Is this PKGBUILD ok?

"ln -s libcurl-gnutls.so.4.3.0 $pkgdir/usr/lib32/libcurl-gnutls.so.3"

This line is (probably) not a good idea. If the library was backwards compatible, it wouldn't have undergone a soname bump in the first place. Ergo libcurl-gnutls.so.4 != libcurl-gnutls.so.3

However, I haven't looked into what the patches do, so if you know something that I don't, feel free to ignore this post.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#7 2014-05-25 19:38:36

lzlarryli
Member
Registered: 2014-05-25
Posts: 6

Re: Is this PKGBUILD ok?

@Stebalien, thanks~ I moved patching to prepare(). Also, I found that the package is actually covered by a mix of licenses. So I just used the license file supplied in the source as the license. Now namcap is completely happy.

Offline

#8 2014-05-25 19:45:40

lzlarryli
Member
Registered: 2014-05-25
Posts: 6

Re: Is this PKGBUILD ok?

@WorMzy, thanks as well. I just adapted the corresponding non-multilib package without looking too much into it last night. Now I had a closer look and I agree with you that that link looks strange. I removed it. The particular program I am running does not need it. My guess is that the non-multilib package had this because its maintainer needed it for the other package "algodoo" at that time.

Offline

Board footer

Powered by FluxBB