Skip to content

Commit

Permalink
Merge pull request #39 from qxj/bugfix/lib-avahi
Browse files Browse the repository at this point in the history
fix avahi compile error
  • Loading branch information
coolsnowwolf authored Mar 19, 2020
2 parents 28ba3b2 + 68cfeeb commit a90577f
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 147 deletions.
45 changes: 22 additions & 23 deletions libs/avahi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,22 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=avahi
PKG_VERSION:=0.7
PKG_RELEASE:=3
PKG_VERSION:=0.8
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/lathiat/avahi/releases/download/v$(PKG_VERSION) \
https://avahi.org/download
PKG_HASH:=57a99b5dfe7fdae794e3d1ee7a62973a368e91e414bd0dfa5d84434de5b14804
PKG_HASH:=060309d7a333d38d951bc27598c677af1796934dbd98e1024e7ad8de798fedda

PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=LGPL-2.1-or-later
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:avahi:avahi

PKG_BUILD_DEPENDS:=intltool/host
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=autogen.sh

PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1

ifeq ($(BUILD_VARIANT),dbus)
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/dbus/$(PKG_NAME)-$(PKG_VERSION)
else
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/nodbus/$(PKG_NAME)-$(PKG_VERSION)
endif

include $(INCLUDE_DIR)/package.mk

define Package/avahi/Default
Expand Down Expand Up @@ -259,22 +251,24 @@ $(call Package/avahi/Default/description)
endef

TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE
TARGET_LDFLAGS += $(if $(CONFIG_SSP_SUPPORT),-lssp_nonshared)

CONFIGURE_ARGS+= \
CONFIGURE_ARGS += \
--enable-shared \
--enable-static \
--disable-glib \
--disable-gobject \
--disable-introspection \
--disable-qt3 \
--disable-qt4 \
--disable-qt5 \
--disable-gtk \
--disable-gtk3 \
--with-xml=expat \
--disable-dbm \
--enable-gdbm \
--enable-libdaemon \
--disable-libevent \
--disable-python \
--disable-pygtk \
--disable-python-dbus \
--disable-mono \
--disable-monodoc \
Expand All @@ -288,18 +282,16 @@ CONFIGURE_ARGS+= \
--disable-doxygen-html \
--disable-doxygen-ps \
--disable-doxygen-pdf \
--disable-manpages \
--disable-xmltoman \
--disable-tests \
--with-xml=expat \
--with-distro=none \
--with-avahi-user=nobody \
--with-avahi-group=nogroup \
--with-autoipd-user=nobody \
--with-autoipd-group=nogroup

ifneq ($(CONFIG_SSP_SUPPORT),y)
CONFIGURE_ARGS+= \
--disable-stack-protector
endif

ifeq ($(BUILD_VARIANT),dbus)
ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
CONFIGURE_ARGS += \
Expand All @@ -314,7 +306,7 @@ endif

CONFIGURE_VARS+= \
CFLAGS="$$$$CFLAGS -DNDEBUG -DDISABLE_SYSTEMD" \
ac_cv_header_sys_capability_h=no \
ac_cv_header_sys_capability_h=no

define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
Expand All @@ -327,7 +319,14 @@ ifeq ($(BUILD_VARIANT),dbus)
endif
endif
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/avahi-core.pc
ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
ifeq ($(BUILD_VARIANT),dbus)
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/avahi-client.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/avahi-compat-libdns_sd.pc
endif
endif
endef

define Package/libavahi/install
Expand Down
25 changes: 10 additions & 15 deletions libs/avahi/files/avahi-daemon.init
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@
# Copyright (C) 2006 OpenWrt.org
START=61

BIN=avahi-daemon
DEFAULT=/etc/default/$BIN
OPTIONS="-D"
RUN_D=/var/run/$BIN
USE_PROCD=1
PROG=avahi-daemon

start() {
[ -f $DEFAULT ] && . $DEFAULT
mkdir -p $RUN_D
$BIN $OPTIONS
start_service() {
procd_open_instance
procd_set_param command "$PROG"
procd_append_param command -s
procd_set_param respawn
procd_close_instance
}

stop() {
$BIN -k
reload_service() {
procd_send_signal "$PROG"
}

reload() {
$BIN -r
}

2 changes: 1 addition & 1 deletion libs/avahi/files/netifd-autoip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ proto_autoip_setup() {
local iface="$2"

proto_export "INTERFACE=$config"
proto_run_command "$config" avahi-autoipd $iface
proto_run_command "$config" avahi-autoipd "$iface"
}

proto_autoip_teardown() {
Expand Down
88 changes: 0 additions & 88 deletions libs/avahi/patches/010-step_back_autotools-no-gettext.patch

This file was deleted.

25 changes: 5 additions & 20 deletions libs/avahi/patches/020-revert-runtime-dir-systemd-change.patch
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
From ef0ea001f6dd13d6a2e0bc17d13f595d2829f8a8 Mon Sep 17 00:00:00 2001
From: Jeremiah McConnell <miah@miah.com>
Date: Fri, 15 Jun 2018 11:31:10 -0600
Subject: [PATCH] move runtime_dir to /var/run

Upstream transitioned to using /run as runtime_dir for 0.7. Revert
that change for procd compatibility.

Signed-off-by: Jeremiah McConnell <miah@miah.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 72d61478..8f6e9768 100644
--- a/configure.ac
+++ b/configure.ac
@@ -984,7 +984,7 @@ AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_GROUP,"$AVAHI_AUTOIPD_GROUP", [Group for runnin
--- a/configure
+++ b/configure
@@ -24638,7 +24638,7 @@ _ACEOF
#
# Avahi runtime dir
#
-avahi_runtime_dir="/run"
+avahi_runtime_dir="${localstatedir}/run"
avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket"
AC_SUBST(avahi_runtime_dir)
AC_SUBST(avahi_socket)


0 comments on commit a90577f

Please sign in to comment.