aboutsummaryrefslogtreecommitdiff
path: root/srcpkgs/transmission/template
blob: 3a94c9428e78071aee7993981716b30fbc449fcf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Template file for 'transmission'
pkgname=transmission
version=2.84
revision=3
build_style=gnu-configure
configure_args="--enable-nls --enable-cli --enable-daemon --enable-utp"
hostmakedepends="pkg-config intltool"
makedepends="zlib-devel libressl-devel dbus-glib-devel libcurl-devel libevent-devel gtk+3-devel"
short_desc="A fast, easy, and free BitTorrent client"
maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://www.transmissionbt.com/"
license="MIT, GPL-2"
distfiles="http://download.transmissionbt.com/files/$pkgname-$version.tar.xz"
checksum=a9fc1936b4ee414acc732ada04e84339d6755cd0d097bcbd11ba2cfc540db9eb

# Create transmission system user/group
system_accounts="transmission:169"
transmission_homedir="/var/lib/transmission"
make_dirs="/var/lib/transmission 0755 transmission transmission"

# Package build options
build_options="systemd"
if [ "$build_option_systemd" ]; then
	configure_args+=" --with-systemd-daemon"
	makedepends+=" systemd-devel"
	systemd_services="transmission-daemon.service on"
fi

if [ -z "$CROSS_BUILD" ]; then
	makedepends+=" qt-devel"
fi

do_build() {
	make CXXFLAGS="${CXXFLAGS} -std=c++11" LDFLAGS="${LDFLAGS}" ${makejobs}
	if [ -z "$CROSS_BUILD" ]; then
		# Build the Qt frontend
		cd qt
		qmake qtr.pro
		lrelease translations/*.ts
		make CXXFLAGS="${CXXFLAGS} -std=c++11" LDFLAGS="${LDFLAGS}" ${makejobs}
	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
	if [ "$build_option_systemd" ]; then
		vinstall daemon/transmission-daemon.service 644 usr/lib/systemd/system
	fi
}

if [ -z "$CROSS_BUILD" ]; then
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
		vinstall ${wrksrc}/qt/icons/transmission.png 644 usr/share/pixmaps transmission-qt.png
		vinstall ${wrksrc}/qt/transmission-qt.desktop 644 usr/share/applications
	}
}
fi

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
		vmove usr/share/locale
	}
}