Add --disable-compose-tooling build option

Some downstreams want the ability to separate the compose tooling from
the client, for e.g. support reasons.

This approach supports generating a tarball without the source for the
compose command, and requires specifying a config option to disable
it.
This commit is contained in:
Colin Walters 2014-09-16 21:45:30 -04:00
parent a18bf1ac9f
commit 0f16e2e252
4 changed files with 34 additions and 15 deletions

View File

@ -45,15 +45,21 @@ librpmostree_la_LIBADD = $(AM_LDFLAGS) $(PKGDEP_RPMOSTREE_LIBS)
rpm_ostree_SOURCES = src/main.c \ rpm_ostree_SOURCES = src/main.c \
src/rpmostree-builtins.h \ src/rpmostree-builtins.h \
src/rpmostree-builtin-compose.c \
src/rpmostree-builtin-upgrade.c \ src/rpmostree-builtin-upgrade.c \
src/rpmostree-builtin-rollback.c \ src/rpmostree-builtin-rollback.c \
src/rpmostree-builtin-rebase.c \ src/rpmostree-builtin-rebase.c \
src/rpmostree-builtin-status.c \ src/rpmostree-builtin-status.c \
src/rpmostree-builtin-rpm.c \ src/rpmostree-builtin-rpm.c \
$(NULL)
if BUILDOPT_COMPOSE_TOOLING
rpm_ostree_SOURCES += \
src/rpmostree-compose-builtin-tree.c \ src/rpmostree-compose-builtin-tree.c \
src/rpmostree-compose-builtin-sign.c \ src/rpmostree-compose-builtin-sign.c \
src/rpmostree-builtin-compose.c \
$(NULL) $(NULL)
endif
rpm_ostree_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src -DPKGLIBDIR=\"$(pkglibdir)\" $(PKGDEP_RPMOSTREE_CFLAGS) rpm_ostree_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src -DPKGLIBDIR=\"$(pkglibdir)\" $(PKGDEP_RPMOSTREE_CFLAGS)
rpm_ostree_LDADD = $(AM_LDFLAGS) $(PKGDEP_RPMOSTREE_LIBS) librpmostree.la rpm_ostree_LDADD = $(AM_LDFLAGS) $(PKGDEP_RPMOSTREE_LIBS) librpmostree.la

View File

@ -52,6 +52,17 @@ AC_ARG_ENABLE(usrbinatomic,
[enable_usrbinatomic=no]) [enable_usrbinatomic=no])
AM_CONDITIONAL(BUILDOPT_USRBINATOMIC, [test x$enable_usrbinatomic = xyes]) AM_CONDITIONAL(BUILDOPT_USRBINATOMIC, [test x$enable_usrbinatomic = xyes])
dnl Some distributions may want to support the client tooling, but not
dnl the server side.
AC_ARG_ENABLE(compose-tooling,
AS_HELP_STRING([--enable-compose-tooling],
[Build compose tooling]),,
[enable_compose_tooling=yes])
AM_CONDITIONAL(BUILDOPT_COMPOSE_TOOLING, [test x$enable_compose_tooling = xyes])
AS_IF([test x$enable_compose_tooling = xyes], [
AC_DEFINE(HAVE_COMPOSE_TOOLING, 1, [Define if we are building compose tooling])
])
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
]) ])
@ -62,4 +73,5 @@ echo "
patched hawkey: $enable_patched_hawkey_and_libsolv patched hawkey: $enable_patched_hawkey_and_libsolv
usrbinatomic: $enable_usrbinatomic usrbinatomic: $enable_usrbinatomic
compose tooling: $enable_compose_tooling
" "

View File

@ -7,24 +7,23 @@ srcdir=$(shell pwd)
PACKAGE=rpm-ostree PACKAGE=rpm-ostree
PKG_VER = $(PACKAGE)-$(GITREV_FOR_PKG) PKG_VER = $(PACKAGE)-$(GITREV_FOR_PKG)
PKG_CLIENT_VER = $(PACKAGE)-client-$(GITREV_FOR_PKG)
dist-snapshot: dist-snapshot:
set -x; \ ./make-git-snapshot.sh "$(srcdir)" "$(PKG_VER)" "$(GITREV)"
echo "PACKAGE=$(PACKAGE)"; \ rm -f $(PKG_VER).tar.xz
TARFILE_TMP=$(PKG_VER).tar.tmp; \
echo "Archiving $(PACKAGE) at $(GITREV)"; \
(cd ..; git archive --format=tar --prefix=$(PKG_VER)/ $(GITREV)) > $${TARFILE_TMP}; \
(cd $$(git rev-parse --show-toplevel); git submodule status) | while read line; do \
rev=$$(echo $$line | cut -f 1 -d ' '); path=$$(echo $$line | cut -f 2 -d ' '); \
echo "Archiving $${path} at $${rev}"; \
(cd $(srcdir)/$$path; git archive --format=tar --prefix=$(PKG_VER)/$$path/ $${rev}) > submodule.tar; \
tar -A -f $${TARFILE_TMP} submodule.tar; \
rm submodule.tar; \
done; \
mv $(PKG_VER).tar{.tmp,}; \
rm -f $(PKG_VER).tar.xz; \
xz $(PKG_VER).tar xz $(PKG_VER).tar
dist-snapshot-without-compose-tooling:
./make-git-snapshot.sh "$(srcdir)" "$(PKG_CLIENT_VER)" "$(GITREV)"; \
rm tmp -rf; \
mkdir tmp; \
tar -C tmp -x "--exclude=$(PKG_CLIENT_VER)/src/*compose*" -f $(PKG_CLIENT_VER).tar; \
(cd tmp && tar -cf ../$(PKG_CLIENT_VER).tar.filtered *); \
mv $(PKG_CLIENT_VER).tar{.filtered,}; \
rm -f $(PKG_CLIENT_VER).tar.xz; \
xz $(PKG_CLIENT_VER).tar
srpm: dist-snapshot srpm: dist-snapshot
sed -e "s,^Version:.*,Version: $(GITREV_FOR_PKG)," $(PACKAGE).spec.in > $(PACKAGE).spec; \ sed -e "s,^Version:.*,Version: $(GITREV_FOR_PKG)," $(PACKAGE).spec.in > $(PACKAGE).spec; \
./rpmbuild-cwd -bs $(PACKAGE).spec ./rpmbuild-cwd -bs $(PACKAGE).spec

View File

@ -32,7 +32,9 @@
#include "libgsystem.h" #include "libgsystem.h"
static RpmOstreeCommand commands[] = { static RpmOstreeCommand commands[] = {
#ifdef HAVE_COMPOSE_TOOLING
{ "compose", rpmostree_builtin_compose, 0 }, { "compose", rpmostree_builtin_compose, 0 },
#endif
{ "upgrade", rpmostree_builtin_upgrade, 0 }, { "upgrade", rpmostree_builtin_upgrade, 0 },
{ "rebase", rpmostree_builtin_rebase, 0 }, { "rebase", rpmostree_builtin_rebase, 0 },
{ "rollback", rpmostree_builtin_rollback, 0 }, { "rollback", rpmostree_builtin_rollback, 0 },