Andrew Geissler | 2ee498a | 2020-05-29 15:52:06 -0500 | [diff] [blame] | 1 | DESCRIPTION = "Transmission is a fast, easy, and free BitTorrent client" |
| 2 | SECTION = "network" |
| 3 | HOMEPAGE = "https://transmissionbt.com/" |
| 4 | LICENSE = "GPL-2.0" |
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=0dd9fcdc1416ff123c41c785192a1895" |
| 6 | |
| 7 | DEPENDS = "curl libevent gnutls openssl libtool intltool-native glib-2.0-native" |
| 8 | RDEPENDS_${PN}-web = "${PN}" |
| 9 | |
| 10 | SRC_URI = " \ |
| 11 | git://github.com/transmission/transmission \ |
| 12 | file://0001-configure.ac-Fix-no-libsystemd-daemon.patch \ |
| 13 | file://transmission-daemon \ |
| 14 | " |
| 15 | |
| 16 | # Transmission release 2.94 |
| 17 | SRCREV = "d8e60ee44f4295935bd98bf741f85ed19f5a7dfb" |
| 18 | PV = "2.94" |
| 19 | |
| 20 | S = "${WORKDIR}/git" |
| 21 | |
| 22 | inherit autotools gettext update-rc.d systemd mime-xdg features_check |
| 23 | |
| 24 | PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gtk', '', d)} \ |
| 25 | ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)}" |
| 26 | |
| 27 | PACKAGECONFIG[gtk] = " --with-gtk,--without-gtk,gtk+3," |
| 28 | PACKAGECONFIG[systemd] = "--with-systemd-daemon,--without-systemd-daemon,systemd," |
| 29 | |
| 30 | # Weak default values for transmission user and group |
| 31 | # Change them in bbappend if needed |
| 32 | TRANSMISSION_USER ??= "root" |
| 33 | TRANSMISSION_GROUP ??= "root" |
| 34 | |
| 35 | # Configure aborts with: |
| 36 | # config.status: error: po/Makefile.in.in was not created by intltoolize. |
| 37 | B = "${S}" |
| 38 | do_configure_prepend() { |
| 39 | sed -i /AM_GLIB_GNU_GETTEXT/d ${S}/configure.ac |
| 40 | cd ${S} |
| 41 | ./update-version-h.sh |
| 42 | intltoolize --copy --force --automake |
| 43 | } |
| 44 | |
| 45 | do_install_append() { |
| 46 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 47 | sed -i '/USERNAME=/c\USERNAME=${TRANSMISSION_USER}' ${WORKDIR}/transmission-daemon |
| 48 | install -d ${D}${sysconfdir}/init.d |
| 49 | install -m 0744 ${WORKDIR}/transmission-daemon ${D}${sysconfdir}/init.d/ |
| 50 | chown ${TRANSMISSION_USER}:${TRANSMISSION_GROUP} ${D}${sysconfdir}/init.d/transmission-daemon |
| 51 | fi |
| 52 | |
| 53 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 54 | sed -i '/User=/c\User=${TRANSMISSION_USER}' ${S}/daemon/transmission-daemon.service |
| 55 | install -d ${D}${systemd_unitdir}/system |
| 56 | install -m 0644 ${S}/daemon/transmission-daemon.service ${D}${systemd_unitdir}/system |
| 57 | fi |
| 58 | } |
| 59 | |
| 60 | PACKAGES += "${PN}-gtk ${PN}-client ${PN}-web" |
| 61 | |
| 62 | FILES_${PN}-client = "${bindir}/transmission-remote ${bindir}/transmission-cli ${bindir}/transmission-create ${bindir}/transmission-show ${bindir}/transmission-edit" |
| 63 | FILES_${PN}-gtk += "${bindir}/transmission-gtk ${datadir}/icons ${datadir}/applications ${datadir}/pixmaps" |
| 64 | FILES_${PN}-web = "${datadir}/transmission/web" |
| 65 | FILES_${PN} = "${bindir}/transmission-daemon ${sysconfdir}/init.d/transmission-daemon" |
| 66 | |
| 67 | SYSTEMD_SERVICE_${PN} = "transmission-daemon.service" |
| 68 | |
| 69 | # Script transmission-daemon following the guidelines in: |
| 70 | # https://trac.transmissionbt.com/wiki/Scripts/initd |
| 71 | INITSCRIPT_PACKAGES = "transmission-daemon" |
| 72 | INITSCRIPT_NAME = "transmission-daemon" |
| 73 | INITSCRIPT_PARAMS = "start 99 5 3 2 . stop 10 0 1 6 ." |