update qemu version
[slackbuilds.git] / aerc / aerc.SlackBuild
blobb8c476dec580624fc0bcc1128cf04ce1ec9b86fa
1 #!/bin/bash
3 # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
4 # Version 2, December 2004
6 # Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
8 # Everyone is permitted to copy and distribute verbatim or modified
9 # copies of this license document, and changing it is allowed as long
10 # as the name is changed.
12 # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
13 # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
16 # 0. You just DO WHAT THE FUCK YOU WANT TO.
18 # SlackBuild script for aerc
19 # ===========================
20 # By: r1w1s1 (https://fosstodon.org/@r1w1s1)
21 # For: aerc
22 # Descr: aerc is an email client that runs in your terminal
23 # URL: https://aerc-mail.org/
24 # Changelog:
25 # v0.17.0: 29/june/2024 by r1w1s1 - Initial build.
26 # v0.18.0: 02/july/2024 by r1w1s1
28 cd $(dirname $0) ; CWD=$(pwd)
30 PRGNAM=aerc
31 VERSION=${VERSION:-0.18.0}
32 BUILD=${BUILD:-1}
33 TAG=${TAG:-_SBo}
34 ARCH=${ARCH:-x86_64}
36 TMP=${TMP:-/tmp/SBo}
37 PKG=${TMP}/package-${PRGNAM}
38 PKGTYPE=${PKGTYPE:-tgz}
39 OUTPUT=${OUTPUT:-/tmp}
41 # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
42 # the name of the created package would be, and then exit. This information
43 # could be useful to other scripts.
44 if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
45 echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
46 exit 0
49 # Clean up any previous build artifacts
50 rm -rf "$PKG"
51 mkdir -p "$TMP" "$PKG" "$OUTPUT"
52 cd "$TMP"
54 # Download and extract the source code
55 rm -rf "${PRGNAM}-${VERSION}"
56 wget -O "${PRGNAM}-${VERSION}.tar.gz" "https://git.sr.ht/~rjarry/aerc/archive/${VERSION}.tar.gz"
57 tar xvf "${PRGNAM}-${VERSION}.tar.gz"
58 cd "${PRGNAM}-${VERSION}"
60 # Compile the source
61 make PREFIX=/usr
63 # Install the compiled binaries to the package directory
64 make install PREFIX=/usr DESTDIR="$PKG"
66 # Copy documentation
67 mkdir -p "$PKG/usr/doc/${PRGNAM}-${VERSION}"
68 cp -a CHANGELOG.md CONTRIBUTING.md README.md LICENSE MAINTAINERS \
69 "$PKG/usr/doc/${PRGNAM}-${VERSION}"
71 # Compress man pages and fix symlinks
72 find "$PKG/usr/share/man" -type f -exec gzip -9 {} \;
73 for i in $(find "$PKG/usr/man" -type l); do
74 ln -s "$(readlink "$i").gz" "$i.gz"
75 rm "$i"
76 done
78 # Copy the SlackBuild script into the package documentation
79 cat "$CWD/${PRGNAM}.SlackBuild" > "$PKG/usr/doc/${PRGNAM}-${VERSION}/${PRGNAM}.SlackBuild"
81 # Copy the slack-desc file
82 mkdir -p "$PKG/install"
83 cat "$CWD/slack-desc" > "$PKG/install/slack-desc"
85 # Create the package
86 cd "$PKG"
87 /sbin/makepkg -l y -c n "$OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE}"
89 # Generate MD5 checksum
90 cd "$OUTPUT"
91 md5sum "${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE}" > "${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE}.md5"