Building transmission with specifying external IP for trackers

Hi everyone.
Could you please explain how to build fork of transmission (from here : https://github.com/vjunk/transmission-mpx/tree/announce-ip)?
I am familiar with building firmware for router and all necessary packages, but I don't know how to build application from other sources, e.g. fork of transmission.
I have internet thru ISP's NAT, with few ports forwarded, one of them reserved for transmission. But due to a ISP's structure my outgoing IP address differs from external address, that I must use for accessing transmission by forwarded port. I found fork of transmission that can override IPs that are returning to torrent trackers, but It don't know how to build this application.

Transmission is already an OpenWrt package (./feeds/packages/net/transmission)

  1. Just edit the existing package, changing the PKG_SOURCE_URL and PKG_HASH to:
PKG_SOURCE_URL:=https://github.com/vjunk/transmission-mpx.git
PKG_HASH:=skip

Or...

  1. Copy the existing ./feeds/packages/net/transmission to a new package (eg: ./feeds packages/net/transmission-ng) and edit the Makefile to change the PKG_NAME (but then you'd need to make sure you changed ALL instances in the Makefile!) as well as the PKG_SOURCE_URL and PKG_HASH

First way is quick and dirty, and if you're doing everything locally, probably not a huge issue.. The second way is more complicated, but gives you the opportunity not to discard the original transmission while having the fork.

2 Likes

Ok, thanks.
For obtaining transmission with specifying external IP for trackers support I need to build some certain branch, how I can specify it?

You'll need to set it up for git rather than using an archive file.

Change PKG_SOURCE_VERSION:= to the commit that you want to build to. To use the ip-announce branch, you'd have

PKG_SOURCE_VERSION:=7786ac9428a9922703d87c07eac8a85baf313f86 because 7786ac9428a9922703d87c07eac8a85baf313f86 is the commit HEAD for that branch

But for master branch, you'd use:
PKG_SOURCE_VERSION:=51573a3c1eb63d944f87ce16a9ae8c26a183ebfe (as 51573a3c1eb63d944f87ce16a9ae8c26a183ebfe is the commit HEAD)

What branch are you trying to build?

Edit:

Here, I altered the ./feeds/packages/net/transmission/Makefile for you. Put replace the existing one with this, to build the announce-ip branch.

#
# Copyright (C) 2009-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=transmission
PKG_VERSION:=3.00
PKG_RELEASE:=4

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/vjunk/transmission-mpx.git
PKG_SOURCE_DATE:=2020-06-13
PKG_SOURCE_VERSION:=7786ac9428a9922703d87c07eac8a85baf313f86
PKG_HASH:=skip

PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:transmissionbt:transmission

PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/package-seccomp.mk

define Package/transmission/template
  SUBMENU:=BitTorrent
  SECTION:=net
  CATEGORY:=Network
  TITLE:=BitTorrent client
  URL:=https://www.transmissionbt.com
  DEPENDS:=+libcurl +libevent2 +libminiupnpc +libnatpmp +libpthread +librt +zlib
endef

define Package/transmission-daemon/Default
  $(call Package/transmission/template)
  USERID:=transmission=224:transmission=224
endef

define Package/transmission-daemon-openssl
  $(call Package/transmission-daemon/Default)
  TITLE+= (with OpenSSL)
  DEPENDS+=+libopenssl
  VARIANT:=openssl
endef

define Package/transmission-daemon-mbedtls
  $(call Package/transmission-daemon/Default)
  TITLE+= (with mbed TLS)
  DEPENDS+=+libmbedtls
  VARIANT:=mbedtls
endef

define Package/transmission-cli-openssl
  $(call Package/transmission/template)
  TITLE+= (with OpenSSL)
  DEPENDS+=+libopenssl
  VARIANT:=openssl
endef

define Package/transmission-cli-mbedtls
  $(call Package/transmission/template)
  TITLE+= (with mbed TLS)
  DEPENDS+=+libmbedtls
  VARIANT:=mbedtls
endef

define Package/transmission-remote-openssl
  $(call Package/transmission/template)
  TITLE+= (with OpenSSL)
  DEPENDS+=+libopenssl
  VARIANT:=openssl
endef

define Package/transmission-remote-mbedtls
  $(call Package/transmission/template)
  TITLE+= (with mbed TLS)
  DEPENDS+=+libmbedtls
  VARIANT:=mbedtls
endef

define Package/transmission-web
  $(call Package/transmission/template)
  TITLE+= (webinterface)
  DEPENDS:=@(PACKAGE_transmission-daemon-openssl||PACKAGE_transmission-daemon-mbedtls)
  PKGARCH:=all
endef


define Package/transmission-daemon/Default/description
 Transmission is a simple BitTorrent client.
 It features a very simple, intuitive interface
 on top on an efficient, cross-platform back-end.
 This package contains the daemon itself.
endef
Package/transmission-daemon-openssl/description = $(Package/transmission-daemon/Default/description)
Package/transmission-daemon-mbedtls/description = $(Package/transmission-daemon/Default/description)

define Package/transmission-cli/Default/description
 CLI utilities for transmission.
endef
Package/transmission-cli-openssl/description = $(Package/transmission-cli/Default/description)
Package/transmission-cli-mbedtls/description = $(Package/transmission-cli/Default/description)

define Package/transmission-remote/Default/description
 CLI remote interface for transmission.
endef
Package/transmission-remote-openssl/description = $(Package/transmission-remote/Default/description)
Package/transmission-remote-mbedtls/description = $(Package/transmission-remote/Default/description)

define Package/transmission-web/description
 Webinterface resources for transmission.
endef

define Package/transmission-daemon-openssl/conffiles
/etc/config/transmission
endef
Package/transmission-daemon-mbedtls/conffiles = $(Package/transmission-daemon-openssl/conffiles)

TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed

CONFIGURE_ARGS += \
	--enable-cli \
	--enable-daemon \
	--enable-external-natpmp \
	--enable-largefile \
	--enable-lightweight \
	--without-gtk \
	--without-kqueue \
	--without-systemd-daemon

ifeq ($(BUILD_VARIANT),mbedtls)
  CONFIGURE_ARGS += --with-crypto=polarssl
  CONFIGURE_VARS += \
	MBEDTLS_CFLAGS="-I$(STAGING_DIR)/usr/include/mbedtls" \
	MBEDTLS_LIBS="-lmbedtls -lmbedcrypto"
else
  CONFIGURE_ARGS += --with-crypto=openssl
endif

define Package/transmission-daemon-openssl/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-daemon $(1)/usr/bin/
	$(INSTALL_DIR) $(1)/etc/init.d/
	$(INSTALL_BIN) files/transmission.init $(1)/etc/init.d/transmission
	$(INSTALL_DIR) $(1)/etc/config
	$(INSTALL_CONF) files/transmission.config $(1)/etc/config/transmission
	$(INSTALL_DIR) $(1)/etc/sysctl.d/
	$(INSTALL_CONF) files/transmission.sysctl $(1)/etc/sysctl.d/20-transmission.conf
	$(call InstallSeccomp,$(1),./files/transmission-daemon.json)
endef
Package/transmission-daemon-mbedtls/install = $(Package/transmission-daemon-openssl/install)

define Package/transmission-cli-openssl/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-cli \
			$(PKG_INSTALL_DIR)/usr/bin/transmission-create \
			$(PKG_INSTALL_DIR)/usr/bin/transmission-edit \
			$(PKG_INSTALL_DIR)/usr/bin/transmission-show \
			$(1)/usr/bin/
endef
Package/transmission-cli-mbedtls/install = $(Package/transmission-cli-openssl/install)

define Package/transmission-remote-openssl/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-remote $(1)/usr/bin/
endef
Package/transmission-remote-mbedtls/install = $(Package/transmission-remote-openssl/install)

define Package/transmission-web/install
	$(INSTALL_DIR) $(1)/usr/share/transmission
	$(CP) $(PKG_INSTALL_DIR)/usr/share/transmission/web $(1)/usr/share/transmission/
endef

$(eval $(call BuildPackage,transmission-daemon-openssl))
$(eval $(call BuildPackage,transmission-daemon-mbedtls))
$(eval $(call BuildPackage,transmission-cli-openssl))
$(eval $(call BuildPackage,transmission-cli-mbedtls))
$(eval $(call BuildPackage,transmission-remote-openssl))
$(eval $(call BuildPackage,transmission-remote-mbedtls))
$(eval $(call BuildPackage,transmission-web))

As I understand I need branch "announce-ip".
I am not familiar with git, does changes needed for external IP present in the master branch?

Check the edit :slight_smile:

Thanks for your assistance!
I edited ./feeds/packages/net/transmission/Makefile as you pointed, but after

make clean
make download
make package/transmission/compile V=s

I am still getting transmission bb6b5a062e, this is hash of commit bb6b5a062ee594dfd4b7a12a6b6e860c43849bfd.
Why?

Try removing the existing archive..

rm ./dl/transmission*
make -j1 V=sc package/feeds/packages/transmission/{clean,compile} 

As a guess, if we had done it properly (by advancing the versioning in the Makefile) the system would know it changed and needed to go check the source, clone and archive to the new head.

I did

rm ./dl/transmission*
make clean && make package/transmission/compile V=sc

And get errors:

make[3]: Entering directory `/home/kt368/openwrt2/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/transmission-mbedtls/transmission-3.00'
make[3]: *** No targets specified and no makefile found.  Stop.
make[3]: Leaving directory `/home/kt368/openwrt2/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/transmission-mbedtls/transmission-3.00'
make[2]: *** [/home/kt368/openwrt2/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/transmission-mbedtls/transmission-3.00/.built] Error 2
make[2]: Leaving directory `/home/kt368/openwrt2/openwrt/feeds/packages/net/transmission'
time: package/feeds/packages/transmission/mbedtls/compile#18.32#2.39#26.12
make[1]: *** [package/feeds/packages/transmission/compile] Error 2
make[1]: Leaving directory `/home/kt368/openwrt2/openwrt'
make: *** [package/transmission/compile] Error 2

I've tried to do the same things with freshly check-outed openwrt and I've got the same error too...

This is incorrect, use:

make -j1 V=sc package/feeds/packages/transmission/{clean,compile}

package/transmission/compile isn't valid, it's package/feeds/packages/transmission

Just for the future:

make clean cleans the entire build root.. make package/feeds/packages/transmission/clean removes just the artifacts and build directory for the transmission package. If nothing else, it'll be quicker to re-compile if you don't keep removing all the other stuff when you have to do it :slight_smile:

And.. using -j1 forces your system to build in single-thread mode. This is slower, however, if/when you have an issue/error, it'll let you see where the error happened in context. If you leave -j1 off, it'll build at nproc (the physical number of cores/threads your machine has) or nproc+1.

The issue with this is that if you have an error, and you're not building at -j1, where it errors is never at the end of the build log. Use -j1 to troubleshoot, and leave it off (or over-ride it with whatever you want to) when building - unless there is an error.

Understood, thanks.
After doing

make -j1 V=sc package/feeds/packages/transmission/{clean,compile}

I got the same error anyway...

make[3]: Entering directory `/home/kt368/openwrt2/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/transmission-mbedtls/transmission-3.00'
make[3]: *** No targets specified and no makefile found.  Stop.
make[3]: Leaving directory `/home/kt368/openwrt2/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/transmission-mbedtls/transmission-3.00'
make[2]: *** [/home/kt368/openwrt2/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/transmission-mbedtls/transmission-3.00/.built] Error 2
make[2]: Leaving directory `/home/kt368/openwrt2/openwrt/feeds/packages/net/transmission'
time: package/feeds/packages/transmission/mbedtls/compile#0.34#0.13#0.44
make[1]: *** [package/feeds/packages/transmission/compile] Error 2
make[1]: Leaving directory `/home/kt368/openwrt2/openwrt'
make: *** [package/feeds/packages/transmission/compile] Error 2

I don't use transmission, and I didn't write the Makefile for it. I will try and build it out when I get a chance, but I'd re-run your make menuconfig and start turning options off. mbedtls was replaced by wolfssl in the master branch AFAIK, so mbedtls might need to be turned on in your config, or the package reworked.

1 Like

Status update.
I've compared the content of the default source codes archive of transmission (./dl/transmission-3.00.tar.xz) and the content of the archive that I get when I run compilation with modified Makefile (./feeds/packages/net/transmission/Makefile).
I found that there is no Makefile.in in the archive obtained during building with modified Makefile. There is the only Makefile.am.
I've read that I can produce Makefile.in from Makefile.ac using

autoreconf --install

I've tried to do that with unpacked content of ./dl/transmission-3.00.tar.xz, then add all files, obtained during autoreconf --install to source archive ./dl/transmission-3.00.tar.xz and try build again.
Now I see other errors:

config.status: error: cannot find input file: `po/Makefile.in.in'
make[2]: *** [/home/kt368/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/transmission-mbedtls/transmission-3.00/.configured_08dcd131e9c790876fa6ed69fe8159bf] Error 1
make[2]: Leaving directory `/home/kt368/openwrt/feeds/packages/net/transmission'
time: package/feeds/packages/transmission/mbedtls/compile#2.54#1.46#5.27
make[1]: *** [package/feeds/packages/transmission/compile] Error 2
make[1]: Leaving directory `/home/kt368/openwrt'
make: *** [package/feeds/packages/transmission/compile] Error 2

I've uploaded this archive here.
Could you point me in the right direction?

I just compiled it successfully, though I've not tested it.

transmission-ng-cli-openssl_3.00-1_mips64_octeon3.ipk
transmission-ng-remote-openssl_3.00-1_mips64_octeon3.ipk

On my screen, I have both because I left the original transmission package alone. However, you can just replace the ./feeds/packages/net/transmission/Makefile with the one below. The, make menuconfig and select the correct transmission-ng options you want.

#
# Copyright (C) 2009-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=transmission
PKG_VERSION:=3.00
PKG_RELEASE:=1

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/vjunk/transmission-mpx.git
PKG_SOURCE_DATE:=2020-06-13
PKG_SOURCE_VERSION:=7786ac9428a9922703d87c07eac8a85baf313f86
PKG_HASH:=skip

PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:transmissionbt:transmission

PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/package-seccomp.mk

define Package/transmission-ng/template
  SUBMENU:=BitTorrent
  SECTION:=net
  CATEGORY:=Network
  TITLE:=BitTorrent client (NG)
  URL:=https://www.transmissionbt.com
  DEPENDS:=+libcurl +libevent2 +libminiupnpc +libnatpmp +libpthread +librt +zlib
endef

define Package/transmission-ng-daemon/Default
  $(call Package/transmission-ng/template)
  USERID:=transmission=224:transmission=224
endef

define Package/transmission-ng-daemon-openssl
  $(call Package/transmission-ng-daemon/Default)
  TITLE+= (with OpenSSL)
  DEPENDS+=+libopenssl
  VARIANT:=openssl
endef

define Package/transmission-ng-daemon-mbedtls
  $(call Package/transmission-ng-daemon/Default)
  TITLE+= (with mbed TLS)
  DEPENDS+=+libmbedtls
  VARIANT:=mbedtls
endef

define Package/transmission-ng-cli-openssl
  $(call Package/transmission-ng/template)
  TITLE+= (with OpenSSL)
  DEPENDS+=+libopenssl
  VARIANT:=openssl
endef

define Package/transmission-ng-cli-mbedtls
  $(call Package/transmission-ng/template)
  TITLE+= (with mbed TLS)
  DEPENDS+=+libmbedtls
  VARIANT:=mbedtls
endef

define Package/transmission-ng-remote-openssl
  $(call Package/transmission-ng/template)
  TITLE+= (with OpenSSL)
  DEPENDS+=+libopenssl
  VARIANT:=openssl
endef

define Package/transmission-ng-remote-mbedtls
  $(call Package/transmission-ng/template)
  TITLE+= (with mbed TLS)
  DEPENDS+=+libmbedtls
  VARIANT:=mbedtls
endef

define Package/transmission-ng-web
  $(call Package/transmission-ng/template)
  TITLE+= (webinterface)
  DEPENDS:=@(PACKAGE_transmission-daemon-openssl||PACKAGE_transmission-daemon-mbedtls)
  PKGARCH:=all
endef


define Package/transmission-ng-daemon/Default/description
 Transmission is a simple BitTorrent client.
 It features a very simple, intuitive interface
 on top on an efficient, cross-platform back-end.
 This package contains the daemon itself.
endef
Package/transmission-ng-daemon-openssl/description = $(Package/transmission-ng-daemon/Default/description)
Package/transmission-ng-daemon-mbedtls/description = $(Package/transmission-ng-daemon/Default/description)

define Package/transmission-ng-cli/Default/description
 CLI utilities for transmission.
endef
Package/transmission-ng-cli-openssl/description = $(Package/transmission-ng-cli/Default/description)
Package/transmission-ng-cli-mbedtls/description = $(Package/transmission-ng-cli/Default/description)

define Package/transmission-ng-remote/Default/description
 CLI remote interface for transmission.
endef
Package/transmission-ng-remote-openssl/description = $(Package/transmission-ng-remote/Default/description)
Package/transmission-ng-remote-mbedtls/description = $(Package/transmission-ng-remote/Default/description)

define Package/transmission-ng-web/description
 Webinterface resources for transmission.
endef

define Package/transmission-ng-daemon-openssl/conffiles
/etc/config/transmission
endef
Package/transmission-ng-daemon-mbedtls/conffiles = $(Package/transmission-ng-daemon-openssl/conffiles)

TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed

CONFIGURE_ARGS += \
	--enable-cli \
	--enable-daemon \
	--enable-external-natpmp \
	--enable-largefile \
	--enable-lightweight \
	--without-gtk \
	--without-kqueue \
	--without-systemd-daemon

ifeq ($(BUILD_VARIANT),mbedtls)
  CONFIGURE_ARGS += --with-crypto=polarssl
  CONFIGURE_VARS += \
	MBEDTLS_CFLAGS="-I$(STAGING_DIR)/usr/include/mbedtls" \
	MBEDTLS_LIBS="-lmbedtls -lmbedcrypto"
else
  CONFIGURE_ARGS += --with-crypto=openssl
endif

define Package/transmission-ng-daemon-openssl/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-daemon $(1)/usr/bin/
	$(INSTALL_DIR) $(1)/etc/init.d/
	$(INSTALL_BIN) files/transmission.init $(1)/etc/init.d/transmission
	$(INSTALL_DIR) $(1)/etc/config
	$(INSTALL_CONF) files/transmission.config $(1)/etc/config/transmission
	$(INSTALL_DIR) $(1)/etc/sysctl.d/
	$(INSTALL_CONF) files/transmission.sysctl $(1)/etc/sysctl.d/20-transmission.conf
	$(call InstallSeccomp,$(1),./files/transmission-daemon.json)
endef
Package/transmission-ng-daemon-mbedtls/install = $(Package/transmission-ng-daemon-openssl/install)

define Package/transmission-ng-cli-openssl/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-cli \
			$(PKG_INSTALL_DIR)/usr/bin/transmission-create \
			$(PKG_INSTALL_DIR)/usr/bin/transmission-edit \
			$(PKG_INSTALL_DIR)/usr/bin/transmission-show \
			$(1)/usr/bin/
endef
Package/transmission-ng-cli-mbedtls/install = $(Package/transmission-ng-cli-openssl/install)

define Package/transmission-ng-remote-openssl/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-remote $(1)/usr/bin/
endef
Package/transmission-ng-remote-mbedtls/install = $(Package/transmission-ng-remote-openssl/install)

define Package/transmission-ng-web/install
	$(INSTALL_DIR) $(1)/usr/share/transmission
	$(CP) $(PKG_INSTALL_DIR)/usr/share/transmission/web $(1)/usr/share/transmission/
endef

$(eval $(call BuildPackage,transmission-ng-daemon-openssl))
$(eval $(call BuildPackage,transmission-ng-daemon-mbedtls))
$(eval $(call BuildPackage,transmission-ng-cli-openssl))
$(eval $(call BuildPackage,transmission-ng-cli-mbedtls))
$(eval $(call BuildPackage,transmission-ng-remote-openssl))
$(eval $(call BuildPackage,transmission-ng-remote-mbedtls))
$(eval $(call BuildPackage,transmission-ng-web))
3 Likes

I did everything as you say, but I still have the same error ...
Did you make any manual changes in ./dl/transmission-3.00.tar.xz?? If yes could you please give me your ./dl/transmission-3.00.tar.xz? You can upload it here.
Do you work with branch v19.07.4?

No, there were no changes to the .tar.xz file, because there shouldn't be one until the build system clones it from the Github archive.

The only thing I did was copy the entire ./feeds/packages/net/transmission to ./feeds/packages/net/transmission-ng and changed the Makefile I did this so that I didn't interfere with the stock transmission package. You shouldn't have to do this, but you can if you want.

I mean, i can link the archive, but it won't do you much good if your build system isn't doing it for you like it should.

Tell you what, here is the entire package ready to be extracted to your ./feeds/packages/net/ folder..

transmission-ng.tgz

Extract that, and from your buildroot:
./scripts/feeds update -i -a
./scripts/feeds install -f -a

This will reindex and install the new transmission-ng package. Then you will go into make menuconfig and select what you need.

1 Like

Have some progress.
I've deleted all my openwrt folder, and started over:

git clone https://github.com/openwrt/openwrt.git
cd openwrt
git checkout v19.07.4
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
make defconfig
make download
## Added your transmission-ng
./scripts/feeds update -i -a
./scripts/feeds install -f -a
make menuconfig ## selected transmission-ng-mbedtls
make -j5 V=sc package/feeds/packages/transmission-ng/{clean,compile}

And finally I've got my transmission-ng-daemon-mbedtls_3.00-1_arm_cortex-a15_neon-vfpv4.ipk :grinning:
Then I've install it to the router, and try to start it by

root@OpenWrt:~# transmission-daemon --help

And I've saw

Transmission 3.00 (bb6b5a062e)  https://transmissionbt.com/

But this corresponds to transmission 3.00 from the main transmission repository...
And I see that ./dl/transmission-3.00.tar.xz is really the source files from the main transmission repository.
What happens?
After manually deleting ./dl/transmission-3.00.tar.xz building fails with the same error as previously:

make[3]: Entering directory `/home/kt368/openwrt_tr/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/transmission-mbedtls/transmission-3.00'
make[3]: *** No targets specified and no makefile found.  Stop.
make[3]: Leaving directory `/home/kt368/openwrt_tr/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/transmission-mbedtls/transmission-3.00'
make[2]: *** [/home/kt368/openwrt_tr/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/transmission-mbedtls/transmission-3.00/.built] Error 2
make[2]: Leaving directory `/home/kt368/openwrt_tr/openwrt/feeds/packages/net/transmission-ng'
time: package/feeds/packages/transmission-ng/mbedtls/compile#0.36#0.11#0.44
make[1]: *** [package/feeds/packages/transmission-ng/compile] Error 2
make[1]: Leaving directory `/home/kt368/openwrt_tr/openwrt'
make: *** [package/feeds/packages/transmission-ng/compile] Error 2

It doesn't like the mbedtls it seems.. Since mbedtls is no longer the luCi option of choice (that went to WolfSSL), you may want to test with the openssl versions rather than mbedtls. It could be the transmission package wasn't reworked? Or perhaps assumes mbedtls will be there? Dunno.. Try the openssl versions over mbedtls (if you can)

1 Like

This is because of building from source is usually straight forward. This is to, it just needs to be tweaked. Give me a few and I'll see what I can post for you. It maybe simply adding a small section, I'm testing now.

Edit:

Add this to your Makefile..

define Build/Prepare
	$(call Build/Prepare/Default)
	cd $(PKG_BUILD_DIR) && ./autogen.sh
endef

Complete Makefile

#
# Copyright (C) 2009-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=transmission
PKG_VERSION:=3.00
PKG_RELEASE:=4

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/vjunk/transmission-mpx.git
PKG_SOURCE_DATE:=2020-06-13
PKG_SOURCE_VERSION:=7786ac9428a9922703d87c07eac8a85baf313f86
PKG_HASH:=skip

#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
#PKG_SOURCE_URL:=@GITHUB/transmission/transmission-releases/master
#PKG_HASH:=9144652fe742f7f7dd6657716e378da60b751aaeda8bef8344b3eefc4db255f2

PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:transmissionbt:transmission

PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/package-seccomp.mk

define Build/Prepare
	$(call Build/Prepare/Default)
	cd $(PKG_BUILD_DIR) && ./autogen.sh
endef

define Package/transmission/template
  SUBMENU:=BitTorrent
  SECTION:=net
  CATEGORY:=Network
  TITLE:=BitTorrent client
  URL:=https://www.transmissionbt.com
  DEPENDS:=+libcurl +libevent2 +libminiupnpc +libnatpmp +libpthread +librt +zlib
endef

define Package/transmission-daemon/Default
  $(call Package/transmission/template)
  USERID:=transmission=224:transmission=224
endef

define Package/transmission-daemon-openssl
  $(call Package/transmission-daemon/Default)
  TITLE+= (with OpenSSL)
  DEPENDS+=+libopenssl
  VARIANT:=openssl
endef

define Package/transmission-daemon-mbedtls
  $(call Package/transmission-daemon/Default)
  TITLE+= (with mbed TLS)
  DEPENDS+=+libmbedtls
  VARIANT:=mbedtls
endef

define Package/transmission-cli-openssl
  $(call Package/transmission/template)
  TITLE+= (with OpenSSL)
  DEPENDS+=+libopenssl
  VARIANT:=openssl
endef

define Package/transmission-cli-mbedtls
  $(call Package/transmission/template)
  TITLE+= (with mbed TLS)
  DEPENDS+=+libmbedtls
  VARIANT:=mbedtls
endef

define Package/transmission-remote-openssl
  $(call Package/transmission/template)
  TITLE+= (with OpenSSL)
  DEPENDS+=+libopenssl
  VARIANT:=openssl
endef

define Package/transmission-remote-mbedtls
  $(call Package/transmission/template)
  TITLE+= (with mbed TLS)
  DEPENDS+=+libmbedtls
  VARIANT:=mbedtls
endef

define Package/transmission-web
  $(call Package/transmission/template)
  TITLE+= (webinterface)
  DEPENDS:=@(PACKAGE_transmission-daemon-openssl||PACKAGE_transmission-daemon-mbedtls)
  PKGARCH:=all
endef


define Package/transmission-daemon/Default/description
 Transmission is a simple BitTorrent client.
 It features a very simple, intuitive interface
 on top on an efficient, cross-platform back-end.
 This package contains the daemon itself.
endef
Package/transmission-daemon-openssl/description = $(Package/transmission-daemon/Default/description)
Package/transmission-daemon-mbedtls/description = $(Package/transmission-daemon/Default/description)

define Package/transmission-cli/Default/description
 CLI utilities for transmission.
endef
Package/transmission-cli-openssl/description = $(Package/transmission-cli/Default/description)
Package/transmission-cli-mbedtls/description = $(Package/transmission-cli/Default/description)

define Package/transmission-remote/Default/description
 CLI remote interface for transmission.
endef
Package/transmission-remote-openssl/description = $(Package/transmission-remote/Default/description)
Package/transmission-remote-mbedtls/description = $(Package/transmission-remote/Default/description)

define Package/transmission-web/description
 Webinterface resources for transmission.
endef

define Package/transmission-daemon-openssl/conffiles
/etc/config/transmission
endef
Package/transmission-daemon-mbedtls/conffiles = $(Package/transmission-daemon-openssl/conffiles)

TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed

CONFIGURE_ARGS += \
	--enable-cli \
	--enable-daemon \
	--enable-external-natpmp \
	--enable-largefile \
	--enable-lightweight \
	--without-gtk \
	--without-kqueue \
	--without-systemd-daemon

ifeq ($(BUILD_VARIANT),mbedtls)
  CONFIGURE_ARGS += --with-crypto=polarssl
  CONFIGURE_VARS += \
	MBEDTLS_CFLAGS="-I$(STAGING_DIR)/usr/include/mbedtls" \
	MBEDTLS_LIBS="-lmbedtls -lmbedcrypto"
else
  CONFIGURE_ARGS += --with-crypto=openssl
endif

define Package/transmission-daemon-openssl/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-daemon $(1)/usr/bin/
	$(INSTALL_DIR) $(1)/etc/init.d/
	$(INSTALL_BIN) files/transmission.init $(1)/etc/init.d/transmission
	$(INSTALL_DIR) $(1)/etc/config
	$(INSTALL_CONF) files/transmission.config $(1)/etc/config/transmission
	$(INSTALL_DIR) $(1)/etc/sysctl.d/
	$(INSTALL_CONF) files/transmission.sysctl $(1)/etc/sysctl.d/20-transmission.conf
	$(call InstallSeccomp,$(1),./files/transmission-daemon.json)
endef
Package/transmission-daemon-mbedtls/install = $(Package/transmission-daemon-openssl/install)

define Package/transmission-cli-openssl/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-cli \
			$(PKG_INSTALL_DIR)/usr/bin/transmission-create \
			$(PKG_INSTALL_DIR)/usr/bin/transmission-edit \
			$(PKG_INSTALL_DIR)/usr/bin/transmission-show \
			$(1)/usr/bin/
endef
Package/transmission-cli-mbedtls/install = $(Package/transmission-cli-openssl/install)

define Package/transmission-remote-openssl/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-remote $(1)/usr/bin/
endef
Package/transmission-remote-mbedtls/install = $(Package/transmission-remote-openssl/install)

define Package/transmission-web/install
	$(INSTALL_DIR) $(1)/usr/share/transmission
	$(CP) $(PKG_INSTALL_DIR)/usr/share/transmission/web $(1)/usr/share/transmission/
endef

$(eval $(call BuildPackage,transmission-daemon-openssl))
$(eval $(call BuildPackage,transmission-daemon-mbedtls))
$(eval $(call BuildPackage,transmission-cli-openssl))
$(eval $(call BuildPackage,transmission-cli-mbedtls))
$(eval $(call BuildPackage,transmission-remote-openssl))
$(eval $(call BuildPackage,transmission-remote-mbedtls))
$(eval $(call BuildPackage,transmission-web))
2 Likes

Looks like I have successfully built transmission.
After running

transmission-daemon --help

I see

transmission-daemon --help
Transmission 3.00+ (0)  https://transmissionbt.com/

Hooray!

In addition, I've built transmission-ng-web, and now I have a web interface with the option to specify an external IP address.

But how I can check, are transmission really has the open port?

1 Like