diff --git a/net/i2pd/Makefile b/net/i2pd/Makefile index e78e7b0c3..95dea0b18 100644 --- a/net/i2pd/Makefile +++ b/net/i2pd/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=i2pd PKG_VERSION:=2.17.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BUILD_PARALLEL:=1 PKG_SOURCE_PROTO:=git @@ -26,10 +26,11 @@ include $(INCLUDE_DIR)/package.mk define Package/i2pd SECTION:=net 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 URL:=https://github.com/PurpleI2P/i2pd + USERID:=i2pd:i2pd MAINTAINER:=David Yang endef @@ -45,13 +46,22 @@ define Package/i2pd/conffiles /etc/i2pd/tunnels.conf endef +TARGET_LDFLAGS+=-latomic MAKE_FLAGS+=USE_AESNI=no USE_AVX=no define Package/i2pd/install $(INSTALL_DIR) $(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 + $(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 + $(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/tunnels.conf $(1)/etc/i2pd $(INSTALL_DIR) $(1)/etc/init.d diff --git a/net/i2pd/files/i2pd.init b/net/i2pd/files/i2pd.init index 36a19906f..f1c394a0e 100755 --- a/net/i2pd/files/i2pd.init +++ b/net/i2pd/files/i2pd.init @@ -1,15 +1,39 @@ #!/bin/sh /etc/rc.common # Copyright (C) 2017 OpenWrt.org -START=70 -STOP=70 - USE_PROCD=1 + +START=90 +STOP=10 + PROG=/usr/sbin/i2pd +USER="i2pd" +GROUP="i2pd" +PIDFILE=/var/run/i2pd.pid +DATADIR=/etc/i2pd +PEERDIR=/var/lib/i2pd/peerProfiles 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_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 } diff --git a/net/i2pd/patches/010-cross-compile.patch b/net/i2pd/patches/010-cross-compile.patch deleted file mode 100644 index 614de4ad2..000000000 --- a/net/i2pd/patches/010-cross-compile.patch +++ /dev/null @@ -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)