静看光阴荏苒
不管不顾不问不说也不念

CentOS7编译安装Deluge2.0.3+Libtorrent1.2.1

在CentOS7上编译安装Deluge2.0就有点麻烦了,肯定是没Debian系那么轻松的。因为CentOS7没有Python3,这个得我们自己手动装,其次gcc编译器的版本过低不支持最新的libtorrent1.2,而这些还不是最难受的,最难受的是Boost库的版本也过低,所以你懂的。。

先装个Python3吧,CentOS7安装Python3还是挺方便的,EPEL源里面就自带了Python3.6,这版本比Debian9还新:

yum -y install epel-release
yum -y install python36 python36-pip python36-devel

然后安装高版本的gcc,为保证原系统环境不受破坏,直接用scl源里面的工具包就好了,这个工具特别方便,可以随意切换gcc的版本,终端一旦退出就还原设置:

yum -y install centos-release-scl
yum -y install devtoolset-7-gcc*
scl enable devtoolset-7 bash

下载boost源码解压:

yum -y install wget zlib-devel bzip2-devel
wget https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz
tar -xzvf boost_1_70_0.tar.gz
cd boost_1_70_0

构建参数如下:

./bootstrap.sh --with-libraries=all --with-python=/usr/bin/python3 --with-python-root=/usr/lib64/python3.6 --with-python-version=3.6

编辑如下文件:

nano project-config.jam

默认你应该可以看到下面这一段配置:

{
    using python : 3.6 : /usr/lib64/python3.6 ;
}

改为:

{
    using python : 3.6 : /usr/lib64/python3.6 : /usr/include/python3.6m : /lib ;
}

编译并安装:

./b2 cxxflags="--std=c++11" -j8
./b2 install --prefix=/usr
ldconfig -v

接下来安装编译libtorrent所需的依赖/包:

yum -y install qt-devel qt5-qtbase-devel openssl-devel \
qt5-linguist GeoIP GeoIP-devel gettext intltool

编译libtorrent1.2:

wget https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_2_1/libtorrent-rasterbar-1.2.1.tar.gz
tar -xzvf libtorrent-rasterbar-1.2.1.tar.gz
cd libtorrent-rasterbar-1.2.1
./configure --prefix=/usr --enable-encryption --enable-python-binding --with-libiconv --with-libgeoip=system CXXFLAGS=-std=c++11 PYTHON=/usr/bin/python3
make -j8
make install
ldconfig -v
ln -s /usr/lib/pkgconfig/libtorrent-rasterbar.pc /usr/lib64/pkgconfig/libtorrent-rasterbar.pc
ln -s /usr/lib/libtorrent-rasterbar.so.10 /usr/lib64/libtorrent-rasterbar.so.10

使用pip3安装Deluge所需的依赖/包:

pip3 install twisted pyopenssl simplejson pyxdg chardet geoip setproctitle pillow mako service_identity

编译安装Deluge2.0.3:

wget https://ftp.osuosl.org/pub/deluge/source/2.0/deluge-2.0.3.tar.xz
tar -xJf deluge-2.0.3.tar.xz
cd deluge-2.0.3
python3 setup.py build
python3 setup.py install

新建deluged的systemd服务:

nano /etc/systemd/system/deluged.service

写入:

[Unit]
Description=Deluge Bittorrent Client Daemon
Documentation=man:deluged
After=network-online.target
[Service]
Type=simple
User=root
Group=root
UMask=007
ExecStart=/usr/local/bin/deluged -d
Restart=on-failure
# Time to wait before forcefully stopped.
TimeoutStopSec=300
[Install]
WantedBy=multi-user.target

新建deluge-web的systemd服务:

nano /etc/systemd/system/deluge-web.service

写入(注意现在Deluge的WEBUI也需要加上-d才是以daemon的方式运行):

[Unit]
Description=Deluge Bittorrent Client Web Interface
Documentation=man:deluge-web
After=network-online.target deluged.service
Wants=deluged.service
[Service]
Type=simple
User=root
Group=root
UMask=027
# This 5 second delay is necessary on some systems
# to ensure deluged has been fully started
ExecStartPre=/bin/sleep 5
ExecStart=/usr/local/bin/deluge-web -d
Restart=on-failure
[Install]
WantedBy=multi-user.target

管理命令:

systemctl start deluged
systemctl start deluge-web
systemctl enable deluged
systemctl enable deluge-web

未完待续,我其实早就不用这种方式去装挂PT的软件了,麻烦不说还不能一劳永逸。所以我早就全套使用Docker了。。这些只是我熟悉下流程,往后好写Dockerfile。。所以接下来是Docker方面的部署方法了。。

赞(1)
未经允许不得转载:荒岛 » CentOS7编译安装Deluge2.0.3+Libtorrent1.2.1
分享到: 更多 (0)

评论 3

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    我都是直接用doubi的Cloud Torrent :cry: 太tm懒了

    橘子4周前 (06-17) Google Chrome 71.0.3578.140 Google Chrome 71.0.3578.140 Windows 10 Windows 10回复
    • 这是给挂PT的人用的,如果是普通用户,我也会选择CloudTorrent或者Aria2 :razz:

      LALA4周前 (06-17) Google Chrome 73.0.3683.103 Google Chrome 73.0.3683.103 Windows 10 x64 Edition Windows 10 x64 Edition回复
  2. #2

    博主高产胜母猪啊。佩服

    谁知道呢4周前 (06-19) Google Chrome 75.0.3770.90 Google Chrome 75.0.3770.90 Windows 10 x64 Edition Windows 10 x64 Edition回复

分享创造快乐

广告合作资源投稿