transmission: create transmission system user/group to use transmission-daemon

Add systemd support and build option.
This commit is contained in:
Alessio Sergi 2014-08-08 23:28:08 +02:00
parent 1a42c980a5
commit 1ce97e6afa
1 changed files with 52 additions and 13 deletions

View File

@ -1,7 +1,7 @@
# Template file for 'transmission'
pkgname=transmission
version=2.84
revision=2
revision=3
build_style=gnu-configure
configure_args="--enable-nls --enable-cli --enable-daemon --enable-utp"
hostmakedepends="pkg-config intltool"
@ -13,43 +13,82 @@ 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
post_build() {
# Build the qt frontend.
cd qt
qmake qtr.pro
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() {
# Install qt frontend
make -C qt INSTALL_ROOT=${DESTDIR}/usr 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}"
short_desc+=" - QT Frontend"
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 # !CROSS_BUILD
fi
transmission-gtk_package() {
depends="${sourcepkg}>=${version} hicolor-icon-theme desktop-file-utils"
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
}
}