Default for builds from git is --with-image-minimizer and Fedora builds will have --without-image-minimizer Blacklisting (forceful removal of files and packages) is forbiden by Fedora Spin rules, so official oVirt Node Spin will not use it. --- configure.ac | 12 ++++++------ ovirt-node.spec.in | 2 +- recipe/Makefile.am | 1 + recipe/image-minimizer.ks.in | 11 +++++++++++ recipe/ovirt-node-image.ks.in | 12 +----------- 5 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 recipe/image-minimizer.ks.in diff --git a/configure.ac b/configure.ac index 057f968..495c880 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,5 @@ AC_INIT([ovirt-node], [2.0.1], [ovirt-devel at redhat.com]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability tar-pax]) -AC_PROG_CC AC_SUBST([FEDORA],[[`rpm --eval '%{fedora}'|sed 's/[^0-9]//g'`]]) AC_SUBST([RHEL], [[`rpm --eval '%{rhel}'|sed 's/[^0-9]//g'`]]) @@ -13,11 +12,11 @@ if test "$RHEL"; then DISTRO=rhevh$RHEL fi -AC_CONFIG_HEADERS([config.h]) - -# If using gcc and default CFLAGS, enable some warnings. -test x"$ac_ct_CC:$CFLAGS" = 'xgcc:-g -O2' \ - && CFLAGS="$CFLAGS -Wshadow -Wall -Werror" +AC_ARG_WITH([image-minimizer], [AC_HELP_STRING([--with-image-minimizer], + [enable aggresive reduction of the image size])], + [IMAGE_MINIMIZER="%include image-minimizer.ks"], + [IMAGE_MINIMIZER=""]) +AC_SUBST([IMAGE_MINIMIZER]) AC_CONFIG_FILES([Makefile augeas/Makefile @@ -28,6 +27,7 @@ AC_CONFIG_FILES([Makefile scripts/collectd.conf recipe/Makefile recipe/ovirt-node-image.ks + recipe/image-minimizer.ks ovirt-node.spec ]) AC_OUTPUT diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in index 33a903d..76a5d77 100644 --- a/ovirt-node.spec.in +++ b/ovirt-node.spec.in @@ -80,7 +80,7 @@ however on a development machine to help to build the image. %build aclocal && autoheader && automake --add-missing && autoconf -%configure +%configure --with-image-minimizer make %install diff --git a/recipe/Makefile.am b/recipe/Makefile.am index 87b0c68..060fa19 100644 --- a/recipe/Makefile.am +++ b/recipe/Makefile.am @@ -47,6 +47,7 @@ EXTRA_DIST = \ *-minimizer.ks \ common-nochroot.ks \ common-manifest.ks \ + image-minimizer.ks.in \ $(PACKAGE).ks.in \ $(PACKAGE).ks diff --git a/recipe/image-minimizer.ks.in b/recipe/image-minimizer.ks.in new file mode 100644 index 0000000..2518c5c --- /dev/null +++ b/recipe/image-minimizer.ks.in @@ -0,0 +1,11 @@ +%post --nochroot --interpreter image-minimizer +%include common-minimizer.ks +%include @DISTRO at -minimizer.ks +%end + +%post +echo "Removing python source files" +find / -name '*.py' -exec rm -f {} \; +find / -name '*.pyo' -exec rm -f {} \; + +%end diff --git a/recipe/ovirt-node-image.ks.in b/recipe/ovirt-node-image.ks.in index 5eaa813..a24275c 100644 --- a/recipe/ovirt-node-image.ks.in +++ b/recipe/ovirt-node-image.ks.in @@ -21,17 +21,7 @@ %end -%post --nochroot --interpreter image-minimizer -%include common-minimizer.ks -%include @DISTRO at -minimizer.ks -%end - -%post -echo "Removing python source files" -find / -name '*.py' -exec rm -f {} \; -find / -name '*.pyo' -exec rm -f {} \; - -%end + at IMAGE_MINIMIZER@ %include common-manifest.ks -- 1.7.3.4