From 88c47013c41cd8a510bc55870080291097559b52 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 5 Apr 2023 07:32:06 -0300 Subject: [PATCH] Implementing mingw package. --- PKGBUILD.mingw | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ gitsync.sh | 34 ---------------------------------- pushtag.sh | 34 ---------------------------------- win/PKGBUILD | 51 --------------------------------------------------- win/ci-build.sh | 39 +++++++++++++++++++++++++++++---------- 5 files changed, 96 insertions(+), 129 deletions(-) create mode 100644 PKGBUILD.mingw delete mode 100755 gitsync.sh delete mode 100755 pushtag.sh delete mode 100644 win/PKGBUILD diff --git a/PKGBUILD.mingw b/PKGBUILD.mingw new file mode 100644 index 0000000..265df1b --- /dev/null +++ b/PKGBUILD.mingw @@ -0,0 +1,67 @@ +# Maintainer: Perry Werneck +# References: https://www.msys2.org/wiki/Creating-Packages/ + +# SPDX-License-Identifier: LGPL-3.0-or-later +# +# Copyright (C) 2008 Banco do Brasil S.A. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . + +_realname=lib3270 + +pkgname=${MINGW_PACKAGE_PREFIX}-${_realname} +source=(git+https://github.com/PerryWerneck/lib3270#branch=develop) + +#pkgver() { +# cd ${srcdir}/${_realname} +# git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +#} + +pkgver=5.4 +pkgrel=1 +pkgdesc="TN3270 Access library" +url="https://github.com/PerryWerneck/${_realname}" +arch=(i686 x86_64) +license=(LGPL-3.0-or-later) +depends=(${MINGW_PACKAGE_PREFIX}-openssl) +makedepends=(autoconf automake make libtool gzip dos2unix ${MINGW_PACKAGE_PREFIX}-openssl) +checkdepends=() + +provides=($pkgname) +conflicts=($pkgname) + +prepare() { + rm -fr "$srcdir/$pkgname" + ln -snf "$startdir" "$srcdir/$pkgname" +} + +build() { + cd $pkgname + ./autogen.sh \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} + + make all +} + +package() { + cd $pkgname + make DESTDIR="${pkgdir}" install + install \ + -Dm644 \ + "LICENSE" \ + "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" +} diff --git a/gitsync.sh b/gitsync.sh deleted file mode 100755 index 3d89d0a..0000000 --- a/gitsync.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# -# https://help.github.com/articles/syncing-a-fork/ -# -# https://help.github.com/articles/configuring-a-remote-for-a-fork/ -# -# https://www.opentechguides.com/how-to/article/git/177/git-sync-repos.html -# -# Setup: -# -# git remote add github https://github.com/PerryWerneck/lib3270.git -# -# - -git push - -git fetch origin -git merge - -REPOS=$(git remote -v | grep -v origin | grep "(push)" | awk '{print $1}') - -for repo in ${REPOS} -do - echo "Getting updates from ${repo} ..." - git fetch ${repo} - git merge -done - -for repo in ${REPOS} -do - echo "Updating ${repo} ..." - git push ${repo} -done - diff --git a/pushtag.sh b/pushtag.sh deleted file mode 100755 index e0c06bd..0000000 --- a/pushtag.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# -# https://help.github.com/articles/syncing-a-fork/ -# -# https://help.github.com/articles/configuring-a-remote-for-a-fork/ -# -# https://www.opentechguides.com/how-to/article/git/177/git-sync-repos.html -# -# Setup: -# -# git remote add github https://github.com/PerryWerneck/lib3270.git -# -# - -if [ -z ${1} ]; then - echo "Inform target tag" - exit -1 -fi - -git push - -git fetch origin -#git checkout master -#git merge origin/master - -git tag -f ${1} -git push -f --tags - -for repo in $(git remote -v | grep -v origin | grep "(push)" | awk '{print $1}') -do - echo "Updating ${repo} ..." - git push ${repo} -f --tags -done - diff --git a/win/PKGBUILD b/win/PKGBUILD deleted file mode 100644 index bf5bf13..0000000 --- a/win/PKGBUILD +++ /dev/null @@ -1,51 +0,0 @@ -# Maintainer: Perry Werneck -# References: https://www.msys2.org/wiki/Creating-Packages/ - -_realname=lib3270 -pkgname=${MINGW_PACKAGE_PREFIX}-${_realname} -source=(git+https://github.com/PerryWerneck/lib3270#branch=develop) - -#pkgver() { -# cd ${srcdir}/${_realname} -# git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g' -#} - -pkgver=5.4 -pkgrel=1 -pkgdesc="TN3270 Access library" -url="https://github.com/PerryWerneck/lib3270" -arch=(i686 x86_64) -license=(GPL) -depends=(openssl) -makedepends=(autoconf automake make libtool gzip ${MINGW_PACKAGE_PREFIX}-openssl) -checkdepends=() - -sha256sums=('SKIP') - -provides=($pkgname) -conflicts=($pkgname) - -prepare() { - cd ${srcdir}/${_realname} -} - -build() { - rm -fr "${srcdir}/build-${CARCH}" - mkdir -p "${srcdir}/build-${CARCH}" - cd "${srcdir}/build-${CARCH}" - ${srcdir}/${_realname}/autogen.sh \ - --prefix=${MINGW_PREFIX} \ - --build=${MINGW_CHOST} \ - --host=${MINGW_CHOST} \ - --target=${MINGW_CHOST} - - make all -} - -package() { - cd "${srcdir}/build-${CARCH}" - make DESTDIR="${pkgdir}" install - install -Dm644 "${srcdir}/${_realname}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" -} - - diff --git a/win/ci-build.sh b/win/ci-build.sh index 1d5bd5f..ed7005a 100755 --- a/win/ci-build.sh +++ b/win/ci-build.sh @@ -1,10 +1,28 @@ #!/bin/bash # +# SPDX-License-Identifier: LGPL-3.0-or-later +# +# Copyright (C) 2008 Banco do Brasil S.A. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . + +# # References: # # * https://www.msys2.org/docs/ci/ # -# + echo "Running ${0}" LOGFILE=build.log @@ -19,16 +37,17 @@ die ( ) { cd $(dirname $(dirname $(readlink -f ${0}))) # -# Build LIB3270 +# Install pre-reqs # -echo "Building lib3270" -./autogen.sh > $LOGFILE 2>&1 || die "Autogen failure" -./configure > $LOGFILE 2>&1 || die "Configure failure" -make clean > $LOGFILE 2>&1 || die "Make clean failure" -make all > $LOGFILE 2>&1 || die "Make failure" -make DESTDIR=.bin/package install +#echo "Installing pre-reqs..." +#pacman -U --noconfirm *.pkg.tar.zst || die "pacman failure" -tar --create --xz --file=${MINGW_PACKAGE_PREFIX}-lib3270.tar.xz --directory=.bin/package --verbose . - +# +# Build +# +echo "Building package..." +dos2unix PKGBUILD.mingw || die "dos2unix failure" +makepkg BUILDDIR=/tmp/pkg -p PKGBUILD.mingw || die "makepkg failure" +echo "Build complete" -- libgit2 0.21.2