#5 Update to 0.17.0 and refactor.
Merged 3 months ago by gotmax23. Opened 5 months ago by gotmax23.
rpms/ gotmax23/aerc 0.16.0  into  rawhide

file modified
+4
@@ -7,3 +7,7 @@ 

  /aerc-0.13.0.tar.gz

  /aerc-0.14.0.tar.gz

  /aerc-0.15.2.tar.gz

+ /aerc-0.16.0.tar.gz

+ /aerc-0.16.0-vendor.tar.gz

+ /aerc-0.17.0.tar.gz

+ /aerc-0.17.0-vendor.tar.gz

@@ -0,0 +1,55 @@ 

+ ./LICENSE: MIT

+ ./vendor/git.sr.ht/~rjarry/go-opt/LICENSE: MIT

+ ./vendor/git.sr.ht/~rockorager/go-jmap/LICENSE: MIT

+ ./vendor/git.sr.ht/~rockorager/tcell-term/LICENSE: MIT

+ ./vendor/github.com/ProtonMail/go-crypto/LICENSE: BSD-3-Clause

+ ./vendor/github.com/arran4/golang-ical/LICENSE: Apache-2.0

+ ./vendor/github.com/creack/pty/LICENSE: MIT

+ ./vendor/github.com/danwakefield/fnmatch/LICENSE: BSD-2-Clause

+ ./vendor/github.com/davecgh/go-spew/LICENSE: ISC

+ ./vendor/github.com/emersion/go-imap-sortthread/LICENSE: MIT

+ ./vendor/github.com/emersion/go-imap/LICENSE: MIT

+ ./vendor/github.com/emersion/go-maildir/LICENSE: MIT

+ ./vendor/github.com/emersion/go-mbox/LICENSE: MIT

+ ./vendor/github.com/emersion/go-message/LICENSE: MIT

+ ./vendor/github.com/emersion/go-msgauth/LICENSE: MIT

+ ./vendor/github.com/emersion/go-pgpmail/LICENSE: MIT

+ ./vendor/github.com/emersion/go-sasl/LICENSE: MIT

+ ./vendor/github.com/emersion/go-smtp/LICENSE: MIT

+ ./vendor/github.com/emersion/go-textwrapper/LICENSE: MIT

+ ./vendor/github.com/fsnotify/fsevents/LICENSE: BSD-3-Clause

+ ./vendor/github.com/fsnotify/fsnotify/LICENSE: BSD-3-Clause

+ ./vendor/github.com/gatherstars-com/jwz/LICENSE: Apache-2.0

+ ./vendor/github.com/gdamore/encoding/LICENSE: Apache-2.0

+ ./vendor/github.com/gdamore/tcell/v2/LICENSE: Apache-2.0

+ ./vendor/github.com/go-ini/ini/LICENSE: Apache-2.0

+ ./vendor/github.com/golang/protobuf/LICENSE: BSD-3-Clause

+ ./vendor/github.com/golang/snappy/LICENSE: BSD-3-Clause

+ ./vendor/github.com/lithammer/fuzzysearch/LICENSE: MIT

+ ./vendor/github.com/lucasb-eyer/go-colorful/LICENSE: MIT

+ ./vendor/github.com/mattn/go-isatty/LICENSE: MIT

+ ./vendor/github.com/mattn/go-runewidth/LICENSE: MIT

+ ./vendor/github.com/pkg/errors/LICENSE: BSD-2-Clause

+ ./vendor/github.com/pmezard/go-difflib/LICENSE: BSD-3-Clause

+ ./vendor/github.com/rivo/uniseg/LICENSE.txt: MIT

+ ./vendor/github.com/riywo/loginshell/LICENSE: MIT

+ ./vendor/github.com/stretchr/testify/LICENSE: MIT

+ ./vendor/github.com/syndtr/goleveldb/LICENSE: BSD-2-Clause

+ ./vendor/github.com/xo/terminfo/LICENSE: MIT

+ ./vendor/golang.org/x/crypto/LICENSE: BSD-3-Clause

+ ./vendor/golang.org/x/mod/LICENSE: BSD-3-Clause

+ ./vendor/golang.org/x/net/LICENSE: BSD-3-Clause

+ ./vendor/golang.org/x/oauth2/LICENSE: BSD-3-Clause

+ ./vendor/golang.org/x/sys/LICENSE: BSD-3-Clause

+ ./vendor/golang.org/x/term/LICENSE: BSD-3-Clause

+ ./vendor/golang.org/x/text/LICENSE: BSD-3-Clause

+ ./vendor/golang.org/x/tools/LICENSE: BSD-3-Clause

+ ./vendor/google.golang.org/appengine/LICENSE: Apache-2.0

+ ./vendor/google.golang.org/protobuf/LICENSE: BSD-3-Clause

+ 

+ The following license files were found but the correct license identifier couldn't be determined.

+ ./vendor/github.com/cloudflare/circl/LICENSE (MANUALLY DETECTED as BSD-3-Clause)

+ ./vendor/gopkg.in/yaml.v3/LICENSE (MANUALLY DETECTED as Apache-2.0 AND MIT)

+ 

+ Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT

+ 

file modified
+42 -32
@@ -1,35 +1,41 @@ 

  # Generated by go2rpm 1.6.0

- %bcond_without check

+ %bcond check 1

+ # aerc has a lot of dependencies and is picky about them. Upstream does a good

+ # job at keeping them updated. aerc is prone to crashes with Fedora's

+ # dependency versions, many of which are out of date

+ %bcond vendor 1

  

  # https://git.sr.ht/~rjarry/aerc

  %global goipath         git.sr.ht/~rjarry/aerc

- Version:                0.15.2

- %global topdir          %{name}-%{version}

+ %global version0        0.17.0

  

  %gometa

  

  %global common_description %{expand:

- Aerc is an email client that runs in your terminal. It's highly

+ Aerc is an email client that runs in your terminal. It is highly

  efficient and extensible, perfect for the discerning hacker.}

  

- %global golicenses      LICENSE

- %global godocs          doc README.md

- 

  Name:           aerc

+ Version:        %{forgeversion}

  Release:        %autorelease

  Summary:        Email client for your terminal

  

- License:        MIT

+ SourceLicense:  MIT

+ # See LICENSES.dependencies

+ License:        MIT AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC

  URL:            %{gourl}

- # The forge macros don't support Sourcehut.

- # https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/209

- Source:         %{gourl}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz

+ Source0         %{forgesource}

+ Source1:        aerc-%{version}-vendor.tar.gz

+ # https://git.sr.ht/~gotmax23/fedora-scripts/tree/main/item/go-sig/go_vendor_licenses.py

+ Source2:        LICENSES.dependencies

  

- BuildRequires:  scdoc

  BuildRequires:  desktop-file-utils

+ # wrap and colorize filters are written in C

+ BuildRequires:  gcc

+ BuildRequires:  glibc-all-langpacks

  BuildRequires:  gnupg

  BuildRequires:  notmuch-devel

- BuildRequires:  gcc

+ BuildRequires:  scdoc

  

  Requires:       notmuch

  
@@ -37,36 +43,37 @@ 

  %{common_description}

  

  %prep

- %goprep

- %autopatch -p1

- 

- # Disable building of aerc that we handle manually in the SPEC and

- # preserve mtimes

- sed -e 's|install: $(DOCS) aerc wrap|install: $(DOCS)|' \

-     -e 's|install -m|install -pm|' \

-     -i Makefile

+ %autosetup -p1 %{forgesetupargs} %{?with_vendor:-b1}

+ %goprep -e %{?with_vendor:-k}

+ cp %{SOURCE2} .

  

+ %if %{without vendor}

  # From go.mod replace statements:

  # replace golang.org/x/crypto => github.com/ProtonMail/go-crypto v0.0.0-20200420072808-71bec3603bf3

- # replace github.com/zenhack/go.notmuch => github.com/brunnre8/go.notmuch v0.0.0-20201126061756-caa2daf7093c

  sed -i "s|golang.org/x/crypto|github.com/ProtonMail/go-crypto|" $(find . -name "*.go" -type f)

- sed -i "s|github.com/zenhack/go.notmuch|github.com/brunnre8/go.notmuch|" $(find . -name "*.go" -type f)

+ %endif

  

  %generate_buildrequires

+ %if %{without vendor}

  %go_generate_buildrequires

- echo 'golang(github.com/brunnre8/go.notmuch)'

+ %endif

  

  %build

- %set_build_flags

- make wrap colorize

  export BUILDTAGS=notmuch

- export LDFLAGS="-X main.Version=%{version} \

-                 -X main.Prefix=%{_prefix} \

-                 -X main.Flags=$(echo -- $(GOFLAGS) | base64 | tr -d '\r\n') \

-                 -X git.sr.ht/~rjarry/aerc/config.shareDir=%{_datadir} \

-                 -X git.sr.ht/~rjarry/aerc/config.libexecDir=%{_libexecdir}"

+ export LDFLAGS="\

+     -X main.Version=%{version} \

+     -X main.Date="$(date -d "@${SOURCE_DATE_EPOCH}" +%Y-%m-%d)" \

+     -X git.sr.ht/~rjarry/aerc/config.shareDir=%{_datadir} \

+     -X git.sr.ht/~rjarry/aerc/config.libexecDir=%{_libexecdir} \

+     "

  %gobuild -o aerc %{goipath}

  

+ # The go macros interfere with C build flags.

+ # Reset LDFLAGS and set other missing build flags.

+ unset LDFLAGS

+ %set_build_flags

+ %make_build wrap colorize doc

+ 

  %install

  export PREFIX=%{_prefix}

  %make_install
@@ -74,17 +81,20 @@ 

  

  %if %{with check}

  %check

+ LANG=en_US.UTF-8 ./filters/test.sh

  %gocheck

  %endif

  

  %files

- %license LICENSE

+ %license LICENSE %{?with_vendor:vendor/modules.txt LICENSES.dependencies}

  %doc doc README.md

  %{_bindir}/aerc

+ %{_bindir}/carddav-query

  %{_datadir}/aerc/

  %{_datadir}/applications/aerc.desktop

  %{_libexecdir}/aerc/

  %{_mandir}/man1/aerc-*.1.*

+ %{_mandir}/man1/carddav-query.1*

  %{_mandir}/man1/aerc.1*

  %{_mandir}/man5/aerc-*.5.*

  %{_mandir}/man7/aerc-*.7.*

file added
+47
@@ -0,0 +1,47 @@ 

+ #!/usr/bin/bash -x

+ 

+ set -euo pipefail

+ 

+ NAME="aerc"

+ googlestuff="true"

+ 

+ usage() {

+     echo "./mkvendor.sh [-n (disable proxy and sumbdb)] VERSION"

+     if [ -n "${1-}" ]; then

+         exit "${1}"

+     fi

+ }

+ 

+ do_env() {

+     if [ "${googlestuff}" = "true" ]; then

+         GOPROXY=https://proxy.golang.org,direct

+         GOSUMDB=sum.golang.org

+         export GOPROXY GOSUMDB

+     fi

+ }

+ 

+ 

+ while getopts "-nh" OPT; do

+     case "${OPT}" in

+         n)

+             googlestuff=""

+             ;;

+         h)

+             usage 0

+             ;;

+         *)

+             usage 1

+             ;;

+     esac

+ done

+ shift "$((OPTIND-1))"

+ version="${1}" || usage 1

+ 

+ 

+ rm -rf "${NAME}-${version}/"

+ tar xf "${NAME}-${version}.tar.gz"

+ cd "${NAME}-${version}"

+ do_env

+ go mod vendor

+ cd -

+ tar czf "${NAME}-${version}-vendor.tar.gz" "${NAME}-${version}/vendor"

file modified
+2 -1
@@ -1,1 +1,2 @@ 

- SHA512 (aerc-0.15.2.tar.gz) = 8744c6c5ea45fc8ad2ab46367e92d3859fab962843db4329c7655b0afe7b72dbea21dae588d44eab314a31da89d15e5b6543224699556aed31e0b3b9c7b0ddbc

+ SHA512 (aerc-0.17.0.tar.gz) = 6648123c37da36f932825e7caec268765bf285124a4473055b86ac48cfa937a250b03d2404764c2c93a978bb56dc9279550e5bf66aa0ff09f90525c5ead7c062

+ SHA512 (aerc-0.17.0-vendor.tar.gz) = b9b479c0f6fac1cdf48df5ab9591409dcfc042e99be44f4c1178202572f90ada0b2ef9dbe675392f95e0aef3e19221bb87ad4f419d42ff8badecc3d3761b68dc

no initial comment

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/32bf86721d5941189f173ecde234927f

1 new commit added

  • Update to 0.17.0. Fixes rhbz#2241065.
3 months ago

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/126345de316a46f9996c76a178d82b2d

2 new commits added

  • Take advantage of new forge macros features
  • Attempt to account for licenses of vendored components
3 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/f271ade893594f6686ce88b87ab0b83a

I think I see the failure. I'll fix it later.

13 new commits added

  • Remove outdated seds
  • Take advantage of new forge macros features
  • Attempt to account for licenses of vendored components
  • Update to 0.17.0. Fixes rhbz#2241065.
  • Use modern %bcond syntax
  • Build with vendored dependencies by default
  • Remove unnecessary %golicenses and %godocs definitions
  • Remove contraction from %description
  • Run tests for filters
  • Reformat LDFLAGS and remove invalid main.Flags
  • Build contrib filters after the main application
  • Sort BuildRequires
  • Update to 0.16.0. Fixes rhbz#2241065.
3 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/65434ccb1b9e450ab5987ce9b918b758

rebased onto 7f775d5

3 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/fb3e33a5fd614cf785feb233c9c9f801

Zuul is failing, because it has some old version of the forge macros. That can be safely ignored. Other than that, everything is green now :tada:.

There are some changes I've never seen before, I would like to understand them better. I'm not using any of these changes in opentofu or any other golang package and I wonder if I should.

  • Why set version0 and then use Version tag?
  • %global version0 0.17.0
  • Version: %{forgeversion}
  • Source1: aerc-%{version}-vendor.tar.gz
  • Where are forge* macros defined?
  • Version: %{forgeversion}
  • Source0 %{forgesource}
    %autosetup -p1 %{forgesetupargs} %{?with_vendor:-b1}
  • Are they required if more than one Source is defined?

This PR returns the numbered source files. These were removed from the go2rpm template some time ago:

https://pagure.io/GoSIG/go2rpm/c/f1768f75c9cc8c824385531ab6081d8199bb9e93

The %{forgeversion} thing is part of the new forge macros update. %{forgeversion} is set by %gometa macro (well, technically it's set by the forgemeta code that %gometa calls internally). It allows appending the snapshot information to Version: that used to be added to Release: so that it's possible to follow the new Versioning Guidelines. Right now, %{forgeversion} simply expands to %{version0}, but if we, for example, set the %commit macro to package a git snapshot, it would append that accordingly.

As for the source numbering part, I added them back, as %{SOURCE2} is explicitly referenced in %prep, so I wanted to avoid ambiguity and make sure that Source2 actually points to what I expect. As the commit message for that go2rpm change says:

The source numbers are not referenced anywhere in this specfile template, so there's no reason to keep them.

As for the autosetup part, I needed to be able to pass -b1 to the macro to unpack the vendor tarball which is something that %goprep does not support. %forgesetupargs is set by the gometa/forgemeta code along with %forgeversion. %goprep uses the %forgesetupargs macro internally, as well.

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/3b364314b1f54950bc584295fe509142

Pull-Request has been merged by gotmax23

3 months ago