Build snapshot from git, simplify spec

This commit is contained in:
Stefan Berger 2018-09-14 11:11:36 -04:00
parent a1c43e81dd
commit 165e839f8a
5 changed files with 56 additions and 74 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
/libtpms-0.5.1.tgz /libtpms-0.5.1.tgz
/libtpms-0.5.1.tar.gz /libtpms-0.5.1.tar.gz
/libtpms-0.5.2.tar.gz /libtpms-0.5.2.tar.gz
/libtpms-20180914.tar.xz
/libtpms.spec
/make-git-snapshot.sh

BIN
libtpms-20180914.tar.xz Normal file

Binary file not shown.

View File

@ -1,42 +1,19 @@
# --- libtpm rpm-spec --- %global gitdate 20180914
%global gitversion 4111bd1bcf
%define name libtpms Name: libtpms
%define version 0.5.2 Version: 0.6.0
%define release 12 Release: 0.%{gitdate}git%{gitversion}%{?dist}
# Valid crypto subsystems are 'freebl' and 'openssl'
%define crypto_subsystem freebl
# Valid build types are 'production' or 'debug'
%define build_type production
Summary: Library providing Trusted Platform Module (TPM) functionality Summary: Library providing Trusted Platform Module (TPM) functionality
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
License: BSD License: BSD
Group: Development/Libraries Group: Development/Libraries
Url: http://sourceforge.net/projects/ibmswtpm Url: http://github.com/stefanberger/libtpms
Source: http://bergerstefan.users.sourceforge.net/libtpms/%{name}-%{version}.tar.gz Source0: libtpms-%{gitdate}.tar.xz
# Patches since 0.5.2
Patch0001: 0001-Fix-public-header-files-for-c.patch
Patch0002: 0002-Some-fixes-to-the-spm-spec.patch
%if %{crypto_subsystem} == openssl
BuildRequires: openssl-devel BuildRequires: openssl-devel
%else BuildRequires: pkgconfig gawk sed
BuildRequires: nss-devel >= 3.12.9-2
BuildRequires: nss-softokn-freebl-devel >= 3.12.9-2
%if 0%{?rhel} > 6 || 0%{?fedora} >= 13
BuildRequires: nss-softokn-freebl-static >= 3.12.9-2
%endif
BuildRequires: nss-softokn-devel >= 3.12.9-2, gmp-devel
BuildRequires: pkgconfig gawk
BuildRequires: automake autoconf libtool bash coreutils BuildRequires: automake autoconf libtool bash coreutils
Requires: nss-softokn-freebl >= 3.12.9-2, nss-softokn >= 3.12.9-2
Requires: gmp
%endif
%description %description
A library providing TPM functionality for VMs. Targeted for integration A library providing TPM functionality for VMs. Targeted for integration
@ -50,62 +27,40 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel %description devel
Libtpms header files and documentation. Libtpms header files and documentation.
%files
%{_libdir}/%{name}.so.%{version}
%{_libdir}/%{name}.so.0
%doc LICENSE README CHANGES
%files devel
%{_libdir}/%{name}.so
%dir %{_includedir}/%{name}
%attr(644, root, root) %{_libdir}/pkgconfig/*.pc
%attr(644, root, root) %{_includedir}/%{name}/*.h
%attr(644, root, root) %{_mandir}/man3/*
%prep %prep
%setup -q %setup -q -n %{name}-%{gitdate}
%patch0001 -p1
%patch0002 -p1
%build %build
sh autogen.sh
%if %{crypto_subsystem} == openssl %configure --disable-static --with-tpm2 --with-openssl
%define _with_openssl --with-openssl
%endif
%if %{build_type} == debug
%define _enable_debug --enable-debug
%endif
./bootstrap.sh
%configure \
--disable-static \
--prefix=/usr \
--libdir=%{_libdir} \
%{?_with_openssl} \
%{?_enable_debug}
make %{?_smp_mflags} make %{?_smp_mflags}
%check %check
make check make check
%install %install
install -d -m 0755 $RPM_BUILD_ROOT%{_libdir} make DESTDIR="%{buildroot}" install
install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/libtpms find %{buildroot} -type f -name '*.la' | xargs rm -f -- || :
install -d -m 0755 $RPM_BUILD_ROOT%{_mandir}/man3
make %{?_smp_mflags} install DESTDIR=${RPM_BUILD_ROOT}
rm -f $RPM_BUILD_ROOT%{_libdir}/libtpms.la
%post -p /sbin/ldconfig %post -p /sbin/ldconfig
%postun -p /sbin/ldconfig %postun -p /sbin/ldconfig
%files
%license LICENSE
%doc README CHANGES
%{_libdir}/lib*.so.*
%files devel
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/*.h
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
%{_mandir}/man3/*
%changelog %changelog
* Fri Sep 14 2018 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.6.0-0.20180914git.4111bd1bcf
- Build snapshot from git, simplify spec
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-12 * Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

22
make-git-snapshot.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
# Usage: ./make-git-snapshot.sh [COMMIT]
#
# to make a snapshot of the given tag/branch. Defaults to HEAD.
# Point env var REF to a local mesa repo to reduce clone time.
DIRNAME=libtpms-$( date +%Y%m%d )
echo REF ${REF:+--reference $REF}
echo DIRNAME $DIRNAME
echo HEAD ${1:-HEAD}
rm -rf $DIRNAME
git clone ${REF:+--reference $REF} \
https://github.com/stefanberger/libtpms $DIRNAME
GIT_DIR=$DIRNAME/.git git archive --format=tar --prefix=$DIRNAME/ ${1:-HEAD} \
| xz > $DIRNAME.tar.xz
# rm -rf $DIRNAME

View File

@ -1 +1,3 @@
1fdf239fefd671b0c75960b7a0f58427 libtpms-0.5.2.tar.gz SHA512 (libtpms-20180914.tar.xz) = 966f290b444c46d342e6664a9cf99117233cb3f84976ca1af54bbbd066e22e7a35090bf36245ce68b01e1a15302f23691ccafe46a9514da034b5122fd4bfe6f5
SHA512 (libtpms.spec) = ad71c05e7e3aa112ffc2ca5862a981c7d9f2027622c8cd65bfd9e148121707b32c0eecfac80c11f09ccb7f2f203cdf432b2f549b887ea33585e79bc0bf0b5412
SHA512 (make-git-snapshot.sh) = b1e7a3e2125a2cde33e96b13e34155ce3ce518bc7a81db55118b5c6de301198f896e57b3c81104024d3e79e096e0cb0e2e9a16c4c7b769cb495d209557a550b5