]> git.proxmox.com Git - swtpm.git/commitdiff
rpm: Move spec file and include it in dist archives
authorAndrea Bolognani <abologna@redhat.com>
Thu, 3 Jun 2021 17:54:43 +0000 (19:54 +0200)
committerStefan Berger <stefanb@us.ibm.com>
Thu, 3 Jun 2021 20:09:00 +0000 (16:09 -0400)
Having the spec file in the top-level directory of the dist
archive makes it possible to build rpms with a single,
convenient command.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
.gitignore
INSTALL
Makefile.am
configure.ac
dist/swtpm.spec.in [deleted file]
swtpm.spec.in [new file with mode: 0644]

index c1c172839aca0ac793053634d8f516e06d39fd94..187d102209a9681df8e23de4fe4742e4f680b846 100644 (file)
@@ -33,7 +33,7 @@ Makefile
 /missing
 /stamp-h1
 /swtpm-*.tar.gz
-/dist/swtpm.spec
+/swtpm.spec
 /m4/*
 /.pc/*
 /etc/swtpm_setup.conf
diff --git a/INSTALL b/INSTALL
index e892d419a229e44a2ece5baf8c9d1e38b40e61fc..90d2d7d6dd1783c9a7fb652a2a7977bfc7f8baea 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -56,9 +56,7 @@ To build an rpm on a Fedora or RHEL host do:
 
 ./autogen.sh
 make dist
-mkdir -p ~/rpmbuild/SOURCES
-cp swtpm-0.x.y-tar.gz ~/rpmbuild/SOURCES
-rpmbuild -ba dist/swtpm.spec
+rpmbuild -ta swtpm-*.tar.gz
 
 
 To build a Debian package on a Debian compatible host do:
index 6c61d7b53f01e79448e06fe6a4139aa54f15e199..096052e71941b1edab616d2bfffd708031b3bc61 100644 (file)
@@ -20,6 +20,7 @@ EXTRA_DIST = \
        LICENSE \
        COPYING \
        README \
+       swtpm.spec \
        autogen.sh
 
 if WITH_SELINUX
index de07843192a9b4e0bc243c674dcc935b740cc9ff..9f904b4302f0c75220c47f51745ed58dd53b78b4 100644 (file)
@@ -546,7 +546,7 @@ AC_SUBST([AM_LDFLAGS])
 
 AC_CONFIG_FILES([Makefile                   \
                debian/swtpm-tools.postinst \
-               dist/swtpm.spec             \
+               swtpm.spec                  \
                etc/Makefile                \
                etc/swtpm_setup.conf        \
                samples/Makefile            \
diff --git a/dist/swtpm.spec.in b/dist/swtpm.spec.in
deleted file mode 100644 (file)
index c1e8a5e..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-%bcond_without gnutls
-
-# Macros needed by SELinux
-%global selinuxtype targeted
-%global moduletype  contrib
-%global modulename  swtpm
-
-Summary: TPM Emulator
-Name:           swtpm
-Version:        @VERSION@
-Release:        1%{?dist}
-License:        BSD
-Url:            https://github.com/stefanberger/swtpm
-Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  automake
-BuildRequires:  autoconf
-BuildRequires:  libtool
-BuildRequires:  libtpms-devel >= 0.6.0
-BuildRequires:  glib2-devel
-BuildRequires:  json-glib-devel
-BuildRequires:  gmp-devel
-BuildRequires:  expect
-BuildRequires:  net-tools
-BuildRequires:  openssl-devel
-BuildRequires:  socat
-BuildRequires:  python3-twisted
-BuildRequires:  softhsm
-BuildRequires:  trousers >= 0.3.9
-%if %{with gnutls}
-BuildRequires:  gnutls >= 3.1.0
-BuildRequires:  gnutls-devel
-BuildRequires:  gnutls-utils
-BuildRequires:  libtasn1-devel
-BuildRequires:  libtasn1
-%endif
-BuildRequires:  selinux-policy-devel
-BuildRequires:  gcc
-BuildRequires:  libseccomp-devel
-BuildRequires:  tpm2-pkcs11 tpm2-pkcs11-tools tpm2-tools tpm2-abrmd
-
-Requires:       %{name}-libs = %{version}-%{release}
-Requires:       libtpms >= 0.6.0
-%{?selinux_requires}
-
-%description
-TPM emulator built on libtpms providing TPM functionality for QEMU VMs
-
-%package        libs
-Summary:        Private libraries for swtpm TPM emulators
-License:        BSD
-
-%description    libs
-A private library with callback functions for libtpms based swtpm TPM emulator
-
-%package        devel
-Summary:        Include files for the TPM emulator's CUSE interface for usage by clients
-License:        BSD
-Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
-
-%description    devel
-Include files for the TPM emulator's CUSE interface.
-
-%package        tools
-Summary:        Tools for the TPM emulator
-License:        BSD
-Requires:       swtpm = %{version}-%{release}
-Requires:       trousers >= 0.3.9 bash gnutls-utils python3 python3-cryptography
-
-%description    tools
-Tools for the TPM emulator from the swtpm package
-
-%package       tools-pkcs11
-Summary:       Tools for creating a local CA based on a pkcs11 device
-License:       BSD
-Requires:      swtpm-tools = %{version}-%{release}
-Requires:      tpm2-pkcs11 tpm2-pkcs11-tools tpm2-tools tpm2-abrmd
-Requires:      expect gnutls-utils trousers >= 0.3.9
-
-%description   tools-pkcs11
-Tools for creating a local CA based on a pkcs11 device
-
-%prep
-%autosetup
-
-%build
-
-NOCONFIGURE=1 ./autogen.sh
-%configure \
-%if %{with gnutls}
-        --with-gnutls \
-%endif
-        --without-cuse
-
-%make_build
-
-%check
-make %{?_smp_mflags} check
-
-%install
-
-%make_install
-rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.{a,la,so}
-
-%post
-for pp in /usr/share/selinux/packages/swtpm.pp \
-          /usr/share/selinux/packages/swtpm_svirt.pp; do
-  %selinux_modules_install -s %{selinuxtype} ${pp}
-done
-
-%postun
-if [ $1 -eq  0 ]; then
-  for p in swtpm swtpm_svirt; do
-    %selinux_modules_uninstall -s %{selinuxtype} $p
-  done
-fi
-
-%posttrans
-%selinux_relabel_post -s %{selinuxtype}
-
-%ldconfig_post libs
-%ldconfig_postun libs
-
-%files
-%license LICENSE
-%doc README
-%{_bindir}/swtpm
-%{_mandir}/man8/swtpm.8*
-%{_datadir}/selinux/packages/swtpm.pp
-%{_datadir}/selinux/packages/swtpm_svirt.pp
-
-%files libs
-%license LICENSE
-%doc README
-
-%dir %{_libdir}/%{name}
-%{_libdir}/%{name}/libswtpm_libtpms.so.0
-%{_libdir}/%{name}/libswtpm_libtpms.so.0.0.0
-
-%files devel
-%dir %{_includedir}/%{name}
-%{_includedir}/%{name}/*.h
-%{_mandir}/man3/swtpm_ioctls.3*
-
-%files tools
-%doc README
-%{_bindir}/swtpm_bios
-%if %{with gnutls}
-%{_bindir}/swtpm_cert
-%endif
-%{_bindir}/swtpm_setup
-%{_bindir}/swtpm_ioctl
-%{_mandir}/man8/swtpm_bios.8*
-%{_mandir}/man8/swtpm_cert.8*
-%{_mandir}/man8/swtpm_ioctl.8*
-%{_mandir}/man8/swtpm-localca.conf.8*
-%{_mandir}/man8/swtpm-localca.options.8*
-%{_mandir}/man8/swtpm-localca.8*
-%{_mandir}/man8/swtpm_setup.8*
-%{_mandir}/man8/swtpm_setup.conf.8*
-%{_mandir}/man8/swtpm_setup.sh.8*
-%config(noreplace) %{_sysconfdir}/swtpm_setup.conf
-%config(noreplace) %{_sysconfdir}/swtpm-localca.options
-%config(noreplace) %{_sysconfdir}/swtpm-localca.conf
-%dir %{_datadir}/swtpm
-%{_datadir}/swtpm/swtpm-localca
-%{_datadir}/swtpm/swtpm-create-user-config-files
-%{python3_sitelib}/py_swtpm_setup/*
-%{python3_sitelib}/swtpm_setup-*/*
-%{python3_sitelib}/py_swtpm_localca/*
-%{python3_sitelib}/swtpm_localca-*/*
-%attr( 750, @TSS_USER@, root) %{_localstatedir}/lib/swtpm-localca
-
-%files tools-pkcs11
-%{_mandir}/man8/swtpm-create-tpmca.8*
-%{_datadir}/swtpm/swtpm-create-tpmca
-
-%changelog
-* Wed Oct 7 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.5.0-0.20201007git-------
-- v0.5.0 release
-
-* Fri Aug 28 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.4.0-20200218git-------
-- v0.4.0 release
-
-* Mon Feb 17 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.3.0-20200218git38f36f3
-- v0.3.0 release
-
-* Fri Jul 19 2019 Stefan Berger <stefanb@linux.ibm.com> - 0.2.0-20190716git817d3a8
-- v0.2.0 release
-
-* Mon Feb 4 2019 Stefan Berger <stefanb@linux.vnet.ibm.com> - 0.1.0-0.20190204git2c25d13
-- v0.1.0 release
-
-* Mon Sep 17 2018 Stefan Berger <stefanb@linux.vnet.ibm.com> - 0.1.0-0.20180918git67d7ea3
-- Created initial version of rpm spec files
-- Version is now 0.1.0
-- Bugzilla for this spec: https://bugzilla.redhat.com/show_bug.cgi?id=1611829
diff --git a/swtpm.spec.in b/swtpm.spec.in
new file mode 100644 (file)
index 0000000..c1e8a5e
--- /dev/null
@@ -0,0 +1,197 @@
+%bcond_without gnutls
+
+# Macros needed by SELinux
+%global selinuxtype targeted
+%global moduletype  contrib
+%global modulename  swtpm
+
+Summary: TPM Emulator
+Name:           swtpm
+Version:        @VERSION@
+Release:        1%{?dist}
+License:        BSD
+Url:            https://github.com/stefanberger/swtpm
+Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
+
+BuildRequires:  automake
+BuildRequires:  autoconf
+BuildRequires:  libtool
+BuildRequires:  libtpms-devel >= 0.6.0
+BuildRequires:  glib2-devel
+BuildRequires:  json-glib-devel
+BuildRequires:  gmp-devel
+BuildRequires:  expect
+BuildRequires:  net-tools
+BuildRequires:  openssl-devel
+BuildRequires:  socat
+BuildRequires:  python3-twisted
+BuildRequires:  softhsm
+BuildRequires:  trousers >= 0.3.9
+%if %{with gnutls}
+BuildRequires:  gnutls >= 3.1.0
+BuildRequires:  gnutls-devel
+BuildRequires:  gnutls-utils
+BuildRequires:  libtasn1-devel
+BuildRequires:  libtasn1
+%endif
+BuildRequires:  selinux-policy-devel
+BuildRequires:  gcc
+BuildRequires:  libseccomp-devel
+BuildRequires:  tpm2-pkcs11 tpm2-pkcs11-tools tpm2-tools tpm2-abrmd
+
+Requires:       %{name}-libs = %{version}-%{release}
+Requires:       libtpms >= 0.6.0
+%{?selinux_requires}
+
+%description
+TPM emulator built on libtpms providing TPM functionality for QEMU VMs
+
+%package        libs
+Summary:        Private libraries for swtpm TPM emulators
+License:        BSD
+
+%description    libs
+A private library with callback functions for libtpms based swtpm TPM emulator
+
+%package        devel
+Summary:        Include files for the TPM emulator's CUSE interface for usage by clients
+License:        BSD
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    devel
+Include files for the TPM emulator's CUSE interface.
+
+%package        tools
+Summary:        Tools for the TPM emulator
+License:        BSD
+Requires:       swtpm = %{version}-%{release}
+Requires:       trousers >= 0.3.9 bash gnutls-utils python3 python3-cryptography
+
+%description    tools
+Tools for the TPM emulator from the swtpm package
+
+%package       tools-pkcs11
+Summary:       Tools for creating a local CA based on a pkcs11 device
+License:       BSD
+Requires:      swtpm-tools = %{version}-%{release}
+Requires:      tpm2-pkcs11 tpm2-pkcs11-tools tpm2-tools tpm2-abrmd
+Requires:      expect gnutls-utils trousers >= 0.3.9
+
+%description   tools-pkcs11
+Tools for creating a local CA based on a pkcs11 device
+
+%prep
+%autosetup
+
+%build
+
+NOCONFIGURE=1 ./autogen.sh
+%configure \
+%if %{with gnutls}
+        --with-gnutls \
+%endif
+        --without-cuse
+
+%make_build
+
+%check
+make %{?_smp_mflags} check
+
+%install
+
+%make_install
+rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.{a,la,so}
+
+%post
+for pp in /usr/share/selinux/packages/swtpm.pp \
+          /usr/share/selinux/packages/swtpm_svirt.pp; do
+  %selinux_modules_install -s %{selinuxtype} ${pp}
+done
+
+%postun
+if [ $1 -eq  0 ]; then
+  for p in swtpm swtpm_svirt; do
+    %selinux_modules_uninstall -s %{selinuxtype} $p
+  done
+fi
+
+%posttrans
+%selinux_relabel_post -s %{selinuxtype}
+
+%ldconfig_post libs
+%ldconfig_postun libs
+
+%files
+%license LICENSE
+%doc README
+%{_bindir}/swtpm
+%{_mandir}/man8/swtpm.8*
+%{_datadir}/selinux/packages/swtpm.pp
+%{_datadir}/selinux/packages/swtpm_svirt.pp
+
+%files libs
+%license LICENSE
+%doc README
+
+%dir %{_libdir}/%{name}
+%{_libdir}/%{name}/libswtpm_libtpms.so.0
+%{_libdir}/%{name}/libswtpm_libtpms.so.0.0.0
+
+%files devel
+%dir %{_includedir}/%{name}
+%{_includedir}/%{name}/*.h
+%{_mandir}/man3/swtpm_ioctls.3*
+
+%files tools
+%doc README
+%{_bindir}/swtpm_bios
+%if %{with gnutls}
+%{_bindir}/swtpm_cert
+%endif
+%{_bindir}/swtpm_setup
+%{_bindir}/swtpm_ioctl
+%{_mandir}/man8/swtpm_bios.8*
+%{_mandir}/man8/swtpm_cert.8*
+%{_mandir}/man8/swtpm_ioctl.8*
+%{_mandir}/man8/swtpm-localca.conf.8*
+%{_mandir}/man8/swtpm-localca.options.8*
+%{_mandir}/man8/swtpm-localca.8*
+%{_mandir}/man8/swtpm_setup.8*
+%{_mandir}/man8/swtpm_setup.conf.8*
+%{_mandir}/man8/swtpm_setup.sh.8*
+%config(noreplace) %{_sysconfdir}/swtpm_setup.conf
+%config(noreplace) %{_sysconfdir}/swtpm-localca.options
+%config(noreplace) %{_sysconfdir}/swtpm-localca.conf
+%dir %{_datadir}/swtpm
+%{_datadir}/swtpm/swtpm-localca
+%{_datadir}/swtpm/swtpm-create-user-config-files
+%{python3_sitelib}/py_swtpm_setup/*
+%{python3_sitelib}/swtpm_setup-*/*
+%{python3_sitelib}/py_swtpm_localca/*
+%{python3_sitelib}/swtpm_localca-*/*
+%attr( 750, @TSS_USER@, root) %{_localstatedir}/lib/swtpm-localca
+
+%files tools-pkcs11
+%{_mandir}/man8/swtpm-create-tpmca.8*
+%{_datadir}/swtpm/swtpm-create-tpmca
+
+%changelog
+* Wed Oct 7 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.5.0-0.20201007git-------
+- v0.5.0 release
+
+* Fri Aug 28 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.4.0-20200218git-------
+- v0.4.0 release
+
+* Mon Feb 17 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.3.0-20200218git38f36f3
+- v0.3.0 release
+
+* Fri Jul 19 2019 Stefan Berger <stefanb@linux.ibm.com> - 0.2.0-20190716git817d3a8
+- v0.2.0 release
+
+* Mon Feb 4 2019 Stefan Berger <stefanb@linux.vnet.ibm.com> - 0.1.0-0.20190204git2c25d13
+- v0.1.0 release
+
+* Mon Sep 17 2018 Stefan Berger <stefanb@linux.vnet.ibm.com> - 0.1.0-0.20180918git67d7ea3
+- Created initial version of rpm spec files
+- Version is now 0.1.0
+- Bugzilla for this spec: https://bugzilla.redhat.com/show_bug.cgi?id=1611829