110.2. isync-1.5.1
mbsync — synchronises IMAP mailboxes with a local Maildir, XOAUTH2 included
| Version | 1.5.1, release 3 |
| Shelf | mail — Email clients, fetch and send tools, mail libraries, and feed readers |
| Phase | 41_system (System), 731 of 1047 in build order |
| Licence | GPL-2.0-or-later WITH LicenseRef-isync-GPL-exception |
| Homepage | https://isync.sourceforge.io/ |
| Build time | 0.2 SBU |
| Installed size | 366.5 KiB in 12 files |
| Recipe | ports/core/mail/isync/kpkgbuild |
About
isync is mbsync, which makes an IMAP mailbox and a local Maildir, ~/Mail, equal in both directions. It moves messages and does nothing else: notmuch indexes what it fetches, and msmtp sends. notmuch new runs it from the pre-new hook in /etc/skel/.config/notmuch/default/hooks and then indexes what it left, so one command fetches and files. The templates in /etc/skel, .mbsyncrc and notmuch’s config, name the same Maildir root, ~/Mail.
Why it is in KDOS
The comment above it in script/phases/41_system/packages.d/mail.txt:
THE WRITER notmuch indexes after. mbsync makes an IMAP mailbox and ~/Mail equal in both directions and indexes nothing, which is why
notmuch newruns it from a pre-new hook and then indexes what it left: one command fetches and files, and nothing has to remember the order. XOAUTH2 is reached through cyrus-sasl and cyrus-sasl-xoauth2; OAUTHBEARER is not, and is aerc's.
Sources
isync-1.5.1.tar.gz(316.8 KiB)
sha25628cc90288036aa5b6f5307bfc7178a397799003b96f7fd6e4bd2478265bb22fa
upstream: https://downloads.sourceforge.net/project/isync/isync/1.5.1/isync-1.5.1.tar.gz
archive copy: sources-3/mail--isync-1.5.1.tar.gz
Dependencies
Depends on: openssl, zlib, pkgconf, perl, cyrus-sasl, cyrus-sasl-xoauth2.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
openssl4.patch— reads a certificate’sdNSNamethroughASN1_STRING_get0_data()andASN1_STRING_length()inverify_hostname()instead of the structure’sdataandlengthfields, which OpenSSL 4 makes opaque; the compatibility block mapsASN1_STRING_get0_data()ontoASN1_STRING_data()for the older libraries it already covers.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install isync'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/mail/isync.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/mail/isync
echo '28cc90288036aa5b6f5307bfc7178a397799003b96f7fd6e4bd2478265bb22fa isync-1.5.1.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/isync
SRC=$SRC_ROOT/isync-1.5.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf isync-1.5.1.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/openssl4.patch"
./configure ac_cv_berkdb4=no \
--prefix=/usr \
--sysconfdir=/etc \
--with-ssl \
--with-zlib \
--with-sasl
make
make DESTDIR=$PKG install
The switches, and why each is set:
ac_cv_berkdb4=no— Answer the Berkeley DB check in advance with “no”. The configure script links-ldbwhenever a test program callingdb_createlinks, with no switch to refuse it, and the db port exists, so without the answer the result would depend on whether db happened to be built first. With it,mdconvert, the converter between Maildir UID storage schemes, is not built, and the Maildir driver keeps only its native scheme, the UID in each message’s file name.--with-ssl— Build TLS support against OpenSSL.--with-zlib— Build IMAPCOMPRESS=DEFLATEsupport.--with-sasl— Authenticate through Cyrus SASL, which takes whatever mechanism a plugin under/usr/lib/sasl2provides. Cyrus SASL itself has no XOAUTH2; cyrus-sasl-xoauth2 is the plugin that carries it, and both are independs. The plugin sends the account’s password as the bearer token, soAuthMechs XOAUTH2besidePassCmd "pizauth show <account>"is the whole of an OAuth2 setup with pizauth. OAUTHBEARER has no plugin here.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/isync, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf isync-1.5.1-3.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/isync, and runs the triggers its paths call for.
Contents
Installed programs: mbsync, mbsync-get-cert.
Installed directories: /usr/share/doc/isync, /usr/share/licenses/isync.
Short descriptions
mbsync |
synchronize IMAP4 and Maildir mailboxes |
Notes
perl is a build dependency, not a convenience: configure stops with “perl not found” without it, and src/drv_proxy_gen.pl generates drv_proxy.inc at build time, which the release does not carry.