summaryrefslogtreecommitdiffstats
path: root/osx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:02:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:02:34 +0000
commitfadeddfbb2aa38a980dd959b5ec1ffba7afd43cb (patch)
treea7bde6111c84ea64619656a38fba50909fa0bf60 /osx
parentInitial commit. (diff)
downloadlldpd-fadeddfbb2aa38a980dd959b5ec1ffba7afd43cb.tar.xz
lldpd-fadeddfbb2aa38a980dd959b5ec1ffba7afd43cb.zip
Adding upstream version 1.0.18.upstream/1.0.18upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--osx/Makefile.am76
-rw-r--r--osx/Makefile.in673
-rw-r--r--osx/distribution.xml.in27
-rw-r--r--osx/im.bernat.lldpd.plist.in14
-rwxr-xr-xosx/lipo60
-rw-r--r--osx/resources/conclusion.html25
-rw-r--r--osx/resources/license.html25
-rw-r--r--osx/resources/welcome.html23
-rwxr-xr-xosx/scripts/postinstall.in29
-rwxr-xr-xosx/scripts/preinstall.in7
10 files changed, 959 insertions, 0 deletions
diff --git a/osx/Makefile.am b/osx/Makefile.am
new file mode 100644
index 0000000..7f152e1
--- /dev/null
+++ b/osx/Makefile.am
@@ -0,0 +1,76 @@
+EXTRA_DIST = resources lipo
+EXTRA_DIST += distribution.xml.in im.bernat.lldpd.plist.in scripts/postinstall.in scripts/preinstall.in
+TEMPLATES = distribution.xml im.bernat.lldpd.plist scripts/postinstall scripts/preinstall
+
+if HOST_OS_OSX
+
+# What we need to build the package
+PKGBUILD=/usr/bin/pkgbuild
+PRODUCTBUILD=/usr/bin/productbuild
+requirements:
+ @test -x $(PKGBUILD) || { echo "Needs pkgbuild ($(PKGBUILD))." ; exit 2 ; }
+ @test -x $(PRODUCTBUILD) || { echo "Needs productbuild ($(PRODUCTBUILD))." ; exit 2 ; }
+
+PKG_NAME=@PACKAGE@-@VERSION@.pkg
+PKG_TITLE=@PACKAGE@ @VERSION@
+PKG_DIR=@PACKAGE@-@VERSION@
+ARCHS=@host_cpu@
+
+# Main target is `pkg`
+pkg: requirements ../$(PKG_NAME)
+ @echo "The package has been built in ../$(PKG_NAME)."
+
+# This is the package (to be built with productbuild)
+../$(PKG_NAME): pkg.1/$(PKG_NAME) distribution.xml resources
+ $(PRODUCTBUILD) \
+ --distribution distribution.xml \
+ --resources resources \
+ --package-path pkg.1 \
+ --version @VERSION@ \
+ $@
+
+# This is a component. We only have one. We could have more and
+# provide optional components to be installed.
+pkg.1/$(PKG_NAME): $(PKG_DIR) scripts/postinstall scripts/preinstall
+ [ -d pkg.1 ] || mkdir pkg.1
+ chmod +x scripts/postinstall scripts/preinstall
+ $(PKGBUILD) \
+ --root $(PKG_DIR) \
+ --identifier im.bernat.@PACKAGE@.daemon \
+ --version @VERSION@ \
+ --ownership recommended \
+ --scripts scripts \
+ $@
+
+$(PKG_DIR): stamp-$(PKG_DIR)
+stamp-$(PKG_DIR): $(ARCHS:%=%/$(PKG_DIR))
+ $(srcdir)/lipo $(PKG_DIR) $^
+ touch $@
+
+pkg_curarch = $(@:stamp-%=%)
+$(ARCHS:%=%/$(PKG_DIR)): %/$(PKG_DIR): stamp-%
+$(ARCHS:%=stamp-%): stamp-%: im.bernat.lldpd.plist
+ [ -d $(pkg_curarch) ] || mkdir -p $(pkg_curarch)
+ (cd $(pkg_curarch) && \
+ $(abs_top_srcdir)/configure @CONFIGURE_ARGS@ \
+ CC="@CC@ -arch $(pkg_curarch)" \
+ CPP="@CPP@")
+ (cd $(pkg_curarch) && \
+ $(MAKE) install DESTDIR=$(abs_builddir)/$(pkg_curarch)/$(PKG_DIR))
+ touch $@
+
+# Install launchd plist
+if HAVE_LAUNCHDDAEMONSDIR
+launchddaemons_DATA = im.bernat.lldpd.plist
+endif
+
+CLEANFILES = $(TEMPLATES)
+distribution.xml: distribution.xml.in
+im.bernat.lldpd.plist: im.bernat.lldpd.plist.in
+scripts/postinstall: scripts/postinstall.in
+scripts/preinstall: scripts/preinstall.in
+include $(top_srcdir)/edit.am
+
+.PHONY: pkg requirements
+
+endif
diff --git a/osx/Makefile.in b/osx/Makefile.in
new file mode 100644
index 0000000..423c95d
--- /dev/null
+++ b/osx/Makefile.in
@@ -0,0 +1,673 @@
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = osx
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/alignof.m4 \
+ $(top_srcdir)/m4/args.m4 \
+ $(top_srcdir)/m4/ax_build_date_epoch.m4 \
+ $(top_srcdir)/m4/ax_cflags_gcc_option.m4 \
+ $(top_srcdir)/m4/ax_ld_check_flag.m4 \
+ $(top_srcdir)/m4/ax_lib_readline.m4 \
+ $(top_srcdir)/m4/ax_prog_doxygen.m4 \
+ $(top_srcdir)/m4/config_subdirs.m4 \
+ $(top_srcdir)/m4/ld-version-script.m4 \
+ $(top_srcdir)/m4/libcap.m4 $(top_srcdir)/m4/libevent.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/os.m4 \
+ $(top_srcdir)/m4/progname.m4 $(top_srcdir)/m4/seccomp.m4 \
+ $(top_srcdir)/m4/snmp.m4 $(top_srcdir)/m4/stdint.m4 \
+ $(top_srcdir)/m4/systemtap.m4 $(top_srcdir)/m4/xml2.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(launchddaemonsdir)"
+DATA = $(launchddaemons_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/edit.am
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPARMORDIR = @APPARMORDIR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONFIGURE_ARGS = @CONFIGURE_ARGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@
+DSYMUTIL = @DSYMUTIL@
+DTRACE = @DTRACE@
+DUMPBIN = @DUMPBIN@
+DX_CONFIG = @DX_CONFIG@
+DX_DOCDIR = @DX_DOCDIR@
+DX_DOT = @DX_DOT@
+DX_DOXYGEN = @DX_DOXYGEN@
+DX_DVIPS = @DX_DVIPS@
+DX_EGREP = @DX_EGREP@
+DX_ENV = @DX_ENV@
+DX_FLAG_chi = @DX_FLAG_chi@
+DX_FLAG_chm = @DX_FLAG_chm@
+DX_FLAG_doc = @DX_FLAG_doc@
+DX_FLAG_dot = @DX_FLAG_dot@
+DX_FLAG_html = @DX_FLAG_html@
+DX_FLAG_man = @DX_FLAG_man@
+DX_FLAG_pdf = @DX_FLAG_pdf@
+DX_FLAG_ps = @DX_FLAG_ps@
+DX_FLAG_rtf = @DX_FLAG_rtf@
+DX_FLAG_xml = @DX_FLAG_xml@
+DX_HHC = @DX_HHC@
+DX_LATEX = @DX_LATEX@
+DX_MAKEINDEX = @DX_MAKEINDEX@
+DX_PDFLATEX = @DX_PDFLATEX@
+DX_PERL = @DX_PERL@
+DX_PROJECT = @DX_PROJECT@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ETAGS = @ETAGS@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FILECMD = @FILECMD@
+FUZZ_DECODE_ENGINE = @FUZZ_DECODE_ENGINE@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LAUNCHDDAEMONSDIR = @LAUNCHDDAEMONSDIR@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LLDPD_CTL_SOCKET = @LLDPD_CTL_SOCKET@
+LLDPD_PID_FILE = @LLDPD_PID_FILE@
+LLDP_BIN_LDFLAGS = @LLDP_BIN_LDFLAGS@
+LLDP_CFLAGS = @LLDP_CFLAGS@
+LLDP_CPPFLAGS = @LLDP_CPPFLAGS@
+LLDP_LDFLAGS = @LLDP_LDFLAGS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NETLINK_MAX_RECEIVE_BUFSIZE = @NETLINK_MAX_RECEIVE_BUFSIZE@
+NETLINK_RECEIVE_BUFSIZE = @NETLINK_RECEIVE_BUFSIZE@
+NETLINK_SEND_BUFSIZE = @NETLINK_SEND_BUFSIZE@
+NETSNMP_CFLAGS = @NETSNMP_CFLAGS@
+NETSNMP_CONFIG = @NETSNMP_CONFIG@
+NETSNMP_LIBS = @NETSNMP_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PRIVSEP_CHROOT = @PRIVSEP_CHROOT@
+PRIVSEP_GROUP = @PRIVSEP_GROUP@
+PRIVSEP_USER = @PRIVSEP_USER@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYSTEMDSYSTEMUNITDIR = @SYSTEMDSYSTEMUNITDIR@
+SYSUSERSDIR = @SYSUSERSDIR@
+VERSION = @VERSION@
+XML2_CONFIG = @XML2_CONFIG@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+apparmordir = @apparmordir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+check_CFLAGS = @check_CFLAGS@
+check_LIBS = @check_LIBS@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+launchddaemonsdir = @launchddaemonsdir@
+libbsd_CFLAGS = @libbsd_CFLAGS@
+libbsd_LIBS = @libbsd_LIBS@
+libcap_CFLAGS = @libcap_CFLAGS@
+libcap_LIBS = @libcap_LIBS@
+libdir = @libdir@
+libevent_CFLAGS = @libevent_CFLAGS@
+libevent_LDFLAGS = @libevent_LDFLAGS@
+libevent_LIBS = @libevent_LIBS@
+libexecdir = @libexecdir@
+libseccomp_CFLAGS = @libseccomp_CFLAGS@
+libseccomp_LIBS = @libseccomp_LIBS@
+libxml2_CFLAGS = @libxml2_CFLAGS@
+libxml2_LIBS = @libxml2_LIBS@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgconfigdir = @pkgconfigdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
+sysusersdir = @sysusersdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = resources lipo distribution.xml.in \
+ im.bernat.lldpd.plist.in scripts/postinstall.in \
+ scripts/preinstall.in
+TEMPLATES = distribution.xml im.bernat.lldpd.plist scripts/postinstall scripts/preinstall
+
+# What we need to build the package
+@HOST_OS_OSX_TRUE@PKGBUILD = /usr/bin/pkgbuild
+@HOST_OS_OSX_TRUE@PRODUCTBUILD = /usr/bin/productbuild
+@HOST_OS_OSX_TRUE@PKG_NAME = @PACKAGE@-@VERSION@.pkg
+@HOST_OS_OSX_TRUE@PKG_TITLE = @PACKAGE@ @VERSION@
+@HOST_OS_OSX_TRUE@PKG_DIR = @PACKAGE@-@VERSION@
+@HOST_OS_OSX_TRUE@ARCHS = @host_cpu@
+@HOST_OS_OSX_TRUE@pkg_curarch = $(@:stamp-%=%)
+
+# Install launchd plist
+@HAVE_LAUNCHDDAEMONSDIR_TRUE@@HOST_OS_OSX_TRUE@launchddaemons_DATA = im.bernat.lldpd.plist
+@HOST_OS_OSX_TRUE@CLEANFILES = $(TEMPLATES)
+@HOST_OS_OSX_TRUE@edit = $(SED) \
+@HOST_OS_OSX_TRUE@ -e 's|@bindir[@]|$(bindir)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@sbindir[@]|$(sbindir)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@libdir[@]|$(libdir)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@srcdir[@]|$(srcdir)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@top_builddir[@]|$(top_builddir)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@includedir[@]|$(includedir)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@exec_prefix[@]|$(exec_prefix)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@prefix[@]|$(prefix)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@VERSION[@]|$(VERSION)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@PACKAGE[@]|$(PACKAGE)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@PACKAGE_URL[@]|$(PACKAGE_URL)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@PRIVSEP_USER[@]|$(PRIVSEP_USER)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@PRIVSEP_GROUP[@]|$(PRIVSEP_GROUP)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@PRIVSEP_CHROOT[@]|$(PRIVSEP_CHROOT)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@LLDPD_PID_FILE[@]|$(LLDPD_PID_FILE)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@LLDPD_CTL_SOCKET[@]|$(LLDPD_CTL_SOCKET)|g' \
+@HOST_OS_OSX_TRUE@ -e 's|@PRIVSEP_CHROOT[@]|$(PRIVSEP_CHROOT)|g'
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/edit.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign osx/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign osx/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+$(top_srcdir)/edit.am $(am__empty):
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-launchddaemonsDATA: $(launchddaemons_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(launchddaemons_DATA)'; test -n "$(launchddaemonsdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(launchddaemonsdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(launchddaemonsdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(launchddaemonsdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(launchddaemonsdir)" || exit $$?; \
+ done
+
+uninstall-launchddaemonsDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(launchddaemons_DATA)'; test -n "$(launchddaemonsdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(launchddaemonsdir)'; $(am__uninstall_files_from_dir)
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(launchddaemonsdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-launchddaemonsDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-launchddaemonsDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ cscopelist-am ctags-am distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am \
+ install-launchddaemonsDATA install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
+ uninstall-am uninstall-launchddaemonsDATA
+
+.PRECIOUS: Makefile
+
+@HOST_OS_OSX_TRUE@requirements:
+@HOST_OS_OSX_TRUE@ @test -x $(PKGBUILD) || { echo "Needs pkgbuild ($(PKGBUILD))." ; exit 2 ; }
+@HOST_OS_OSX_TRUE@ @test -x $(PRODUCTBUILD) || { echo "Needs productbuild ($(PRODUCTBUILD))." ; exit 2 ; }
+
+# Main target is `pkg`
+@HOST_OS_OSX_TRUE@pkg: requirements ../$(PKG_NAME)
+@HOST_OS_OSX_TRUE@ @echo "The package has been built in ../$(PKG_NAME)."
+
+# This is the package (to be built with productbuild)
+@HOST_OS_OSX_TRUE@../$(PKG_NAME): pkg.1/$(PKG_NAME) distribution.xml resources
+@HOST_OS_OSX_TRUE@ $(PRODUCTBUILD) \
+@HOST_OS_OSX_TRUE@ --distribution distribution.xml \
+@HOST_OS_OSX_TRUE@ --resources resources \
+@HOST_OS_OSX_TRUE@ --package-path pkg.1 \
+@HOST_OS_OSX_TRUE@ --version @VERSION@ \
+@HOST_OS_OSX_TRUE@ $@
+
+# This is a component. We only have one. We could have more and
+# provide optional components to be installed.
+@HOST_OS_OSX_TRUE@pkg.1/$(PKG_NAME): $(PKG_DIR) scripts/postinstall scripts/preinstall
+@HOST_OS_OSX_TRUE@ [ -d pkg.1 ] || mkdir pkg.1
+@HOST_OS_OSX_TRUE@ chmod +x scripts/postinstall scripts/preinstall
+@HOST_OS_OSX_TRUE@ $(PKGBUILD) \
+@HOST_OS_OSX_TRUE@ --root $(PKG_DIR) \
+@HOST_OS_OSX_TRUE@ --identifier im.bernat.@PACKAGE@.daemon \
+@HOST_OS_OSX_TRUE@ --version @VERSION@ \
+@HOST_OS_OSX_TRUE@ --ownership recommended \
+@HOST_OS_OSX_TRUE@ --scripts scripts \
+@HOST_OS_OSX_TRUE@ $@
+
+@HOST_OS_OSX_TRUE@$(PKG_DIR): stamp-$(PKG_DIR)
+@HOST_OS_OSX_TRUE@stamp-$(PKG_DIR): $(ARCHS:%=%/$(PKG_DIR))
+@HOST_OS_OSX_TRUE@ $(srcdir)/lipo $(PKG_DIR) $^
+@HOST_OS_OSX_TRUE@ touch $@
+@HOST_OS_OSX_TRUE@$(ARCHS:%=%/$(PKG_DIR)): %/$(PKG_DIR): stamp-%
+@HOST_OS_OSX_TRUE@$(ARCHS:%=stamp-%): stamp-%: im.bernat.lldpd.plist
+@HOST_OS_OSX_TRUE@ [ -d $(pkg_curarch) ] || mkdir -p $(pkg_curarch)
+@HOST_OS_OSX_TRUE@ (cd $(pkg_curarch) && \
+@HOST_OS_OSX_TRUE@ $(abs_top_srcdir)/configure @CONFIGURE_ARGS@ \
+@HOST_OS_OSX_TRUE@ CC="@CC@ -arch $(pkg_curarch)" \
+@HOST_OS_OSX_TRUE@ CPP="@CPP@")
+@HOST_OS_OSX_TRUE@ (cd $(pkg_curarch) && \
+@HOST_OS_OSX_TRUE@ $(MAKE) install DESTDIR=$(abs_builddir)/$(pkg_curarch)/$(PKG_DIR))
+@HOST_OS_OSX_TRUE@ touch $@
+@HOST_OS_OSX_TRUE@distribution.xml: distribution.xml.in
+@HOST_OS_OSX_TRUE@im.bernat.lldpd.plist: im.bernat.lldpd.plist.in
+@HOST_OS_OSX_TRUE@scripts/postinstall: scripts/postinstall.in
+@HOST_OS_OSX_TRUE@scripts/preinstall: scripts/preinstall.in
+
+@HOST_OS_OSX_TRUE@$(TEMPLATES): Makefile
+@HOST_OS_OSX_TRUE@ $(AM_V_GEN)$(MKDIR_P) $(@D) && $(edit) $(srcdir)/$@.in > $@.tmp && mv $@.tmp $@
+
+@HOST_OS_OSX_TRUE@.PHONY: pkg requirements
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/osx/distribution.xml.in b/osx/distribution.xml.in
new file mode 100644
index 0000000..29bb881
--- /dev/null
+++ b/osx/distribution.xml.in
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!-- The documentation for this file is available here:
+ https://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html -->
+<installer-gui-script minSpecVersion="1">
+ <title>@PACKAGE@ @VERSION@</title>
+ <organization>im.bernat.@PACKAGE@</organization>
+ <welcome file="welcome.html" mime-type="text/html" />
+ <license file="license.html" mime-type="text/html" />
+ <conclusion file="conclusion.html" mime-type="text/html" />
+ <options customize="never" require-scripts="true" rootVolumeOnly="true" />
+ <choices-outline>
+ <line choice="im.bernat.@PACKAGE@.daemon"/>
+ </choices-outline>
+ <choice
+ id="im.bernat.@PACKAGE@.daemon"
+ visible="false"
+ title="lldpd daemon"
+ description="The LLDP daemon and its client."
+ start_selected="true">
+ <pkg-ref id="im.bernat.@PACKAGE@.daemon"/>
+ </choice>
+ <pkg-ref
+ id="im.bernat.@PACKAGE@.daemon"
+ version="0"
+ onConclusion="none"
+ auth="root">@PACKAGE@-@VERSION@.pkg</pkg-ref>
+</installer-gui-script>
diff --git a/osx/im.bernat.lldpd.plist.in b/osx/im.bernat.lldpd.plist.in
new file mode 100644
index 0000000..447399e
--- /dev/null
+++ b/osx/im.bernat.lldpd.plist.in
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>im.bernat.lldpd</string>
+ <key>ProgramArguments</key>
+ <array>
+ <string>@sbindir@/lldpd</string>
+ </array>
+ <key>RunAtLoad</key><true/>
+ <key>KeepAlive</key><true/>
+</dict>
+</plist>
diff --git a/osx/lipo b/osx/lipo
new file mode 100755
index 0000000..80e658a
--- /dev/null
+++ b/osx/lipo
@@ -0,0 +1,60 @@
+#!/usr/bin/env python3
+
+"""Apply lipo recursively to trees.
+"""
+
+import sys
+import os
+import shutil
+import subprocess
+
+# Parse arguments
+import argparse
+
+parser = argparse.ArgumentParser(
+ description=sys.modules[__name__].__doc__,
+ formatter_class=argparse.RawDescriptionHelpFormatter,
+)
+parser.add_argument("output", help="Output tree")
+parser.add_argument("input", help="Input trees", nargs="+")
+options = parser.parse_args()
+output = options.output
+inputs = options.input
+
+
+def ismacho(path):
+ """Check if a file is Mach-O"""
+ fnull = open(os.devnull, "w")
+ try:
+ subprocess.check_call(["lipo", "-info", path], stdout=fnull, stderr=fnull)
+ except subprocess.CalledProcessError:
+ return False
+ return True
+
+
+# Copy
+for root, dirs, files in os.walk(inputs[0]):
+ # Create root directory in output
+ oroot = root[len(inputs[0]) :].lstrip("/")
+ oroot = os.path.join(output, oroot)
+ if not os.path.isdir(oroot):
+ os.makedirs(oroot)
+ shutil.copystat(root, oroot)
+
+ # Copy files
+ for f in files:
+ of = os.path.join(oroot, f)
+ f = os.path.join(root, f)
+ if os.path.islink(f):
+ # Symlink
+ linkto = os.readlink(f)
+ os.symlink(linkto, of)
+ elif ismacho(f):
+ sff = [os.path.join(r, f[len(inputs[0]) :].lstrip("/")) for r in inputs]
+ args = ["lipo", "-create", "-output", of]
+ args.extend(sff)
+ subprocess.check_call(args)
+ else:
+ # Regular file, just copy from the first input directory
+ shutil.copyfile(f, of)
+ shutil.copystat(f, of)
diff --git a/osx/resources/conclusion.html b/osx/resources/conclusion.html
new file mode 100644
index 0000000..7dc33b5
--- /dev/null
+++ b/osx/resources/conclusion.html
@@ -0,0 +1,25 @@
+<html>
+ <body style="font-family: Gill Sans, sans-serif">
+ <h1>Installation of <i>lldpd</i> is successful!</h1>
+
+ <p>
+ <code>lldpd</code> should already be running. You can check if
+ it discovered any neighbor by using <code>lldpctl</code>
+ command-line tool.
+ </p>
+
+ <p>
+ For more information, have a look at the following manual pages:
+ <ul>
+ <li><code>lldpd(8)</code></li>
+ <li><code>lldpcli(8)</code></li>
+ </ul>
+ <p>
+
+ <p>
+ If you want to modify the way <code>lldpd</code> is invoked, you
+ have to
+ modify <code>/Library/LaunchDaemons/im.bernat.lldpd.plist</code>.
+ </p>
+ </body>
+</html>
diff --git a/osx/resources/license.html b/osx/resources/license.html
new file mode 100644
index 0000000..1689fc8
--- /dev/null
+++ b/osx/resources/license.html
@@ -0,0 +1,25 @@
+<html>
+ <body style="font-family: Gill Sans, sans-serif">
+ <p>
+ Copyright &copy; 2013-2016 <a href="mailto:bernat@luffy.cx">Vincent Bernat</a>
+ </p>
+
+ <p>
+ Permission to use, copy, modify, and/or distribute this software
+ for any purpose with or without fee is hereby granted, provided
+ that the above copyright notice and this permission notice
+ appear in all copies.
+ </p>
+
+ <p>
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
+ CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ </p>
+ </body>
+</html>
diff --git a/osx/resources/welcome.html b/osx/resources/welcome.html
new file mode 100644
index 0000000..8d8f9c3
--- /dev/null
+++ b/osx/resources/welcome.html
@@ -0,0 +1,23 @@
+<html>
+ <body style="font-family: Gill Sans, sans-serif">
+ <h1><i>lldpd</i>: a 802.1ab implementation</h1>
+ <p>
+ <abbr>LLDP</abbr> allows you to know exactly on which port is a
+ server (and reciprocally).
+ </p>
+
+ <p>
+ It is an industry standard protocol designed to supplant
+ proprietary Link-Layer protocols such as <abbr>EDP</abbr>
+ or <abbr>CDP</abbr>. The goal of <abbr>LLDP</abbr> is to provide
+ an inter-vendor compatible mechanism to deliver Link-Layer
+ notifications to adjacent network devices.
+ </p>
+
+ <p>
+ <code>lldpd</code> is an ISC-licensed implementation
+ of <abbr>LLDP</abbr> for various Unixes. It also supports some
+ proprietary protocols.
+ </p>
+ </body>
+</html>
diff --git a/osx/scripts/postinstall.in b/osx/scripts/postinstall.in
new file mode 100755
index 0000000..9a21e74
--- /dev/null
+++ b/osx/scripts/postinstall.in
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+set -e
+
+user="@PRIVSEP_USER@"
+group="@PRIVSEP_GROUP@"
+
+dscl=/usr/bin/dscl
+$dscl . -read "/Users/${user}" &> /dev/null || {
+ # We need to find a free UID/GID
+ uid=200
+ while $($dscl . -list /Users uid | grep -q "\b${uid}$") || \
+ $($dscl . -list /Groups gid | grep -q "\b${uid}$"); do
+ uid=$((${uid} + 1))
+ done
+ $dscl . -create /Groups/${group}
+ $dscl . -create /Groups/${group} PrimaryGroupID ${uid}
+ $dscl . -create /Groups/${group} Password "*"
+ $dscl . -create /Groups/${group} RealName "lldpd privilege separation group"
+ $dscl . -create /Users/${user}
+ $dscl . -create /Users/${user} UserShell /usr/bin/false
+ $dscl . -create /Users/${user} NFSHomeDirectory /var/empty
+ $dscl . -create /Users/${user} PrimaryGroupID ${uid}
+ $dscl . -create /Users/${user} UniqueID ${uid}
+ $dscl . -create /Users/${user} Password "*"
+ $dscl . -create /Users/${user} RealName "lldpd privilege separation user"
+}
+
+/bin/launchctl load "/Library/LaunchDaemons/im.bernat.lldpd.plist"
diff --git a/osx/scripts/preinstall.in b/osx/scripts/preinstall.in
new file mode 100755
index 0000000..bb73125
--- /dev/null
+++ b/osx/scripts/preinstall.in
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -e
+
+if /bin/launchctl list "im.bernat.lldpd" &> /dev/null; then
+ /bin/launchctl unload "/Library/LaunchDaemons/im.bernat.lldpd.plist"
+fi