gdbm/gdbm.spec
2021-07-30 16:25:22 +08:00

107 lines
2.9 KiB
RPMSpec

Name: gdbm
Version: 1.20
Release: 1
Epoch: 1
Summary: A library of database functions that work similar to the standard UNIX dbm
License: GPLv3+
URL: http://www.gnu.org/software/gdbm/
Source0: http://ftp.gnu.org/gnu/gdbm/gdbm-%{version}.tar.gz
BuildRequires: gcc libtool gettext readline-devel git
Provides: %{name}-libs
Provides: %{name}-libs%{?_isa}
Obsoletes: %{name}-libs
%description
GNU dbm (or GDBM, for short) is a library of database functions that
use extensible hashing and work similar to the standard UNIX dbm.
These routines are provided to a programmer needing to create and
manipulate a hashed database.
%package devel
Summary: Header files and libraries for development
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires(post): info
Requires(preun): info
Obsoletes: %{name}-libs
%description devel
Gdbm-devel contains the header files and libraries for development.
You should install this package if you want to develop applications
base on gdbm database.
%package help
Summary: Documents for %{name}
Buildarch: noarch
Requires: man info
%description help
Man pages and other related documents for %{name}.
%prep
%autosetup -n %{name}-%{version} -p1 -S git
%build
%configure --disable-static --disable-largefile --disable-rpath --enable-libgdbm-compat
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
rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
%check
export LD_LIBRARY_PATH=`pwd`/src/.libs/:`pwd`/compat/.libs/
make check
%ldconfig_scriptlets
%post devel
/sbin/install-info %{_infodir}/gdbm.info.gz %{_infodir}/dir \
--entry="* gdbm: (gdbm). The GNU Database." || :
%preun devel
if [ $1 = 0 ]; then
/sbin/install-info --delete %{_infodir}/gdbm.info.gz %{_infodir}/dir \
--entry="* gdbm: (gdbm). The GNU Database." || :
fi
%files -f %{name}.lang
%doc NEWS README THANKS AUTHORS NOTE-WARNING
%license COPYING
%{_bindir}/gdbm*
%{_libdir}/libgdbm.so.6*
%{_libdir}/libgdbm_compat.so.4*
%exclude %{_libdir}/*.la
%files devel
%{_libdir}/libgdbm.so
%{_libdir}/libgdbm_compat.so
%{_includedir}/*
%files help
%{_mandir}/man1/gdbm*
%{_mandir}/man3/*
%{_infodir}/*.info*
%changelog
* Fri Jul 20 2021 yanglongkang <yanglongkang@huawei.com> - 1.20-1
- upgrade package to 1.20
* Sat Jul 18 2020 Wangjun <wangjun196@huawei.com> - 1.18.1-1
- upgrade package to 1.18.1
* Sat Aug 31 2019 guiyao <guiyao@huawei.com> - 1.18-2
- Package init