packaging: fix for installcheck

First, installcheck does not imply install. Packaging must
ask for both.

Second, installcheck of header files and libs must be aware
of DESTDIR. src/syncevo/installcheck-local.sh patches the -I and -L
parameters so that it includes the DESTDIR passed to it.

Third, "distbin" overwrites "prefix", which breaks this. Don't
try installcheck as part of that target.
This commit is contained in:
Patrick Ohly 2009-10-14 12:16:01 +02:00
parent 029265dd60
commit 71b899846b
3 changed files with 7 additions and 7 deletions

View File

@ -30,7 +30,7 @@ distbin : README NEWS COPYING $(TEST_README_FILES) INSTALL-tar-gz all
@ [ "$(BINSUFFIX)" ] || (echo "please invoke with e.g. 'make distbin BINSUFFIX=debian-3.1'"; exit 1 )
@ [ "$(prefix)" == "/usr" ] || (echo "please reconfigure with --prefix=/usr"; exit 1 )
rm -rf $(distdir)
$(MAKE) DESTDIR=`pwd`/$(distdir) installcheck
$(MAKE) DESTDIR=`pwd`/$(distdir) install installcheck
rm -rf $(call DEV_FILE_PATTERN,$(distdir),/usr)
for i in `find $(distdir) -type d | sort -r`; do rmdir $$i 2>/dev/null || true; done
mkdir -p $(distdir)/usr/share/doc/syncevolution
@ -44,7 +44,7 @@ else
distbin : README NEWS COPYING all
@ [ "$(BINSUFFIX)" ] || (echo "please invoke with e.g. 'make distbin BINSUFFIX=debian-3.1'"; exit 1 )
rm -rf $(distdir)
$(MAKE) prefix=`pwd`/$(distdir) installcheck
$(MAKE) prefix=`pwd`/$(distdir) install
echo removing developer files and empty directories
rm -rf $(call DEV_FILE_PATTERN,$(distdir),/)
for i in `find $(distdir) -type d | sort -r`; do rmdir $$i 2>/dev/null || true; done
@ -124,7 +124,7 @@ deb rpm : dist/$(distdir) dist/debian/control doc-pak description-pak
.PHONY: dist/$(distdir) clean_dist
dist/$(distdir): all
rm -rf $@
$(MAKE) installcheck DESTDIR=`pwd`/$@
$(MAKE) install installcheck DESTDIR=`pwd`/$@
rm -rf $(call DEV_FILE_PATTERN, $@)
clean-local: clean_dist
clean_dist:

View File

@ -126,5 +126,5 @@ SyncEvolutionXML.c: $(srcdir)/../syncclient_sample_config.xml
# make sure that the installed development files are usable
installcheck-local: $(srcdir)/installcheck-local.sh
env PKG_CONFIG_PATH=$(pkgconfigdir):$$PKG_CONFIG_PATH $< "$(libsyncevolution_includedir)"
env PKG_CONFIG_PATH=$(DESTDIR)/$(pkgconfigdir):$$PKG_CONFIG_PATH $< "$(DESTDIR)/$(libsyncevolution_includedir)" "$(DESTDIR)"
EXTRA_DIST += installcheck-local.sh

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# usage: PKG_CONFIG_PATH=... installcheck-local.sh <path to syncevo header files>
# usage: PKG_CONFIG_PATH=... installcheck-local.sh <path to syncevo header files> <DESTDIR>
set -ex
@ -44,8 +44,8 @@ int main(int argc, char **argv)
}
EOF
# header must be usable stand-alone
$CXX `pkg-config --cflags syncevolution` $TMPFILE_CXX -c -o $TMPFILE_O
$CXX `pkg-config --cflags syncevolution | sed -e "s;\(-[IL]\);\1$2;g"` $TMPFILE_CXX -c -o $TMPFILE_O
done
# link once to check that the lib is found
$CXX `pkg-config --libs syncevolution` $TMPFILE_O -o $TMPFILE
$CXX -v $TMPFILE_O -o $TMPFILE `pkg-config --libs syncevolution | sed -e "s;\(-[IL]\);\1$2;g"`