99 lines
3.1 KiB
Bash
99 lines
3.1 KiB
Bash
# Template file for 'transmission'
|
|
pkgname=transmission
|
|
version=2.94
|
|
revision=4
|
|
build_style=gnu-configure
|
|
configure_args="--enable-nls --enable-cli --enable-daemon --enable-utp
|
|
--without-systemd-daemon"
|
|
hostmakedepends="intltool pkg-config"
|
|
makedepends="dbus-glib-devel gtk+3-devel libcurl-devel libevent-devel
|
|
qt5-tools-devel"
|
|
short_desc="Fast, easy and free BitTorrent client"
|
|
maintainer="Orphaned <orphan@voidlinux.org>"
|
|
license="MIT, GPL-2.0-or-later"
|
|
homepage="https://www.transmissionbt.com"
|
|
distfiles="https://github.com/transmission/transmission-releases/raw/master/${pkgname}-${version}.tar.xz"
|
|
checksum=35442cc849f91f8df982c3d0d479d650c6ca19310a994eccdaa79a4af3916b7d
|
|
|
|
# Create transmission system user/group
|
|
system_accounts="transmission"
|
|
transmission_homedir="/var/lib/transmission"
|
|
make_dirs="/var/lib/transmission 0755 transmission transmission"
|
|
subpackages="transmission-gtk"
|
|
|
|
if [ -z "$CROSS_BUILD" ]; then
|
|
makedepends+=" qt5-devel"
|
|
subpackages+=" transmission-qt"
|
|
fi
|
|
|
|
post_configure() {
|
|
# Add missing includes which happen as side-effects with glibc
|
|
sed -i libtransmission/transmission.h \
|
|
-e "/#include <inttypes.h>.*/i #include <sys/types.h> /* ssize_t */" \
|
|
-e "/#include <inttypes.h>.*/i #include <stdio.h> /* off_t */"
|
|
}
|
|
|
|
do_build() {
|
|
make CXXFLAGS="${CXXFLAGS} -std=c++11" LDFLAGS="${LDFLAGS}" ${makejobs}
|
|
if [ -z "$CROSS_BUILD" ]; then
|
|
# Build the Qt frontend
|
|
cd qt
|
|
qmake QMAKE_CXXFLAGS="${CXXFLAGS}" QMAKE_LFLAGS="${LDFLAGS}" qtr.pro
|
|
lrelease translations/*.ts
|
|
make ${makejobs} CXXFLAGS="${CXXFLAGS} -fPIC -std=c++11" LDFLAGS="${LDFLAGS}"
|
|
fi
|
|
}
|
|
|
|
do_install() {
|
|
# Install CLI tools, daemon and web client
|
|
for dir in cli daemon utils web; do
|
|
make -C ${dir} DESTDIR=${DESTDIR} install
|
|
done
|
|
|
|
# Install GTK+ frontend
|
|
make -C gtk DESTDIR=${DESTDIR} install
|
|
make -C po DESTDIR=${DESTDIR} install
|
|
|
|
if [ -z "$CROSS_BUILD" ]; then
|
|
# Install Qt frontend
|
|
make -C qt INSTALL_ROOT=${DESTDIR}/usr install
|
|
vmkdir usr/share/qt4/translations
|
|
vcopy qt/translations/*.qm usr/share/qt4/translations
|
|
fi
|
|
}
|
|
|
|
post_install() {
|
|
rm -f ${DESTDIR}/usr/share/${pkgname}/web/LICENSE
|
|
vsv transmission-daemon
|
|
vlicense COPYING
|
|
}
|
|
|
|
transmission-qt_package() {
|
|
depends="${sourcepkg}>=${version}_${revision} desktop-file-utils"
|
|
short_desc+=" - Qt frontend"
|
|
pkg_install() {
|
|
vmove usr/bin/transmission-qt
|
|
vmove usr/share/man/man1/transmission-qt.1
|
|
vmove usr/share/qt4/translations
|
|
sed -i '/Icon=/s/transmission/&-qt/' ${wrksrc}/qt/transmission-qt.desktop
|
|
vinstall ${wrksrc}/qt/icons/transmission.png 644 usr/share/pixmaps transmission-qt.png
|
|
vinstall ${wrksrc}/qt/transmission-qt.desktop 644 usr/share/applications
|
|
}
|
|
}
|
|
|
|
transmission-gtk_package() {
|
|
depends="${sourcepkg}>=${version}_${revision} hicolor-icon-theme desktop-file-utils"
|
|
short_desc+=" - GTK+ frontend"
|
|
pkg_install() {
|
|
vmove usr/bin/transmission-gtk
|
|
vmove usr/share/man/man1/transmission-gtk.1
|
|
vmove usr/share/icons/hicolor
|
|
vmove usr/share/applications
|
|
vmove usr/share/pixmaps
|
|
# This install path seems to be used with musl libc
|
|
if [ -d ${DESTDIR}/usr/lib/locale ]; then
|
|
mv ${DESTDIR}/usr/lib/locale ${DESTDIR}/usr/share
|
|
fi
|
|
vmove usr/share/locale
|
|
}
|
|
}
|