diff options
author | Chris Severance | 2020-05-20 16:07:35 -0400 |
---|---|---|
committer | Chris Severance | 2020-05-20 16:07:35 -0400 |
commit | aca2a1e493db73da6847f5da862da53c36872e85 (patch) | |
tree | 204863a03656aeadc76dba92452eb62ba443b0d4 | |
parent | e5fb758a8ae55ce53df1bed7d8fb98fbe976750e (diff) | |
download | aur-aca2a1e493db73da6847f5da862da53c36872e85.tar.gz |
autu: Update to 3.32-1 Add git functionality
-rw-r--r-- | PKGBUILD | 55 |
1 files changed, 47 insertions, 8 deletions
@@ -4,8 +4,9 @@ # Contributor: Patrick Burroughs (Celti) <celti@celti.name> pkgname='libreswan' -pkgver='3.32' -pkgrel='1' +#pkgname+='-git' +pkgver=3.32 +pkgrel=1 pkgdesc='IPsec implementation with IKEv1 and IKEv2 keying protocols' arch=('i686' 'x86_64') url='https://libreswan.org/' @@ -17,7 +18,7 @@ conflicts=('freeswan' 'openswan' 'strongswan' 'ipsec-tools') backup=('etc/ipsec.conf' 'etc/ipsec.secrets' 'etc/pam.d/pluto') _srcdir="${pkgname}-${pkgver}" source=( - "https://download.libreswan.org/${pkgname}-${pkgver}.tar.gz" + "https://download.libreswan.org/${pkgname}-${pkgver%%.r*}.tar.gz" 'tmpfiles.conf' ) md5sums=('754519242e69e4ac516b0e172a127d9b' @@ -25,23 +26,61 @@ md5sums=('754519242e69e4ac516b0e172a127d9b' sha256sums=('236b57fee8f562302c54f2b16d8a839a9039fcb5893668e61b398ec6b179432e' '78265c690d58228c3bcc1a8793456172c39d493d268e9d9b1816288d0a47f573') +if [ "${pkgname%-git}" != "${pkgname}" ]; then + _srcdir="${pkgname}" + source[0]="${_srcdir}::git://github.com/libreswan/libreswan.git" + #source[0]+="#branch=release-${pkgver%%.r*}" + makedepends+=('git') + md5sums[0]='SKIP' + sha256sums[0]='SKIP' + provides=("${pkgname%-*}=${pkgver%%.r*}") + conflicts=("${pkgname%-*}") +pkgver() { + set -u + cd "${_srcdir}" + git describe --long | sed -e 's/\([^-]*-g\)/r\1/' -e 's/-/./g' -e 's:^v::g' + set +u +} +elif [ "${pkgver%%.r*}" != "${pkgver}" ]; then +pkgver() { + printf '%s' "${pkgver%.r*}" +} +fi + _bargs=( - USE_XAUTH=true USE_LIBCAP_NG=true USE_LEAK_DETECTIVE=false USE_LABELED_IPSEC=false USE_DNSSEC=false - INC_USRLOCAL=/usr INC_MANDIR=share/man - FINALSBINDIR=/usr/bin FINALLIBEXECDIR=/usr/lib/ipsec + USE_XAUTH=true + USE_LIBCAP_NG=true + USE_LEAK_DETECTIVE=false + USE_LABELED_IPSEC=false + USE_DNSSEC=false + INC_USRLOCAL='/usr' # required by 3.32 for /usr/share/doc + PREFIX='/usr' + #INC_MANDIR='/usr/share/man' + FINALMANDIR='/usr/share/man' + FINALSBINDIR='/usr/bin' + FINALLIBEXECDIR='/usr/lib/ipsec' ) build() { cd "${_srcdir}" + + local _nproc="$(nproc)" + if [ "${_nproc}" -gt 8 ]; then + _nproc=8 + fi + if [ -z "${MAKEFLAGS:=}" ] || [ "${MAKEFLAGS//-j/}" = "${MAKEFLAGS}" ]; then + MAKEFLAGS+="-j${_nproc}" + fi + # Disable new warning introduced with GCC 6 (-Wunused-const-variable=) CFLAGS="$CFLAGS -Wno-error=sign-compare -Wno-error=unused-const-variable -Wno-error=implicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=pointer-compare -Wno-error=format-truncation" \ - make -s "${_bargs[@]}" programs + nice make -s "${_bargs[@]}" programs } package() { cd "${_srcdir}" - make DESTDIR="${pkgdir}/" "${_bargs[@]}" install + make -j1 DESTDIR="${pkgdir}/" "${_bargs[@]}" install sed -e '1s|python|python2|' -i "${pkgdir}/usr/lib/ipsec/verify" install -Dpm644 "${srcdir}/tmpfiles.conf" "${pkgdir}/usr/lib/tmpfiles.d/libreswan.conf" |