diff --git a/.gitignore b/.gitignore index e69de29..e23304d 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,6 @@ +/gdbm-1.14.tar.gz +/gdbm-1.14.1.tar.gz +/gdbm-1.16.tar.gz +/gdbm-1.17.tar.gz +/gdbm-1.18.tar.gz +/gdbm-1.18.1.tar.gz diff --git a/STAGE2-gdbm b/STAGE2-gdbm new file mode 100644 index 0000000..c71b121 --- /dev/null +++ b/STAGE2-gdbm @@ -0,0 +1,11 @@ +# awful hack to prevent running aclocal ... FIXME +(cd $SRC/gdbm-*/m4 && [ -f libtool.m4.orig ] && rm -f libtool.m4 && mv libtool.m4.orig libtool.m4) || echo "" + +mcd $BUILDDIR/gdbm + +echo "Current in: $PWD" + +$SRC/gdbm-*/configure $TCONFIGARGS + +make $J +make $J install diff --git a/gdbm.spec b/gdbm.spec new file mode 100644 index 0000000..6c8c5be --- /dev/null +++ b/gdbm.spec @@ -0,0 +1,438 @@ +%bcond_with largefile + +Summary: A GNU set of database routines which use extensible hashing +Name: gdbm +Version: 1.18.1 +Release: 5%{?dist} +Epoch: 1 +License: GPLv3+ +URL: http://www.gnu.org/software/gdbm/ + +Source: http://ftp.gnu.org/gnu/gdbm/gdbm-%{version}.tar.gz + +BuildRequires: gcc +BuildRequires: libtool +BuildRequires: gettext +BuildRequires: readline-devel + + +Patch0:gdbm_gcc_10.patch + +# when -libs subpkg was introduced +Obsoletes: gdbm < 1:1.14.1-4 + +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} + +%description +Gdbm is a GNU database indexing library, including routines which use +extensible hashing. Gdbm works in a similar way to standard UNIX dbm +routines. Gdbm is useful for developers who write C applications and +need access to a simple and efficient database or who are building C +applications which will use such a database. + +If you're a C developer and your programs need access to simple +database routines, you should install gdbm. You'll also need to +install gdbm-devel. + +%package libs +Summary: Libraries files for gdbm +# when -libs subpkg was introduced +Obsoletes: gdbm < 1:1.14.1-4 + +%description libs +Libraries for the Gdbm GNU database indexing library + +%package devel +Summary: Development libraries and header files for the gdbm library +Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} +Requires(post): info +Requires(preun): info + +%description devel +Gdbm-devel contains the development libraries and header files for +gdbm, the GNU database system. These libraries and header files are +necessary if you plan to do development using the gdbm database. + +Install gdbm-devel if you are developing C programs which will use the +gdbm database library. You'll also need to install the gdbm package. + +%prep +%setup -q + +%patch0 -p1 + +%build +%configure \ + --disable-static \ +%{!?with_largefile: --disable-largefile} \ + --disable-rpath \ + --enable-libgdbm-compat + +# get rid of rpath (as per https://fedoraproject.org/wiki/Packaging:Guidelines#Beware_of_Rpath) +# currently --disable-rpath doesn't work for gdbm_dump|load, gdbmtool and libgdbm_compat.so.4 +# https://puszcza.gnu.org.ua/bugs/index.php?359 +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool + +%make_build + +%install +%make_install + +%find_lang %{name} + +# create symlinks for compatibility +mkdir -p $RPM_BUILD_ROOT/%{_includedir}/gdbm +ln -sf ../gdbm.h $RPM_BUILD_ROOT/%{_includedir}/gdbm/gdbm.h +ln -sf ../ndbm.h $RPM_BUILD_ROOT/%{_includedir}/gdbm/ndbm.h +ln -sf ../dbm.h $RPM_BUILD_ROOT/%{_includedir}/gdbm/dbm.h + +# Remove libtool archives +find %{buildroot} -type f -name "*.la" -delete + +rm -f $RPM_BUILD_ROOT/%{_infodir}/dir + +%check +export LD_LIBRARY_PATH=`pwd`/src/.libs/:`pwd`/compat/.libs/ +make check + +%ldconfig_scriptlets libs + +%files -f %{name}.lang +%doc NEWS README THANKS AUTHORS NOTE-WARNING +%{_bindir}/gdbm* +%{_mandir}/man1/gdbm* + +%files libs +%license COPYING +%{_libdir}/libgdbm.so.6* +%{_libdir}/libgdbm_compat.so.4* + +%files devel +%{_libdir}/libgdbm.so +%{_libdir}/libgdbm_compat.so +%{_includedir}/* +%{_infodir}/*.info* +%{_mandir}/man3/* + +%changelog +* Mon Jul 27 2020 Fedora Release Engineering - 1:1.18.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jul 13 2020 Tom Stellard - 1:1.18.1-4 +- Use make macros +- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro + +* Fri Feb 7 2020 Filip Januš - 1.18.1-3 +- Resolves: #1799391 +- After upgrade GCC to version gcc version 10.0.1 build fails +- Patch gdbm_gcc_10.patch was added + +* Tue Jan 28 2020 Fedora Release Engineering - 1:1.18.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Sun Oct 13 2019 Christian Stadelmann +- Remove outdated comments from spec file + +* Mon Sep 23 2019 Filip Janus - 1.18.1-1 +- Upstream released 1.18.1 bug(#1706639) +- Remove old patches + +* Thu Jul 25 2019 Fedora Release Engineering - 1:1.18-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sun Feb 17 2019 Igor Gnatenko - 1:1.18-4 +- Rebuild for readline 8.0 + +* Thu Jan 31 2019 Fedora Release Engineering - 1:1.18-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Mon Oct 01 2018 Rex Dieter - 1.18-2 +- Add Obsoletes to better handle upgrade path from before -libs was introduced + +* Tue Sep 25 2018 mskalick@redhat.com +- Rebase to latest release 1.18 +- Fix issues found by coverity + +* Tue Aug 21 2018 mskalick@redhat.com - 1:1.17-2 +- Fix directory entry validation - fails qsf test suite + +* Tue Aug 07 2018 mskalick@redhat.com - 1:1.17-1 +- Rebase to upstream release 1.17 + +* Fri Jul 13 2018 Fedora Release Engineering - 1:1.16-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Thu Jun 28 2018 mskalick@redhat.com - 1:1.16-1 +- Rebase to latest release 1.16 + +* Wed Jun 20 2018 mskalick@redhat.com - 1:1.15-1 +- Rebase to latest upstream relase 1.15 + +* Mon Mar 12 2018 Peter Robinson a 1:1.14.1-4 +- Split libraries out to separate libs subpackage +- Minor spec cleanups + +* Wed Feb 07 2018 Fedora Release Engineering - 1:1.14.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sat Feb 03 2018 Igor Gnatenko - 1:1.14.1-2 +- Switch to %%ldconfig_scriptlets + +* Mon Jan 29 2018 Marek Skalický - 1:1.14.1-1 +- Rebase to latest upstream release + (soname bump for ABI breakage in 1.14) + +* Tue Jan 16 2018 Marek Skalický - 1:1.14-3 +- Fix -devel require to include also epoch + +* Tue Jan 16 2018 Marek Skalický - 1:1.14-2 +- Introduce epoch to not to break upgrade path from F27 + +* Wed Jan 03 2018 Petr Kubat - 1.14-1 +- Upgrade to gdbm 1.14 +- Resolves #1467431 + +* Wed Aug 02 2017 Fedora Release Engineering - 1.13-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.13-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Thu Mar 23 2017 Marek Skalický - 1.13-1 +- Upgrade to gdbm 1.13 + +* Fri Feb 10 2017 Fedora Release Engineering - 1.12-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Mar 17 2016 Marek Skalicky - 1.12-1 +- Upgrade to gdbm-1.12 (#1336604) + +* Wed Feb 03 2016 Fedora Release Engineering - 1.11-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 1.11-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Feb 21 2015 Till Maas - 1.11-5 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Sat Aug 16 2014 Fedora Release Engineering - 1.11-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jul 12 2014 Tom Callaway - 1.11-3 +- fix license handling + +* Sat Jun 07 2014 Fedora Release Engineering - 1.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed Mar 05 2014 Honza Horak - 1.11-1 +- Upgrade to gdbm-1.11 + Resolves: #1046643 + +* Sat Aug 03 2013 Fedora Release Engineering - 1.10-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Mar 25 2013 Honza Horak - 1.10-6 +- Fixed some issues found by Coverity +- Add support of aarch64 + +* Wed Feb 13 2013 Fedora Release Engineering - 1.10-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Aug 27 2012 Honza Horak - 1.10-4 +- Spec file cleanup +- Use make DESTDIR=... install instead of %%make_install + +* Thu Jul 19 2012 Fedora Release Engineering - 1.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Jan 13 2012 Fedora Release Engineering - 1.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Nov 14 2011 Honza Horak - 1.10-1 +- Updated to new upstream release 1.10 +- Dropped -shortread patch, which has been already applied by upstream +- Disable large file support, that is enabled by default since 1.9, + but not compatible with db files created using gdbm-1.8.3 and lower +- License change to GPLv3+ +- Add doc files THANKS AUTHORS NOTE-WARNING +- Changed text in NOTE-WARNING to correspond with build settings + +* Tue Sep 20 2011 Honza Horak - 1.9.1-1 +- Updated to new upstream release 1.9.1 +- Dropped -filestruct, -ndbmlock and -fhs patches, they are not + needed anymore and GDBM_NOLOCK is used always +- Run testsuite + +* Tue Feb 08 2011 Fedora Release Engineering - 1.8.3-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Jan 13 2011 Jan Horak - 1.8.3-8 +- Added filestruct patch (#668178) + +* Mon Jan 03 2011 Karel Klic - 1.8.3-7 +- Removed BuildRoot tag +- Removed %%clean section +- Added ndbmlock patch (#663932) + +* Mon Apr 12 2010 Karel Klic - 1.8.3-6 +- Use fcntl instead of flock for locking to make nfs safe (#477300) + +* Thu Mar 11 2010 Karel Klic - 1.8.3-5 +- Removed fake Provides: libgdbm.so.2 and corresponding symlinks +- Moved autoconf, libtoolize from %%build to %%prep section +- Remove static builds from the devel package (#556050) + +* Thu Mar 11 2010 Karel Klic - 1.8.3-4 +- Provides: libgdbm.so.2()(64bit) for x86_64 architecture + +* Thu Mar 11 2010 Karel Klic - 1.8.3-3 +- Added temporary symlinks to retain compatibility with gdbm 1.8.0 + +* Wed Mar 10 2010 Rex Dieter - 1.8.3-2 +- %%files: track shlib sonames, so abi breaks are less of a surprise + +* Tue Mar 09 2010 Karel Klic - 1.8.3-1 +- Newer upstream release +- Removed gdbm-1.8.0-64offset.patch, because it was merged by the upstream +- `jbj' patch extended and renamed to `zeroheaders' +- Added shortread patch from Debian + +* Fri Jul 24 2009 Fedora Release Engineering - 1.8.0-33 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Fri Apr 17 2009 Stepan Kasal - 1.8.0-32 +- Clean up the spec, for merge review. + +* Fri Feb 27 2009 Stepan Kasal - 1.8.0-31 +- drop *-cflags.patch, move all makefile fixes to *-fhs.patch +- propagate libdir to Makefile; no need to set it on cmdline + +* Tue Feb 24 2009 Fedora Release Engineering - 1.8.0-30 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Jul 21 2008 Tom "spot" Callaway - 1.8.0-29 +- fix license tag + +* Tue Feb 19 2008 Fedora Release Engineering - 1.8.0-28 +- Autorebuild for GCC 4.3 + +* Tue Apr 3 2007 Ondrej Dvoracek - 1.8.0-27 +- made install-info use in scriptlets safe (#223688) + +* Wed Jul 12 2006 Jesse Keating - 1.8.0-26.2.1 +- rebuild + +* Fri Feb 10 2006 Jesse Keating - 1.8.0-26.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 1.8.0-26.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Tue Jan 24 2006 Warren Togami 1.8.0-26 +- remove .la (#171535) + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Sat Apr 09 2005 Florian La Roche +- rebuild + +* Sun Aug 8 2004 Alan Cox 1.8.0-24 +- Close bug #125319 + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Tue Mar 02 2004 Elliot Lee +- rebuilt + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Wed Jan 22 2003 Tim Powers +- rebuilt + +* Fri Oct 4 2002 Nalin Dahyabhai 1.8.0-19 +- rebuild + +* Fri Sep 13 2002 Nalin Dahyabhai 1.8.0-18.1 +- run make with libdir overridden so that it has the value passed to configure + instead of $(prefix)/lib + +* Wed Jul 24 2002 Trond Eivind Glomsrød 1.8.0-18 +- Remove cflags for large database support - not compatible + with databases without it + +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Thu Apr 25 2002 Trond Eivind Glomsrød 1.8.0-15 +- Use 64bit offset +- Patch to make the above not break from downsj@downsj.com (#63980) + +* Tue Feb 26 2002 Trond Eivind Glomsrød 1.8.0-14 +- Rebuild + +* Fri Jan 25 2002 Trond Eivind Glomsrød 1.8.0-13 +- Update location +- auto* changes to make it build + +* Wed Oct 17 2001 Trond Eivind Glomsrød 1.8.0-11 +- Add URL (# 54607) + +* Mon Jun 25 2001 Nalin Dahyabhai +- s/Copyright:/License:/g +- include text docs in binary package + +* Tue Jun 12 2001 Than Ngo +- fix to build against new libtool + +* Mon Mar 19 2001 Trond Eivind Glomsrød +- Make it respect RPM_OPT_FLAGS/CFLAGS - #32242. + Patch from dan@D00M.cmc.msu.ru + +* Thu Jul 13 2000 Prospector +- automatic rebuild + +* Mon Jun 5 2000 Jeff Johnson +- FHS packaging. + +* Mon Feb 7 2000 Bill Nottingham +- handle compressed manpages + +* Tue Aug 10 1999 Jeff Johnson +- make sure created database header is initialized (#4457). + +* Tue Jun 1 1999 Jeff Johnson +- update to 1.8.0. +- repackage to include /usr/include/gdbm/*dbm.h compatibility includes. + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 19) + +* Thu Dec 17 1998 Cristian Gafton +- build against glibc 2.1 + +* Thu May 07 1998 Prospector System +- translations modified for de, fr, tr + +* Thu Apr 30 1998 Cristian Gafton +- gdbm-devel moved to Development/Libraries + +* Wed Apr 08 1998 Cristian Gafton +- buildroot and built for Manhattan + +* Tue Oct 14 1997 Donnie Barnes +- spec file cleanups + +* Thu Jun 12 1997 Erik Troan +- built against glibc diff --git a/gdbm_gcc_10.patch b/gdbm_gcc_10.patch new file mode 100644 index 0000000..518482c --- /dev/null +++ b/gdbm_gcc_10.patch @@ -0,0 +1,17 @@ +Author:Filip Januš +Date: 7.2.2020 +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1799391 +After upgrade gcc to version gcc version 10.0.1 20200130 (Red Hat 10.0.1-0.7) (GCC) is not possible to build GDBM + +diff -ur gdbm-1.18.1/src/parseopt.c gdbm-1.18.1_new/src/parseopt.c +--- gdbm-1.18.1/src/parseopt.c 2018-05-30 11:39:15.000000000 +0200 ++++ gdbm-1.18.1_new/src/parseopt.c 2020-02-07 20:36:37.226390871 +0100 +@@ -255,8 +255,6 @@ + } + + char *parseopt_program_name; +-char *parseopt_program_doc; +-char *parseopt_program_args; + const char *program_bug_address = "<" PACKAGE_BUGREPORT ">"; + void (*parseopt_help_hook) (FILE *stream); + diff --git a/sources b/sources new file mode 100644 index 0000000..45d5fcf --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (gdbm-1.18.1.tar.gz) = adf9d6c5bc843ff0d7f88c2a1667d509973b2d63378d0001d7e74cc10aee6ea498a4513cc88ddf78c32ba4db5cb040b2794f4f1b3338c65d9894058850e2f5ef diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..f3c94e7 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,18 @@ +--- +# Tests that run in classic and container contexts +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + - container + tests: + - testsuite + required_packages: + - gcc # testsuite needs this package + - gettext # testsuite needs this package + - libtool # testsuite needs this package + - make # testsuite needs this package + - readline-devel # testsuite needs this package + - rpm-build # testsuite needs this package + - wget # rlFetchSrcForInstalled needs this package diff --git a/tests/testsuite/Makefile b/tests/testsuite/Makefile new file mode 100644 index 0000000..398545e --- /dev/null +++ b/tests/testsuite/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of testsuite +# Description: runs test suite from src package +# Author: Vaclav Danek +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=testsuite +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Vaclav Danek " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: runs test suite from src package" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: gdbm" >> $(METADATA) + @echo "Requires: gdbm libtool readline-devel" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5 -RHEL6" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/testsuite/PURPOSE b/tests/testsuite/PURPOSE new file mode 100644 index 0000000..ee80bc5 --- /dev/null +++ b/tests/testsuite/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of testsuite +Description: runs test suite from src package +Author: Vaclav Danek diff --git a/tests/testsuite/runtest.sh b/tests/testsuite/runtest.sh new file mode 100644 index 0000000..548d0d6 --- /dev/null +++ b/tests/testsuite/runtest.sh @@ -0,0 +1,74 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of testsuite +# Description: runs test suite from src package +# Author: Vaclav Danek +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +[ -e /usr/bin/rhts-environment.sh ] && . /usr/bin/rhts-environment.sh +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="gdbm" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + # fetch srpm + rlRun "rlFetchSrcForInstalled $PACKAGE || yumdownloader --enablerepo='*' --source $PACKAGE" \ + 0 "Fetching the source rpm" + package=`rpm -q --qf "%{SOURCERPM}" $PACKAGE` + installlog=`mktemp /tmp/install.log.XXXXXX` + rlLog "Using $installlog as installation log" + rlRun "rpm -ivh $TmpDir/$package &> $installlog" + BUILDDIR="$HOME/rpmbuild/BUILD" + SPECDIR="$HOME/rpmbuild/SPECS" + rlPhaseEnd + + rlPhaseStartTest + rlRun "cd /root/rpmbuild" + rlRun "rpmbuild -bp $SPECDIR/$PACKAGE.spec" + rlRun "cd $BUILDDIR" + rlRun "cd gdbm-*" + if rlGetPrimaryArch == 'ppc64le'; then + rlRun "./configure --disable-static --enable-libgdbm-compat --build=ppc64le-redhat-linux-gnu --host=ppc64le-redhat-linux-gnu" + else + rlRun "./configure --disable-static --enable-libgdbm-compat" + fi + rlRun "make check" + rlRun "ls | grep -v tests | xargs rm -rf" + rlRun "cd tests" + rlRun "rm -f testsuite.log" + rlRun "./testsuite" + rlAssertGrep "All .* tests were successful." testsuite.log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlRun "rm -rf /root/rpmbuild" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd