From c98d94abb2ed545771c23729cc5a9be26cde3d24 Mon Sep 17 00:00:00 2001 From: jbj Date: Tue, 20 Oct 1998 13:40:27 +0000 Subject: [PATCH] Working make check. CVS patchset: 2466 CVS date: 1998/10/20 13:40:27 --- Makefile.am | 10 ++++- Makefile.in | 10 ++++- configure.in | 2 +- tests/Makefile.am | 3 ++ tests/Makefile.in | 9 ++++- tests/hello-test/Makefile.am | 6 +-- tests/hello-test/Makefile.in | 6 +-- tests/hello-test/initdb | 9 +++++ tests/hello-test/showrc | 11 ++++++ tests/hello-test/showrc.exp | 29 ++++++++++++++ tests/hello-test/test0 | 12 +++--- tests/hello-test/test0.exp | 6 +-- tests/macros.in | 91 ++++++++++++++++++++++++++++++++++++++++++++ 13 files changed, 181 insertions(+), 23 deletions(-) create mode 100755 tests/hello-test/initdb create mode 100755 tests/hello-test/showrc create mode 100644 tests/hello-test/showrc.exp create mode 100644 tests/macros.in diff --git a/Makefile.am b/Makefile.am index 775ca86..9a83fcb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -48,9 +48,17 @@ rpmconvert_SOURCES = convertdb.c oldrpmdb.c rpmconvert_LDADD = -lrpmbuild -lpopt -lrpm -lgdbm install-data-local: - @$(mkinstalldirs) $(DESTDIR)/var/tmp $(DESTDIR)/var/lib/rpm + @$(mkinstalldirs) $(DESTDIR)/var/lib/rpm @rm -f $(DESTDIR)/$(libdir)/rpmrc && ln -s rpm/rpmrc $(DESTDIR)/$(libdir)/rpmrc @rm -f $(DESTDIR)/$(libdir)/rpmpopt && ln -s rpm/rpmpopt $(DESTDIR)/$(libdir)/rpmpopt + @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/BUILD + @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/noarch + @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/`uname -m` + @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SOURCES + @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SPECS + @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SRPMS + @$(mkinstalldirs) $(DESTDIR)/var/lib/rpm + @$(mkinstalldirs) $(DESTDIR)/var/tmp # FIXME: these should be generated in configure.in find-requires: find-requires.sh diff --git a/Makefile.in b/Makefile.in index 2c2e05f..523663b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -693,9 +693,17 @@ rpm.o: rpm.c include ./Makefile.inc install-data-local: - @$(mkinstalldirs) $(DESTDIR)/var/tmp $(DESTDIR)/var/lib/rpm + @$(mkinstalldirs) $(DESTDIR)/var/lib/rpm @rm -f $(DESTDIR)/$(libdir)/rpmrc && ln -s rpm/rpmrc $(DESTDIR)/$(libdir)/rpmrc @rm -f $(DESTDIR)/$(libdir)/rpmpopt && ln -s rpm/rpmpopt $(DESTDIR)/$(libdir)/rpmpopt + @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/BUILD + @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/noarch + @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/`uname -m` + @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SOURCES + @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SPECS + @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SRPMS + @$(mkinstalldirs) $(DESTDIR)/var/lib/rpm + @$(mkinstalldirs) $(DESTDIR)/var/tmp # FIXME: these should be generated in configure.in find-requires: find-requires.sh diff --git a/configure.in b/configure.in index d0e92cf..37a7f9f 100644 --- a/configure.in +++ b/configure.in @@ -629,6 +629,6 @@ export LIBS INCPATH AC_CONFIG_SUBDIRS(popt) AC_OUTPUT([Makefile Makefile.inc lib-rpmrc macros lib/Makefile build/Makefile tools/Makefile scripts/Makefile - tests/Makefile tests/rpmrc tests/hello-test/Makefile + tests/Makefile tests/rpmrc tests/macros tests/hello-test/Makefile misc/Makefile po/Makefile.in intl/Makefile], [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) diff --git a/tests/Makefile.am b/tests/Makefile.am index 28bf210..166c28e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -7,6 +7,9 @@ check-recursive: ./usr/ ./bin ./var ./usr ./bin ./var: ../rpm make -C .. DESTDIR=`pwd` install + cp rpmrc macros ./$(pkglibdir) + ln -s @GZIPBIN@ ./@GZIPBIN@ + ln -s @BZIP2BIN@ ./@BZIP2BIN@ clean-local: rm -rf ./usr ./bin ./var diff --git a/tests/Makefile.in b/tests/Makefile.in index b66a464..3f3ba13 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -119,8 +119,8 @@ EXTRA_DIST = SUBDIRS = hello-test mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h -CONFIG_CLEAN_FILES = rpmrc -DIST_COMMON = Makefile.am Makefile.in rpmrc.in +CONFIG_CLEAN_FILES = rpmrc macros +DIST_COMMON = Makefile.am Makefile.in macros.in rpmrc.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) @@ -139,6 +139,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) rpmrc: $(top_builddir)/config.status rpmrc.in cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status +macros: $(top_builddir)/config.status macros.in + cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -302,6 +304,9 @@ check-recursive: ./usr/ ./bin ./var ./usr ./bin ./var: ../rpm make -C .. DESTDIR=`pwd` install + cp rpmrc macros ./$(pkglibdir) + ln -s @GZIPBIN@ ./@GZIPBIN@ + ln -s @BZIP2BIN@ ./@BZIP2BIN@ clean-local: rm -rf ./usr ./bin ./var diff --git a/tests/hello-test/Makefile.am b/tests/hello-test/Makefile.am index e84ae5f..a162f55 100644 --- a/tests/hello-test/Makefile.am +++ b/tests/hello-test/Makefile.am @@ -2,8 +2,8 @@ all: -noinst_SCRIPTS = test0 +noinst_SCRIPTS = initdb showrc test0 -TESTS_ENVIRONMENT = rpm="${top_builddir}/rpm --rcfile ${top_builddir}/tests/rpmrc" +TESTS_ENVIRONMENT = rpm="${top_builddir}/rpm --rcfile ${top_builddir}/tests/$(pkglibdir)/rpmrc" -TESTS = test0 +TESTS = initdb showrc test0 diff --git a/tests/hello-test/Makefile.in b/tests/hello-test/Makefile.in index 03ddf3a..8d25133 100644 --- a/tests/hello-test/Makefile.in +++ b/tests/hello-test/Makefile.in @@ -115,11 +115,11 @@ testdir = @testdir@ tmpdir = @tmpdir@ varprefix = @varprefix@ -noinst_SCRIPTS = test0 +noinst_SCRIPTS = initdb showrc test0 -TESTS_ENVIRONMENT = rpm="${top_builddir}/rpm --rcfile ${top_builddir}/tests/rpmrc" +TESTS_ENVIRONMENT = rpm="${top_builddir}/rpm --rcfile ${top_builddir}/tests/$(pkglibdir)/rpmrc" -TESTS = test0 +TESTS = initdb showrc test0 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../../config.h CONFIG_CLEAN_FILES = diff --git a/tests/hello-test/initdb b/tests/hello-test/initdb new file mode 100755 index 0000000..88a7a2c --- /dev/null +++ b/tests/hello-test/initdb @@ -0,0 +1,9 @@ +#!/bin/sh + +DBG=echo + +rpm=${rpm:=rpm} +destdir="`pwd`" +destdir="`dirname $destdir`" + +${DBGX} $rpm --initdb diff --git a/tests/hello-test/showrc b/tests/hello-test/showrc new file mode 100755 index 0000000..ccf0522 --- /dev/null +++ b/tests/hello-test/showrc @@ -0,0 +1,11 @@ +#!/bin/sh + +DBG=echo + +rpm=${rpm:=rpm} +destdir="`pwd`" +destdir="`dirname $destdir`" + +${DBGX} $rpm --showrc 2>&1 | sed -e "s,$destdir,," > showrc.out + +diff showrc.out showrc.exp || exit 1 diff --git a/tests/hello-test/showrc.exp b/tests/hello-test/showrc.exp new file mode 100644 index 0000000..25646cc --- /dev/null +++ b/tests/hello-test/showrc.exp @@ -0,0 +1,29 @@ +ARCHITECTURE AND OS: +build arch : sparc +compatible build archs: sparc noarch +build os : Linux +compatible build os's : linux +install arch : sparc +install os : Linux +compatible archs : sparc noarch +compatible os's : linux + +RPMRC VALUES: +builddir : /usr/src/redhat/BUILD +buildshell : /bin/sh +bzip2bin : /usr/bin/bzip2 +dbpath : /var/lib/rpm +defaultdocdir : /usr/doc +fixperms : a+rX,g-w,o-w +gzipbin : /bin/gzip +instchangelog : 5 +macrofiles : /usr/lib/rpm/macros +optflags : -O2 +rpmdir : /usr/src/redhat/RPMS +rpmfilename : %{ARCH}/%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm +signature : none +sourcedir : /usr/src/redhat/SOURCES +specdir : /usr/src/redhat/SPECS +srcrpmdir : /usr/src/redhat/SRPMS +tmppath : /var/tmp +topdir : /usr/src/redhat diff --git a/tests/hello-test/test0 b/tests/hello-test/test0 index 83ba27d..1957bb5 100755 --- a/tests/hello-test/test0 +++ b/tests/hello-test/test0 @@ -6,13 +6,11 @@ rpm=${rpm:=rpm} destdir="`pwd`" destdir="`dirname $destdir`" -${DBGX} $rpm --initdb -${DBGX} $rpm --showrc - -#${DBGX} $rpm -ta hello-1.0-tar.gz - cp hello-1.0.tar.gz ../usr/src/redhat/SOURCES zcat hello-1.0.tar.gz | tar xOf - \*.spec > ../usr/src/redhat/SPECS/hello.spec -${DBGX} $rpm -ba ../usr/src/redhat/SPECS/hello.spec 2>&1 | sed -e "s,$destdir,," > test0.out -exit 0 +${DBGX} $rpm -ba ../usr/src/redhat/SPECS/hello.spec 2>&1 | \ + sed -e "s,$destdir,,g" -e '/^make\[[0-9][0-9]*\]:/d' > test0.out + +diff test0.out test0.exp || exit 1 + diff --git a/tests/hello-test/test0.exp b/tests/hello-test/test0.exp index f2d2015..45b5ea4 100644 --- a/tests/hello-test/test0.exp +++ b/tests/hello-test/test0.exp @@ -15,9 +15,7 @@ Executing: %build + cd /usr/src/redhat/BUILD + cd hello-1.0 + make -make[2]: Entering directory `/usr/src/redhat/BUILD/hello-1.0' -make[2]: Nothing to be done for `all'. -make[2]: Leaving directory `/usr/src/redhat/BUILD/hello-1.0' +cc hello.c -o hello + exit 0 Executing: %install + umask 022 @@ -26,9 +24,7 @@ Executing: %install + rm -rf /var/tmp/hello-root + mkdir -p /var/tmp/hello-root/usr/local/bin + make DESTDIR=/var/tmp/hello-root install -make[2]: Entering directory `/usr/src/redhat/BUILD/hello-1.0' install -m 0755 hello /var/tmp/hello-root/usr/local/bin -make[2]: Leaving directory `/usr/src/redhat/BUILD/hello-1.0' + exit 0 Processing files: hello Finding provides... diff --git a/tests/macros.in b/tests/macros.in new file mode 100644 index 0000000..d483ba5 --- /dev/null +++ b/tests/macros.in @@ -0,0 +1,91 @@ +#============================================================================== +# Macro naming conventions (preliminary): +# +# Macros that begin with an underscore are "local" in the sense that +# they (if used) will not be exported in rpm headers. +# + +#============================================================================== +# ---- filesystem macros. +# +%_usr @testdir@@prefix@ +%_usrsrc %{_usr}/src +%_var @testdir@@varprefix@ + +#============================================================================== +# ---- path macros +# +%__bzip2 %(which bzip2) +%__cat %(which cat) +%__chgrp %(which chgrp) +%__chmod %(which chmod) +%__chown %(which chown) +%__gzip %(which gzip) +%__install %(which install) +%__make %(which make) +%__mkdir %(which mkdir) +%__patch %(which patch) +%__ranlib %(which ranlib) +%__rm %(which rm) +%__strip %(which strip) +%__tar %(which tar) + +#============================================================================== +# ---- rpmrc macros. +# Macros that are initialized as a side effect of rpmrc parsing. +# These are the default values that will be overridden by any +# explicit values found in /usr/lib/rpm/rpmrc or /etc/rpmrc. +# +%_buildarch Unknown +%_builddir %{_topdir}/BUILD +%_buildos Linux +%_bzip2bin @BZIP2BIN@ +%_dbpath %{_var}/lib/rpm +%_defaultdocdir %{_usr}/doc +%_fixperms @FIXPERMS@ +%_gzipbin @GZIPBIN@ +%_rpmdir %{_topdir}/RPMS +%_rpmfilename %{ARCH}/%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm +%_sourcedir %{_topdir}/SOURCES +%_specdir %{_topdir}/SPECS +%_srcrpmdir %{_topdir}/SRPMS +%_tmppath %{_var}/tmp +%_topdir %{_usrsrc}/redhat +%optflags -O2 + +#============================================================================== +# ---- script environment macros. +# Macro(s) that establish the environment for running a script. +# +%_preScriptEnvironment \ + RPM_SOURCE_DIR=\"%{_sourcedir}\"\ + RPM_BUILD_DIR=\"%{_builddir}\"\ + RPM_OPT_FLAGS=\"%{optflags}\"\ + RPM_ARCH=\"%{arch}\"\ + RPM_OS=\"%{os}\"\ + export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\ + RPM_DOC_DIR=\"%{_docdir}\"\ + export RPM_DOC_DIR\ + RPM_PACKAGE_NAME=\"%{name}\"\ + RPM_PACKAGE_VERSION=\"%{version}\"\ + RPM_PACKAGE_RELEASE=\"%{release}\"\ + export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\ + %{?buildroot:RPM_BUILD_ROOT=\"%{buildroot}\"\ + export RPM_BUILD_ROOT\ + } + +#============================================================================== +# ---- configure macros. +# Macro(s) similar to those used by configure. +# +%_build @build@ +%_build_alias @build_alias@ +%_build_cpu @build_cpu@ +%_build_vendor @build_vendor@ +%_build_os @build_os@ +%_host @host@ +%_host_alias @host_alias@ +%_host_cpu @host_cpu@ +%_host_vendor @host_vendor@ +%_host_os @host_os@ +%_prefix @prefix@ -- 2.7.4