diff --git a/.gitignore b/.gitignore index eca5478..aa4e762 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ /libtpms-0.5.1.tgz /libtpms-0.5.1.tar.gz /libtpms-0.5.2.tar.gz +/libtpms-20180914.tar.xz +/libtpms.spec +/make-git-snapshot.sh diff --git a/libtpms-20180914.tar.xz b/libtpms-20180914.tar.xz new file mode 100644 index 0000000..6616821 Binary files /dev/null and b/libtpms-20180914.tar.xz differ diff --git a/libtpms.spec b/libtpms.spec index 7f6c278..ecbae09 100644 --- a/libtpms.spec +++ b/libtpms.spec @@ -1,42 +1,19 @@ -# --- libtpm rpm-spec --- +%global gitdate 20180914 +%global gitversion 4111bd1bcf -%define name libtpms -%define version 0.5.2 -%define release 12 - -# Valid crypto subsystems are 'freebl' and 'openssl' -%define crypto_subsystem freebl - -# Valid build types are 'production' or 'debug' -%define build_type production +Name: libtpms +Version: 0.6.0 +Release: 0.%{gitdate}git%{gitversion}%{?dist} Summary: Library providing Trusted Platform Module (TPM) functionality -Name: %{name} -Version: %{version} -Release: %{release}%{?dist} License: BSD Group: Development/Libraries -Url: http://sourceforge.net/projects/ibmswtpm -Source: http://bergerstefan.users.sourceforge.net/libtpms/%{name}-%{version}.tar.gz +Url: http://github.com/stefanberger/libtpms +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 -%else -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: pkgconfig gawk sed BuildRequires: automake autoconf libtool bash coreutils -Requires: nss-softokn-freebl >= 3.12.9-2, nss-softokn >= 3.12.9-2 -Requires: gmp -%endif %description A library providing TPM functionality for VMs. Targeted for integration @@ -50,62 +27,40 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %description devel 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 -%setup -q - -%patch0001 -p1 -%patch0002 -p1 - +%setup -q -n %{name}-%{gitdate} %build - -%if %{crypto_subsystem} == 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} - +sh autogen.sh +%configure --disable-static --with-tpm2 --with-openssl make %{?_smp_mflags} %check make check %install -install -d -m 0755 $RPM_BUILD_ROOT%{_libdir} -install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/libtpms -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 +make DESTDIR="%{buildroot}" install +find %{buildroot} -type f -name '*.la' | xargs rm -f -- || : %post -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 +* Fri Sep 14 2018 Marc-André Lureau - 0.6.0-0.20180914git.4111bd1bcf +- Build snapshot from git, simplify spec + * Fri Jul 13 2018 Fedora Release Engineering - 0.5.2-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild diff --git a/make-git-snapshot.sh b/make-git-snapshot.sh new file mode 100755 index 0000000..79e161d --- /dev/null +++ b/make-git-snapshot.sh @@ -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 diff --git a/sources b/sources index 7b01901..d81a351 100644 --- a/sources +++ b/sources @@ -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