autofoo: Fix trouble with test subdirectory in distributed source

Not having test in DIST_SUBDIRS cases trouble when running autoreconf
in the distributed source.
Now remove test stuff from the release tarball in dist-hook and add
dummy Makefile.am/in to make autoconf happy.
This commit is contained in:
Kim Woelders 2022-10-22 22:14:32 +02:00
parent f762a49c49
commit 489cf37b12
2 changed files with 8 additions and 4 deletions

View File

@ -9,7 +9,6 @@ endif
if BUILD_TEST
SUBDIRS += test
endif
DIST_SUBDIRS = src data doc
CLEANFILES = $(PACKAGE).spec
@ -27,14 +26,19 @@ EXTRA_DIST = AUTHORS COPYING COPYING-PLAIN \
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(PACKAGE).pc
dist-hook: $(top_builddir)/$(PACKAGE).spec
if [ -s $(distdir)/test/Makefile.am ]; then \
rm -f $(distdir)/test/*.*; \
touch $(distdir)/test/Makefile.am; \
cd $(top_srcdir) && $(AUTOMAKE) --foreign $(abs_builddir)/$(distdir)/test/Makefile; \
fi
if SRC_IS_GIT
RPM_RELEASE=`echo -n "1.%(date '+%y%m%d').git"; git rev-parse --short=8 HEAD`
else
RPM_RELEASE=`echo -n "1.%(date '+%y%m%d')"`
endif
dist-hook: $(top_builddir)/$(PACKAGE).spec
$(top_builddir)/$(PACKAGE).spec: FORCE
sed "s/\@PACKAGE\@/@PACKAGE@/;s/\@VERSION\@/@VERSION@/;s/\@RPM_RELEASE\@/$(RPM_RELEASE)/" \
$(top_srcdir)/$(PACKAGE).spec.in > $@

View File

@ -280,6 +280,7 @@ src/bin/Makefile
src/modules/Makefile
src/modules/filters/Makefile
src/modules/loaders/Makefile
test/Makefile
data/Makefile
data/fonts/Makefile
data/images/Makefile
@ -288,7 +289,6 @@ doc/Doxyfile
doc/imlib2_intro.dox
README
])
AM_COND_IF([SRC_IS_GIT], [ AC_CONFIG_FILES([test/Makefile]) ])
AC_OUTPUT
#####################################################################