transmission: use termux_step_install_service_scripts for service script
This commit is contained in:
parent
1716ee981b
commit
4fe064e0db
@ -7,7 +7,12 @@ TERMUX_PKG_SRCURL=https://github.com/transmission/transmission/archive/${TERMUX_
|
||||
TERMUX_PKG_SHA256=440c2fd0f89b1ab59d8a4b79ecd7bffd61bc000e36fb5b6c8e88142a4fadbb1f
|
||||
TERMUX_PKG_DEPENDS="libcurl, libevent, miniupnpc, openssl"
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-gtk --enable-lightweight --cache-file=termux_configure.cache"
|
||||
TERMUX_PKG_CONFFILES="var/service/transmission/run var/service/transmission/log/run"
|
||||
# transmission already puts timestamps in the info printed to stdout so no need for svlogd -tt,
|
||||
# therefore we override the transmission/log run script
|
||||
TERMUX_PKG_SERVICE_SCRIPT=(
|
||||
"transmission" 'mkdir -p ~/torrent/torrent-files\nmkdir -p ~/torrent/download\nexec transmission-daemon -f -c ~/torrent/torrent-files -w ~/torrent/download 2>&1'
|
||||
"transmission/log" 'mkdir -p "$LOGDIR/sv/transmission"\nexec svlogd "$LOGDIR/sv/transmission"'
|
||||
)
|
||||
|
||||
termux_step_pre_configure() {
|
||||
./autogen.sh
|
||||
@ -16,25 +21,3 @@ termux_step_pre_configure() {
|
||||
echo "ac_cv_search_getmntent=false" >> termux_configure.cache
|
||||
chmod a-w termux_configure.cache
|
||||
}
|
||||
|
||||
termux_step_post_make_install() {
|
||||
# Setup transmission service script
|
||||
mkdir -p $TERMUX_PREFIX/var/service
|
||||
cd $TERMUX_PREFIX/var/service
|
||||
mkdir -p transmission/log
|
||||
echo "#!$TERMUX_PREFIX/bin/sh" > transmission/run
|
||||
echo 'mkdir -p ~/torrent/torrent-files' >> transmission/run
|
||||
echo 'mkdir -p ~/torrent/download' >> transmission/run
|
||||
echo 'exec transmission-daemon \' >> transmission/run
|
||||
echo ' -f \' >> transmission/run
|
||||
echo ' -c ~/torrent/torrent-files \' >> transmission/run
|
||||
echo ' -w ~/torrent/download \' >> transmission/run
|
||||
echo ' 2>&1' >> transmission/run
|
||||
chmod +x transmission/run
|
||||
touch transmission/down
|
||||
|
||||
echo "#!$TERMUX_PREFIX/bin/sh" > transmission/log/run
|
||||
echo 'mkdir -p "$LOGDIR/sv/transmission"' >> transmission/log/run
|
||||
echo 'exec svlogd "$LOGDIR/sv/transmission"' >> transmission/log/run
|
||||
chmod +x transmission/log/run
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user