summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am46
1 files changed, 38 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am
index c809131..ce3267f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,15 +41,49 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure configure-stamp \
$(distdir).tar.gz $(distdir).tar.bz2
SUBDIRS = lib src include doc contrib control
+IANA_PEN = http://www.iana.org/assignments/enterprise-numbers
dist-hook:
cp control/ipmitool.spec $(distdir)
-install-data-local:
+.PHONY: install-pen-database uninstall-pen-database
+.INTERMEDIATE: %.o %.la enterprise-numbers
+
+if DOWNLOAD
+
+enterprise-numbers:
+ @echo Downloading IANA PEN database...
+ @$(DOWNLOAD) "$(IANA_PEN)" > tmpfile.$$PPID || {\
+ echo "FAILED to download the IANA PEN database"; \
+ rm tmpfile.$$PPID; \
+ false; \
+ }
+ @mv tmpfile.$$PPID $@
+
+install-pen-database: enterprise-numbers
+ mkdir -m 755 -p $(DESTDIR)$(IANADIR)
+ $(INSTALL_DATA) $< $(DESTDIR)$(IANADIR)/
+
+uninstall-pen-database:
+ -rm -rf $(DESTDIR)$(IANADIR)/enterprise-numbers
+
+else
+
+install-pen-database:
+ @echo "*** NOT installing the IANA PEN database."
+ @echo "*** Don't know how to download it."
+
+uninstall-pen-database:
+ @echo "*** NOT uninstalling the IANA PEN database."
+ @echo "*** It was installed manually (if ever)."
+
+endif
+
+install-data-local: install-pen-database
mkdir -p $(DESTDIR)$(DOCDIR)
$(INSTALL_DATA) $(DOCLIST) $(DESTDIR)$(DOCDIR)
-uninstall-local:
+uninstall-local: uninstall-pen-database
-rm -rf $(DESTDIR)$(DOCDIR)
.PHONY: pkg
@@ -67,12 +101,8 @@ SRCDIR = ${shell cd $(top_srcdir) ; pwd | sed -e 's,^[^:\\/]:[\\/],/,'}
RPMDIR = $(BUILDDIR)/rpmbuild
.PHONY: rpm
-rpm: control/ipmitool.spec dist
- mkdir -p $(RPMDIR)/{BUILD,RPMS,SRPMS,SOURCES,SPECS,tmp}
- cp control/ipmitool.spec $(RPMDIR)/SPECS
- BUILDDIR=$(RPMDIR) CONFIGDIR=$(BUILDDIR)/control \
- @RPMBUILD@ -ba --rcfile $(SRCDIR)/control/rpmrc \
- $(RPMDIR)/SPECS/ipmitool.spec
+rpm: dist
+ @RPMBUILD@ -ta --define "_topdir $(RPMDIR)" $(distdir).tar.gz
.PHONY: clean-rpm
clean-rpm: