]> git.ipfire.org Git - thirdparty/lldpd.git/blame - osx/Makefile.am
osx: workaround issues with SIP on El Capitan
[thirdparty/lldpd.git] / osx / Makefile.am
CommitLineData
737afb35 1EXTRA_DIST = resources
37345639
VB
2EXTRA_DIST += distribution.xml.in im.bernat.lldpd.plist.in scripts/postinstall.in scripts/preinstall.in
3TEMPLATES = distribution.xml im.bernat.lldpd.plist scripts/postinstall scripts/preinstall
b708297c
VB
4
5if HOST_OS_OSX
6
7# What we need to build the package
8PKGBUILD=/usr/bin/pkgbuild
9PRODUCTBUILD=/usr/bin/productbuild
10requirements:
11 @test -x $(PKGBUILD) || { echo "Needs pkgbuild ($(PKGBUILD))." ; exit 2 ; }
12 @test -x $(PRODUCTBUILD) || { echo "Needs productbuild ($(PRODUCTBUILD))." ; exit 2 ; }
13
14PKG_NAME=@PACKAGE@-@VERSION@.pkg
15PKG_TITLE=@PACKAGE@ @VERSION@
16PKG_DIR=@PACKAGE@-@VERSION@
17
18# Main target is `pkg`
19pkg: requirements ../$(PKG_NAME)
20 @echo "The package has been built in ../$(PKG_NAME)."
21
22# This is the package (to be built with productbuild)
23../$(PKG_NAME): pkg.1/$(PKG_NAME) distribution.xml resources
24 $(PRODUCTBUILD) \
25 --distribution distribution.xml \
26 --resources resources \
27 --package-path pkg.1 \
28 --version @VERSION@ \
29 $@
30
31# This is a component. We only have one. We could have more and
32# provide optional components to be installed.
d8f0544d 33pkg.1/$(PKG_NAME): $(PKG_DIR) scripts/postinstall scripts/preinstall
b708297c 34 [ -d pkg.1 ] || mkdir pkg.1
10607bcc 35 chmod +x scripts/postinstall scripts/preinstall
b708297c
VB
36 $(PKGBUILD) \
37 --root $(PKG_DIR) \
38 --identifier im.bernat.@PACKAGE@.daemon \
39 --version @VERSION@ \
40 --ownership recommended \
41 --scripts scripts \
42 $@
fa71a00c 43
b708297c 44$(PKG_DIR): stamp-$(PKG_DIR)
737afb35
VB
45stamp-$(PKG_DIR): im.bernat.lldpd.plist
46 $(MAKE) -C .. install DESTDIR=$(abs_builddir)/$(PKG_DIR)
b708297c
VB
47 touch $@
48
49# Install launchd plist
4dfe31fd
VB
50if HAVE_LAUNCHDDAEMONSDIR
51launchddaemons_DATA = im.bernat.lldpd.plist
52endif
b708297c 53
95493844
VB
54CLEANFILES = $(TEMPLATES)
55distribution.xml: distribution.xml.in
56im.bernat.lldpd.plist: im.bernat.lldpd.plist.in
57scripts/postinstall: scripts/postinstall.in
95493844 58scripts/preinstall: scripts/preinstall.in
95493844
VB
59include $(top_srcdir)/edit.am
60
b708297c
VB
61.PHONY: pkg requirements
62
63endif