summaryrefslogtreecommitdiff
path: root/user/avahi
diff options
context:
space:
mode:
Diffstat (limited to 'user/avahi')
-rw-r--r--user/avahi/APKBUILD74
-rw-r--r--user/avahi/avahi.pre-install10
l---------user/avahi/avahi.pre-upgrade1
-rw-r--r--user/avahi/build-db49
4 files changed, 134 insertions, 0 deletions
diff --git a/user/avahi/APKBUILD b/user/avahi/APKBUILD
new file mode 100644
index 000000000..f1534a5e5
--- /dev/null
+++ b/user/avahi/APKBUILD
@@ -0,0 +1,74 @@
+# Contributor: A. Wilcox <awilfox@adelielinux.org>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=avahi
+pkgver=0.8
+pkgrel=0
+pkgdesc="Local network service discovery library"
+url="https://avahi.org/"
+arch="all"
+license="LGPL-2.1+"
+depends=""
+makedepends="dbus-dev expat-dev glib-dev gobject-introspection-dev
+ gtk+3.0-dev libdaemon-dev libevent-dev qt5-qtbase-dev doxygen
+ py3-dbus-python py3-pygobject-dev"
+pkgusers="avahi avahi-autoipd"
+pkggroups="avahi avahi-autoipd"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-openrc
+ $pkgname-gtk3 $pkgname-py3 $pkgname-qt5"
+install="$pkgname.pre-install $pkgname.pre-upgrade"
+source="https://avahi.org/download/avahi-$pkgver.tar.gz
+ build-db
+ "
+
+prepare() {
+ default_prepare
+ # Missing from release tarballs:
+ # https://github.com/lathiat/avahi/pull/281
+ mv "$srcdir"/build-db "$builddir"/service-type-database/
+}
+
+build() {
+ [ "$CBUILD_ARCH" = "$CTARGET_ARCH" ] || \
+ die "You cannot cross-build Avahi; dbm files are not portable."
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var \
+ --with-distro=gentoo \
+ --enable-core-docs \
+ --disable-mono \
+ --disable-gdbm
+ make
+}
+
+check() {
+ make check
+}
+
+package() {
+ make DESTDIR="$pkgdir" install
+}
+
+gtk3() {
+ pkgdesc="$pkgdesc (Gtk+ 3 bindings)"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libavahi*gtk3* "$subpkgdir"/usr/lib/
+}
+
+py3() {
+ pkgdesc="$pkgdesc (Python bindings)"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
+}
+
+qt5() {
+ pkgdesc="$pkgdesc (Qt 5 bindings)"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libavahi*qt5* "$subpkgdir"/usr/lib/
+}
+
+sha512sums="c6ba76feb6e92f70289f94b3bf12e5f5c66c11628ce0aeb3cadfb72c13a5d1a9bd56d71bdf3072627a76cd103b9b056d9131aa49ffe11fa334c24ab3b596c7de avahi-0.8.tar.gz
+60f5cab8417ba1f7ef9b3e30a9f33923fd71a11ae846dda9c29fd0327008821f55f6c77f8ef8442e6dd164d1b777d858cec95c31b7b3bc7f1121417620ca5f08 build-db"
diff --git a/user/avahi/avahi.pre-install b/user/avahi/avahi.pre-install
new file mode 100644
index 000000000..4d6a7d061
--- /dev/null
+++ b/user/avahi/avahi.pre-install
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+groupadd -r -g 201 avahi 2>/dev/null
+groupadd -r -g 202 avahi-autoipd 2>/dev/null
+useradd -c "Service Discovery User" -s /sbin/nologin -g avahi \
+ -d /var/empty -M -N -u 201 2>/dev/null
+useradd -c "IPv4LL network address configuration daemon" -s /sbin/nologin \
+ -g avahi-autoipd -d /var/empty -M -N -u 202 2>/dev/null
+
+exit 0
diff --git a/user/avahi/avahi.pre-upgrade b/user/avahi/avahi.pre-upgrade
new file mode 120000
index 000000000..6b36c801b
--- /dev/null
+++ b/user/avahi/avahi.pre-upgrade
@@ -0,0 +1 @@
+avahi.pre-install \ No newline at end of file
diff --git a/user/avahi/build-db b/user/avahi/build-db
new file mode 100644
index 000000000..78ee892f6
--- /dev/null
+++ b/user/avahi/build-db
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+# -*-python-*-
+# This file is part of avahi.
+#
+# avahi is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# avahi is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with avahi; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA.
+
+try:
+ import anydbm as dbm
+except ImportError:
+ import dbm
+
+import sys
+
+if len(sys.argv) > 1:
+ infn = sys.argv[1]
+else:
+ infn = "service-types"
+
+if len(sys.argv) > 2:
+ outfn = sys.argv[2]
+else:
+ outfn = infn + ".db"
+
+db = dbm.open(outfn, "n")
+
+for ln in open(infn, "r"):
+ ln = ln.strip(" \r\n\t")
+
+ if ln == "" or ln.startswith("#"):
+ continue
+
+ t, n = ln.split(":", 1)
+
+ db[t.strip()] = n.strip()
+
+db.close()