diff --git a/network/aerc/aerc.SlackBuild b/network/aerc/aerc.SlackBuild index b8c476dec5..de38ffe157 100644 --- a/network/aerc/aerc.SlackBuild +++ b/network/aerc/aerc.SlackBuild @@ -31,62 +31,71 @@ PRGNAM=aerc VERSION=${VERSION:-0.18.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} -ARCH=${ARCH:-x86_64} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +set -e TMP=${TMP:-/tmp/SBo} PKG=${TMP}/package-${PRGNAM} -PKGTYPE=${PKGTYPE:-tgz} OUTPUT=${OUTPUT:-/tmp} -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 fi -# Clean up any previous build artifacts rm -rf "$PKG" mkdir -p "$TMP" "$PKG" "$OUTPUT" cd "$TMP" -# Download and extract the source code -rm -rf "${PRGNAM}-${VERSION}" -wget -O "${PRGNAM}-${VERSION}.tar.gz" "https://git.sr.ht/~rjarry/aerc/archive/${VERSION}.tar.gz" -tar xvf "${PRGNAM}-${VERSION}.tar.gz" -cd "${PRGNAM}-${VERSION}" +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +elif [ "$ARCH" = "aarch64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi -# Compile the source +rm -rf ${PRGNAM}-${VERSION} +tar xvf $CWD/${PRGNAM}-${VERSION}.tar.gz || tar xvf $CWD/$VERSION.tar.gz +cd ${PRGNAM}-${VERSION} make PREFIX=/usr -# Install the compiled binaries to the package directory make install PREFIX=/usr DESTDIR="$PKG" -# Copy documentation +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + mkdir -p "$PKG/usr/doc/${PRGNAM}-${VERSION}" cp -a CHANGELOG.md CONTRIBUTING.md README.md LICENSE MAINTAINERS \ - "$PKG/usr/doc/${PRGNAM}-${VERSION}" + $PKG/usr/doc/${PRGNAM}-${VERSION} -# Compress man pages and fix symlinks -find "$PKG/usr/share/man" -type f -exec gzip -9 {} \; -for i in $(find "$PKG/usr/man" -type l); do - ln -s "$(readlink "$i").gz" "$i.gz" - rm "$i" -done +mv $PKG/usr/share/man $PKG/usr/ +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done -# Copy the SlackBuild script into the package documentation -cat "$CWD/${PRGNAM}.SlackBuild" > "$PKG/usr/doc/${PRGNAM}-${VERSION}/${PRGNAM}.SlackBuild" +cat $CWD/${PRGNAM}.SlackBuild > $PKG/usr/doc/${PRGNAM}-${VERSION}/${PRGNAM}.SlackBuild -# Copy the slack-desc file -mkdir -p "$PKG/install" -cat "$CWD/slack-desc" > "$PKG/install/slack-desc" - -# Create the package -cd "$PKG" -/sbin/makepkg -l y -c n "$OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE}" - -# Generate MD5 checksum -cd "$OUTPUT" -md5sum "${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE}" > "${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE}.md5" +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/network/aerc/aerc.info b/network/aerc/aerc.info index 75ca75a6dd..cf4d83e188 100644 --- a/network/aerc/aerc.info +++ b/network/aerc/aerc.info @@ -3,7 +3,7 @@ VERSION="0.18.0" HOMEPAGE="https://aerc-mail.org/" DOWNLOAD="https://git.sr.ht/~rjarry/aerc/archive/0.18.0.tar.gz" MD5SUM="33d4365c3971954fc467a3b143e8d96c" -DOWNLOAD_x86_64="UNSUPPORTED" +DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="google-go-lang scdoc" MAINTAINER="r1w1s1" diff --git a/network/aerc/doinst.sh b/network/aerc/doinst.sh new file mode 100644 index 0000000000..4e8ba7071d --- /dev/null +++ b/network/aerc/doinst.sh @@ -0,0 +1,4 @@ +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi +