]>
Commit | Line | Data |
---|---|---|
737afb35 | 1 | EXTRA_DIST = resources |
37345639 VB |
2 | EXTRA_DIST += distribution.xml.in im.bernat.lldpd.plist.in scripts/postinstall.in scripts/preinstall.in |
3 | TEMPLATES = distribution.xml im.bernat.lldpd.plist scripts/postinstall scripts/preinstall | |
b708297c VB |
4 | |
5 | if HOST_OS_OSX | |
6 | ||
7 | # What we need to build the package | |
8 | PKGBUILD=/usr/bin/pkgbuild | |
9 | PRODUCTBUILD=/usr/bin/productbuild | |
10 | requirements: | |
11 | @test -x $(PKGBUILD) || { echo "Needs pkgbuild ($(PKGBUILD))." ; exit 2 ; } | |
12 | @test -x $(PRODUCTBUILD) || { echo "Needs productbuild ($(PRODUCTBUILD))." ; exit 2 ; } | |
13 | ||
14 | PKG_NAME=@PACKAGE@-@VERSION@.pkg | |
15 | PKG_TITLE=@PACKAGE@ @VERSION@ | |
16 | PKG_DIR=@PACKAGE@-@VERSION@ | |
17 | ||
18 | # Main target is `pkg` | |
19 | pkg: 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 | 33 | pkg.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 |
45 | stamp-$(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 |
50 | if HAVE_LAUNCHDDAEMONSDIR |
51 | launchddaemons_DATA = im.bernat.lldpd.plist | |
52 | endif | |
b708297c | 53 | |
95493844 VB |
54 | CLEANFILES = $(TEMPLATES) |
55 | distribution.xml: distribution.xml.in | |
56 | im.bernat.lldpd.plist: im.bernat.lldpd.plist.in | |
57 | scripts/postinstall: scripts/postinstall.in | |
95493844 | 58 | scripts/preinstall: scripts/preinstall.in |
95493844 VB |
59 | include $(top_srcdir)/edit.am |
60 | ||
b708297c VB |
61 | .PHONY: pkg requirements |
62 | ||
63 | endif |