Browse Source

tor: package improvements

* remove "torify" script
  - "torify" script is just a wrapper around torsocks,
    but torsocks is not currently present in packages.
* tor-geoip: fix "install" recipe:
  - use $(INSTALL_DATA) instead of $(CP) as a proper way
    of installing files
* drop deprecated configure option:
    "--with-ssl-dir" is considered deprecated and obsolete,
    while "--with-openssl-dir" is already present.
* build in parallel
* build with -ffunction-sections, -fdata-sections,
  --gc-sections and -flto
* remove "--disable-largefile" in CONFIGURE_ARGS
* remove "-std=gnu99" in EXTRA_CFLAGS
* use $(FPIC) in EXTRA_CFLAGS
* remove trailing whitespace

Compile- and run-tested on ar71xx/generic,
TP-Link Archer C7 v2 (world-wide version).

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
lilik-openwrt-22.03
Konstantin Demin 6 years ago
committed by tripolar
parent
commit
b7603be359
1 changed files with 10 additions and 8 deletions
  1. +10
    -8
      net/tor/Makefile

+ 10
- 8
net/tor/Makefile View File

@ -20,6 +20,8 @@ PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de> \
PKG_LICENSE_FILES:=LICENSE PKG_LICENSE_FILES:=LICENSE
PKG_INSTALL:=1 PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
@ -68,7 +70,7 @@ endef
define Package/tor-resolve/description define Package/tor-resolve/description
$(call Package/tor/Default/description) $(call Package/tor/Default/description)
Resolve a hostname to an IP address via tor
Resolve a hostname to an IP address via tor
endef endef
define Package/tor-geoip define Package/tor-geoip
@ -90,25 +92,24 @@ endef
CONFIGURE_ARGS += \ CONFIGURE_ARGS += \
--with-libevent-dir="$(STAGING_DIR)/usr" \ --with-libevent-dir="$(STAGING_DIR)/usr" \
--with-ssl-dir="$(STAGING_DIR)/usr" \
--with-openssl-dir="$(STAGING_DIR)/usr" \ --with-openssl-dir="$(STAGING_DIR)/usr" \
--with-zlib-dir="$(STAGING_DIR)/usr" \ --with-zlib-dir="$(STAGING_DIR)/usr" \
--disable-asciidoc \ --disable-asciidoc \
--disable-seccomp \ --disable-seccomp \
--disable-libscrypt \ --disable-libscrypt \
--disable-unittests \ --disable-unittests \
--disable-largefile \
--disable-lzma \ --disable-lzma \
--with-tor-user=tor \ --with-tor-user=tor \
--with-tor-group=tor --with-tor-group=tor
EXTRA_CFLAGS += -std=gnu99
TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
TARGET_LDFLAGS += -Wl,--gc-sections -flto
ifneq ($(CONFIG_SSP_SUPPORT),y) ifneq ($(CONFIG_SSP_SUPPORT),y)
CONFIGURE_ARGS += \ CONFIGURE_ARGS += \
--disable-gcc-hardening --disable-gcc-hardening
else else
EXTRA_CFLAGS += -fPIC
EXTRA_CFLAGS += $(FPIC)
endif endif
CONFIGURE_VARS += \ CONFIGURE_VARS += \
@ -117,7 +118,6 @@ CONFIGURE_VARS += \
define Package/tor/install define Package/tor/install
$(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/torify $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
$(INSTALL_DIR) $(1)/etc/tor $(INSTALL_DIR) $(1)/etc/tor
@ -136,8 +136,10 @@ endef
define Package/tor-geoip/install define Package/tor-geoip/install
$(INSTALL_DIR) $(1)/usr/share/tor $(INSTALL_DIR) $(1)/usr/share/tor
$(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/
$(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip6 $(1)/usr/share/tor/
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)/usr/share/tor/geoip \
$(PKG_INSTALL_DIR)/usr/share/tor/geoip6 \
$(1)/usr/share/tor/
endef endef
$(eval $(call BuildPackage,tor)) $(eval $(call BuildPackage,tor))


Loading…
Cancel
Save