2013-08-29 15:21:13 +01:00
|
|
|
# CORE
|
|
|
|
# Top-level Makefile for CORE project.
|
|
|
|
#
|
|
|
|
|
|
|
|
if WANT_DOCS
|
2018-07-31 20:57:30 +01:00
|
|
|
DOCS = docs man
|
2013-08-29 15:21:13 +01:00
|
|
|
endif
|
2018-03-13 23:20:50 +00:00
|
|
|
|
2013-08-29 15:21:13 +01:00
|
|
|
if WANT_DAEMON
|
2020-07-14 19:40:20 +01:00
|
|
|
DAEMON = daemon
|
2013-08-29 15:21:13 +01:00
|
|
|
endif
|
2018-03-13 23:20:50 +00:00
|
|
|
|
2018-01-04 20:03:14 +00:00
|
|
|
if WANT_NETNS
|
2020-01-10 00:36:00 +00:00
|
|
|
NETNS = netns
|
2018-01-04 20:03:14 +00:00
|
|
|
endif
|
2013-08-29 15:21:13 +01:00
|
|
|
|
|
|
|
# keep docs last due to dependencies on binaries
|
2022-03-08 20:00:42 +00:00
|
|
|
SUBDIRS = $(DAEMON) $(NETNS) $(DOCS)
|
2013-08-29 15:21:13 +01:00
|
|
|
|
2018-03-13 23:20:50 +00:00
|
|
|
ACLOCAL_AMFLAGS = -I config
|
2013-08-29 15:21:13 +01:00
|
|
|
|
|
|
|
# extra files to include with distribution tarball
|
2018-03-13 23:20:50 +00:00
|
|
|
EXTRA_DIST = bootstrap.sh \
|
2022-07-28 00:00:10 +01:00
|
|
|
package \
|
2018-03-13 23:20:50 +00:00
|
|
|
LICENSE \
|
|
|
|
README.md \
|
|
|
|
ASSIGNMENT_OF_COPYRIGHT.pdf \
|
2019-06-10 23:37:32 +01:00
|
|
|
CHANGELOG.md \
|
2018-03-13 23:20:50 +00:00
|
|
|
.version \
|
|
|
|
.version.date
|
|
|
|
|
|
|
|
DISTCLEAN_TARGETS = aclocal.m4 config.h.in
|
2013-08-29 15:21:13 +01:00
|
|
|
|
|
|
|
# extra cruft to remove
|
2018-03-13 23:20:50 +00:00
|
|
|
DISTCLEANFILES = aclocal.m4 \
|
|
|
|
config.h.in \
|
|
|
|
configure \
|
|
|
|
Makefile.in \
|
|
|
|
config/compile
|
2013-08-29 15:21:13 +01:00
|
|
|
|
2018-03-13 23:20:50 +00:00
|
|
|
MAINTAINERCLEANFILES = .version \
|
|
|
|
.version.date
|
2016-01-29 16:23:03 +00:00
|
|
|
|
2020-01-07 20:48:54 +00:00
|
|
|
define fpm-distributed-deb =
|
|
|
|
fpm -s dir -t deb -n core-distributed \
|
|
|
|
-m "$(PACKAGE_MAINTAINERS)" \
|
|
|
|
--license "BSD" \
|
|
|
|
--description "Common Open Research Emulator Distributed Package" \
|
|
|
|
--url https://github.com/coreemu/core \
|
|
|
|
--vendor "$(PACKAGE_VENDOR)" \
|
2022-07-28 00:00:10 +01:00
|
|
|
-p core-distributed_VERSION_ARCH.deb \
|
2020-01-07 20:48:54 +00:00
|
|
|
-v $(PACKAGE_VERSION) \
|
|
|
|
-d "ethtool" \
|
|
|
|
-d "procps" \
|
|
|
|
-d "libc6 >= 2.14" \
|
|
|
|
-d "bash >= 3.0" \
|
2021-05-10 23:07:42 +01:00
|
|
|
-d "nftables" \
|
2020-01-07 20:48:54 +00:00
|
|
|
-d "iproute2" \
|
|
|
|
-d "libev4" \
|
|
|
|
-d "openssh-server" \
|
|
|
|
-d "xterm" \
|
2022-07-28 00:00:10 +01:00
|
|
|
netns/vnoded=/usr/bin/ \
|
|
|
|
netns/vcmd=/usr/bin/
|
2020-01-07 20:48:54 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define fpm-distributed-rpm =
|
|
|
|
fpm -s dir -t rpm -n core-distributed \
|
|
|
|
-m "$(PACKAGE_MAINTAINERS)" \
|
|
|
|
--license "BSD" \
|
|
|
|
--description "Common Open Research Emulator Distributed Package" \
|
|
|
|
--url https://github.com/coreemu/core \
|
|
|
|
--vendor "$(PACKAGE_VENDOR)" \
|
2022-07-28 00:00:10 +01:00
|
|
|
-p core-distributed_VERSION_ARCH.rpm \
|
2020-01-07 20:48:54 +00:00
|
|
|
-v $(PACKAGE_VERSION) \
|
|
|
|
-d "ethtool" \
|
|
|
|
-d "procps-ng" \
|
|
|
|
-d "bash >= 3.0" \
|
2021-05-10 23:07:42 +01:00
|
|
|
-d "nftables" \
|
2020-01-07 20:48:54 +00:00
|
|
|
-d "iproute" \
|
|
|
|
-d "libev" \
|
|
|
|
-d "net-tools" \
|
|
|
|
-d "openssh-server" \
|
|
|
|
-d "xterm" \
|
2022-07-28 00:00:10 +01:00
|
|
|
netns/vnoded=/usr/bin/ \
|
|
|
|
netns/vcmd=/usr/bin/
|
2020-01-07 20:48:54 +00:00
|
|
|
endef
|
|
|
|
|
2022-07-28 00:00:10 +01:00
|
|
|
define fpm-rpm =
|
|
|
|
fpm -s dir -t rpm -n core \
|
|
|
|
-m "$(PACKAGE_MAINTAINERS)" \
|
|
|
|
--license "BSD" \
|
|
|
|
--description "core vnoded/vcmd and system dependencies" \
|
|
|
|
--url https://github.com/coreemu/core \
|
|
|
|
--vendor "$(PACKAGE_VENDOR)" \
|
|
|
|
-p core_VERSION_ARCH.rpm \
|
|
|
|
-v $(PACKAGE_VERSION) \
|
|
|
|
--rpm-init package/core-daemon \
|
|
|
|
--after-install package/after-install.sh \
|
|
|
|
--after-remove package/after-remove.sh \
|
|
|
|
-d "ethtool" \
|
|
|
|
-d "tk" \
|
|
|
|
-d "procps-ng" \
|
|
|
|
-d "bash >= 3.0" \
|
|
|
|
-d "ebtables" \
|
|
|
|
-d "iproute" \
|
|
|
|
-d "libev" \
|
|
|
|
-d "net-tools" \
|
|
|
|
-d "nftables" \
|
|
|
|
netns/vnoded=/usr/bin/ \
|
|
|
|
netns/vcmd=/usr/bin/ \
|
|
|
|
package/etc/core.conf=/etc/core/ \
|
|
|
|
package/etc/logging.conf=/etc/core/ \
|
|
|
|
package/examples=/opt/core/ \
|
|
|
|
daemon/dist/core-$(PACKAGE_VERSION)-py3-none-any.whl=/opt/core/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define fpm-deb =
|
|
|
|
fpm -s dir -t deb -n core \
|
|
|
|
-m "$(PACKAGE_MAINTAINERS)" \
|
|
|
|
--license "BSD" \
|
|
|
|
--description "core vnoded/vcmd and system dependencies" \
|
|
|
|
--url https://github.com/coreemu/core \
|
|
|
|
--vendor "$(PACKAGE_VENDOR)" \
|
|
|
|
-p core_VERSION_ARCH.deb \
|
|
|
|
-v $(PACKAGE_VERSION) \
|
|
|
|
--deb-systemd package/core-daemon.service \
|
|
|
|
--deb-no-default-config-files \
|
|
|
|
--after-install package/after-install.sh \
|
|
|
|
--after-remove package/after-remove.sh \
|
|
|
|
-d "ethtool" \
|
|
|
|
-d "tk" \
|
|
|
|
-d "libtk-img" \
|
|
|
|
-d "procps" \
|
|
|
|
-d "libc6 >= 2.14" \
|
|
|
|
-d "bash >= 3.0" \
|
|
|
|
-d "ebtables" \
|
|
|
|
-d "iproute2" \
|
|
|
|
-d "libev4" \
|
|
|
|
-d "nftables" \
|
|
|
|
netns/vnoded=/usr/bin/ \
|
|
|
|
netns/vcmd=/usr/bin/ \
|
|
|
|
package/etc/core.conf=/etc/core/ \
|
|
|
|
package/etc/logging.conf=/etc/core/ \
|
|
|
|
package/examples=/opt/core/ \
|
|
|
|
daemon/dist/core-$(PACKAGE_VERSION)-py3-none-any.whl=/opt/core/
|
|
|
|
endef
|
|
|
|
|
|
|
|
.PHONY: fpm
|
|
|
|
fpm: clean-local-fpm
|
|
|
|
cd daemon && poetry build -f wheel
|
|
|
|
$(call fpm-deb)
|
|
|
|
$(call fpm-rpm)
|
2020-01-07 20:48:54 +00:00
|
|
|
$(call fpm-distributed-deb)
|
|
|
|
$(call fpm-distributed-rpm)
|
|
|
|
|
2018-01-04 18:09:35 +00:00
|
|
|
.PHONY: clean-local-fpm
|
|
|
|
clean-local-fpm:
|
|
|
|
-rm -rf *.deb
|
|
|
|
-rm -rf *.rpm
|
|
|
|
|
|
|
|
clean-local: clean-local-fpm
|
|
|
|
|
2016-01-29 16:23:03 +00:00
|
|
|
.version: Makefile
|
2018-03-13 23:20:50 +00:00
|
|
|
echo $(PACKAGE_VERSION) > $@
|
2016-01-26 22:01:23 +00:00
|
|
|
|
2016-01-29 16:23:03 +00:00
|
|
|
.version.date: Makefile
|
2018-03-13 23:20:50 +00:00
|
|
|
echo $(PACKAGE_DATE) > $@
|
|
|
|
|
|
|
|
define change-files =
|
|
|
|
$(info creating file $1 from $1.in)
|
|
|
|
@$(SED) -e 's,[@]sbindir[@],$(sbindir),g' \
|
|
|
|
-e 's,[@]bindir[@],$(bindir),g' \
|
|
|
|
-e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \
|
|
|
|
-e 's,[@]PACKAGE_DATE[@],$(PACKAGE_DATE),g' \
|
|
|
|
-e 's,[@]CORE_LIB_DIR[@],$(CORE_LIB_DIR),g' \
|
|
|
|
-e 's,[@]CORE_STATE_DIR[@],$(CORE_STATE_DIR),g' \
|
|
|
|
-e 's,[@]CORE_DATA_DIR[@],$(CORE_DATA_DIR),g' \
|
|
|
|
-e 's,[@]CORE_CONF_DIR[@],$(CORE_CONF_DIR),g' \
|
|
|
|
< $1.in > $1
|
|
|
|
endef
|
|
|
|
|
|
|
|
all: change-files
|
|
|
|
|
|
|
|
.PHONY: change-files
|
|
|
|
change-files:
|
|
|
|
$(call change-files,daemon/core/constants.py)
|
2019-03-25 17:44:47 +00:00
|
|
|
$(call change-files,netns/setup.py)
|
2018-03-15 21:31:07 +00:00
|
|
|
|
|
|
|
CORE_DOC_SRC = core-python-$(PACKAGE_VERSION)
|
|
|
|
.PHONY: doc
|
|
|
|
doc: doc-clean
|
|
|
|
$(MAKE) -C daemon/doc html
|
|
|
|
mv daemon/doc/_build/html daemon/doc/$(CORE_DOC_SRC)
|
|
|
|
tar -C daemon/doc -czf $(CORE_DOC_SRC).tgz $(CORE_DOC_SRC)
|
|
|
|
|
|
|
|
.PHONY: doc-clean
|
|
|
|
doc-clean:
|
|
|
|
-rm -rf daemon/doc/_build
|
|
|
|
-rm -rf daemon/doc/$(CORE_DOC_SRC)
|
|
|
|
-rm -f $(CORE_DOC_SRC).tgz
|