Working make check.

CVS patchset: 2466
CVS date: 1998/10/20 13:40:27
This commit is contained in:
jbj 1998-10-20 13:40:27 +00:00
parent 5fc8cb62a5
commit c98d94abb2
13 changed files with 181 additions and 23 deletions

View File

@ -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

View File

@ -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

View File

@ -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])

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 =

9
tests/hello-test/initdb Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
DBG=echo
rpm=${rpm:=rpm}
destdir="`pwd`"
destdir="`dirname $destdir`"
${DBGX} $rpm --initdb

11
tests/hello-test/showrc Executable file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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...

91
tests/macros.in Normal file
View File

@ -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@