Browse Source

i2pd: Improve the package, fix #5326

Signed-off-by: David Yang <mmyangfl@gmail.com>
lilik-openwrt-22.03
David Yang 7 years ago
parent
commit
fba9ee1512
3 changed files with 41 additions and 18 deletions
  1. +13
    -3
      net/i2pd/Makefile
  2. +28
    -4
      net/i2pd/files/i2pd.init
  3. +0
    -11
      net/i2pd/patches/010-cross-compile.patch

+ 13
- 3
net/i2pd/Makefile View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=i2pd PKG_NAME:=i2pd
PKG_VERSION:=2.17.0 PKG_VERSION:=2.17.0
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
@ -26,10 +26,11 @@ include $(INCLUDE_DIR)/package.mk
define Package/i2pd define Package/i2pd
SECTION:=net SECTION:=net
CATEGORY:=Network CATEGORY:=Network
DEPENDS:=+libopenssl +boost +boost-system +boost-filesystem +boost-regex \
+boost-program_options +boost-date_time +libatomic +zlib
DEPENDS:=+libopenssl +boost +boost-system +boost-filesystem \
+boost-program_options +boost-date_time +libatomic +zlib
TITLE:=full-featured C++ implementation of I2P client TITLE:=full-featured C++ implementation of I2P client
URL:=https://github.com/PurpleI2P/i2pd URL:=https://github.com/PurpleI2P/i2pd
USERID:=i2pd:i2pd
MAINTAINER:=David Yang <mmyangfl@gmail.com> MAINTAINER:=David Yang <mmyangfl@gmail.com>
endef endef
@ -45,13 +46,22 @@ define Package/i2pd/conffiles
/etc/i2pd/tunnels.conf /etc/i2pd/tunnels.conf
endef endef
TARGET_LDFLAGS+=-latomic
MAKE_FLAGS+=USE_AESNI=no USE_AVX=no MAKE_FLAGS+=USE_AESNI=no USE_AVX=no
define Package/i2pd/install define Package/i2pd/install
$(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/i2pd $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/i2pd $(1)/usr/sbin
$(INSTALL_DIR) $(1)/usr/share/i2pd
$(CP) $(PKG_BUILD_DIR)/contrib/certificates $(1)/usr/share/i2pd
$(INSTALL_DIR) $(1)/etc/i2pd $(INSTALL_DIR) $(1)/etc/i2pd
$(LN) /usr/share/i2pd/certificates $(1)/etc/i2pd/certificates
$(LN) /var/lib/i2pd/peerProfiles $(1)/etc/i2pd/peerProfiles
$(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/i2pd.conf $(1)/etc/i2pd $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/i2pd.conf $(1)/etc/i2pd
$(SED) ' \
s/127.0.0.1/192.168.1.1/g; \
s/datadir = \/var\/lib/datadir = \/etc/ \
' $(1)/etc/i2pd/i2pd.conf
$(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/subscriptions.txt $(1)/etc/i2pd $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/subscriptions.txt $(1)/etc/i2pd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/tunnels.conf $(1)/etc/i2pd $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/tunnels.conf $(1)/etc/i2pd
$(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/etc/init.d


+ 28
- 4
net/i2pd/files/i2pd.init View File

@ -1,15 +1,39 @@
#!/bin/sh /etc/rc.common #!/bin/sh /etc/rc.common
# Copyright (C) 2017 OpenWrt.org # Copyright (C) 2017 OpenWrt.org
START=70
STOP=70
USE_PROCD=1 USE_PROCD=1
START=90
STOP=10
PROG=/usr/sbin/i2pd PROG=/usr/sbin/i2pd
USER="i2pd"
GROUP="i2pd"
PIDFILE=/var/run/i2pd.pid
DATADIR=/etc/i2pd
PEERDIR=/var/lib/i2pd/peerProfiles
start_service() { start_service() {
## RAM
if [ ! -d $PEERDIR ]; then
mkdir -p $PEERDIR
chown $USER:$GROUP $PEERDIR
fi
## We need permissions
chown -R $USER:$GROUP $DATADIR
touch $PIDFILE
chown $USER:adm $PIDFILE
procd_open_instance procd_open_instance
procd_set_param command $PROG --conf=/etc/i2pd/i2pd.conf
procd_set_param command $PROG --service --conf=/etc/i2pd/i2pd.conf
## Don't know about i2pd user's HOME
procd_set_param env HOME=$DATADIR
procd_set_param limits nofile=4096
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param user $USER
procd_set_param pidfile $PIDFILE
procd_close_instance procd_close_instance
} }

+ 0
- 11
net/i2pd/patches/010-cross-compile.patch View File

@ -1,11 +0,0 @@
--- a/Makefile.linux 2017-11-14 03:20:41.000000000 +0800
+++ b/Makefile.linux 2017-11-29 23:55:38.919136211 +0800
@@ -44,7 +44,7 @@
LDLIBS += -lpthread -static-libstdc++ -static-libgcc -lrt -ldl
USE_AESNI := no
else
- LDLIBS = -lcrypto -lssl -lz -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread
+ LDLIBS = -latomic -lcrypto -lssl -lz -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread
endif
# UPNP Support (miniupnpc 1.5 and higher)

Loading…
Cancel
Save