Skip to content

Commit

Permalink
Merge 756caa0 into c125e34
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanberger committed May 31, 2021
2 parents c125e34 + 756caa0 commit 74f66ac
Show file tree
Hide file tree
Showing 22 changed files with 1,200 additions and 859 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ Makefile
/include/swtpm.h
/man/man3/*.3
/man/man8/*.8
/samples/dist
/samples/py_swtpm_localca/swtpm_localca_conf.py
/samples/swtpm-create-user-config-files
/samples/swtpm-localca
/samples/swtpm-localca.conf
/samples/swtpm_localca_conf.h
/src/selinux/*.pp.bz2
/src/selinux/swtpm.pp
/src/selinux/swtpm_svirt.fc
Expand Down
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ CHANGES - changes for swtpm
version 0.6.0
- swtpm_setup:
- Rewritten in 'C'; needs json-glib
- swtpm-localca:
- Rewritten in 'C'

version 0.5.0:
- swtpm:
Expand Down
5 changes: 1 addition & 4 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,4 @@ selinux-install selinux-uninstall:
@cd src/selinux && $(MAKE) $(AM_MAKEFLAGS) $@
endif

python-install python-uninstall:
@cd samples && $(MAKE) $(AM_MAKEFLAGS) $@
@cd src/swtpm_setup && $(MAKE) $(AM_MAKEFLAGS) $@
.PHONY: python-install python-uninstall selinux-install selinux-uninstall
.PHONY: selinux-install selinux-uninstall
18 changes: 1 addition & 17 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -382,16 +382,6 @@ if test "x$PIP3" = "x"; then
fi
fi

AC_MSG_CHECKING([for python setuptools package])
$PYTHON -c "import setuptools"
AS_IF([ test $? = 0 ],
[AC_MSG_RESULT([yes])],
[AC_MSG_ERROR([python setuptools is required])])

AC_ARG_ENABLE([python-installation],
AS_HELP_STRING([--disable-python-installation], [Disable running setup.py install for swtpm_setup]))
AM_CONDITIONAL([PYTHON_INSTALLATION], [test "x$enable_python_installation" != "xno"])

AC_ARG_ENABLE([hardening],
AS_HELP_STRING([--disable-hardening], [Disable hardening flags]))

Expand Down Expand Up @@ -560,9 +550,9 @@ AC_CONFIG_FILES([Makefile \
etc/Makefile \
etc/swtpm_setup.conf \
samples/Makefile \
samples/py_swtpm_localca/swtpm_localca_conf.py \
samples/swtpm-localca.conf \
samples/swtpm-create-user-config-files \
samples/swtpm_localca_conf.h \
include/Makefile \
include/swtpm/Makefile \
include/swtpm.h \
Expand All @@ -581,12 +571,6 @@ AC_CONFIG_FILES([Makefile \
tests/Makefile \
tests/test_config \
])
AC_CONFIG_FILES([samples/swtpm-localca],
[chmod 755 samples/swtpm-localca])
dnl for out-of-tree builds:
AC_CONFIG_LINKS([samples/py_swtpm_localca/__init__.py:samples/py_swtpm_localca/__init__.py \
samples/py_swtpm_localca/swtpm_localca.py:samples/py_swtpm_localca/swtpm_localca.py \
samples/py_swtpm_localca/swtpm_utils.py:samples/py_swtpm_localca/swtpm_utils.py])
AC_OUTPUT

echo
Expand Down
1 change: 0 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Build-Depends: automake,
expect,
libtasn1-dev,
socat,
python3-setuptools,
python3-twisted,
gnutls-dev,
gnutls-bin,
Expand Down
3 changes: 0 additions & 3 deletions dist/swtpm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ BuildRequires: expect
BuildRequires: net-tools
BuildRequires: openssl-devel
BuildRequires: socat
BuildRequires: python3
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-twisted
BuildRequires: softhsm
BuildRequires: trousers >= 0.3.9
Expand Down
3 changes: 0 additions & 3 deletions dist/swtpm.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ BuildRequires: expect
BuildRequires: net-tools
BuildRequires: openssl-devel
BuildRequires: socat
BuildRequires: python3
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-twisted
BuildRequires: softhsm
BuildRequires: trousers >= 0.3.9
Expand Down
67 changes: 23 additions & 44 deletions samples/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,44 @@

samplesconfdir = $(datadir)/@PACKAGE@
samplessysconfdir = $(sysconfdir)
# swtpm-localca was always installed in /usr/samples/swtpm-localca
bindir = $(samplesconfdir)

samplesconf_SCRIPTS = \
swtpm-create-tpmca \
swtpm-create-user-config-files \
swtpm-localca
swtpm-create-user-config-files

samplessysconf_DATA = \
swtpm-localca.conf \
swtpm-localca.options

PY_SWTPM_LOCALCA_FILES = $(wildcard py_swtpm_localca/*.py)
noinst_HEADERS = \
swtpm_localca.h \
swtpm_localca_utils.h

PY_PACKAGE_NAME=swtpm_localca
PY_PACKAGE_NV=$(PY_PACKAGE_NAME)-$(SWTPM_VER_MAJOR).$(SWTPM_VER_MINOR).$(SWTPM_VER_MICRO)
PY_PACKAGE=dist/$(PY_PACKAGE_NV).tar.gz

# for out-of-tree builds we need to copy setup.py
$(PY_PACKAGE): $(PY_SWTPM_LOCALCA_FILES)
@$(CP) $(srcdir)/setup.py ./ &>/dev/null || true
./setup.py sdist
bin_PROGRAMS = \
swtpm-localca

all-local: $(PY_PACKAGE)
$(top_builddir)/src/utils/libswtpm_utils.la:
$(MAKE) -C$(dir $@)

python-install: $(PY_PACKAGE)
echo "Installing python to DESTDIR '/$(DESTDIR)'"
./setup.py install --prefix=$(prefix) --root "/$(DESTDIR)" --install-layout deb 2>/dev/null || \
./setup.py install --prefix=$(prefix) --root "/$(DESTDIR)" 2>/dev/null
swtpm_localca_DEPENDENCIES = \
$(top_builddir)/src/utils/libswtpm_utils.la

python-uninstall:
echo "Local pip3 uninstall"
$(PIP3) uninstall -y $(PY_PACKAGE_NAME)
swtpm_localca_SOURCES = \
swtpm_localca.c \
swtpm_localca_utils.c

if PYTHON_INSTALLATION
install-exec-local: $(PY_PACKAGE)
@if ! test $(findstring /usr, "$(DESTDIR)$(bindir)"); then \
echo "Warning: Not installing python package to $(DESTDIR)$(bindir)"; \
else \
$(MAKE) python-install; \
fi
swtpm_localca_LDADD = \
$(top_builddir)/src/utils/libswtpm_utils.la

uninstall-local:
@if ! test $(findstring /usr, "$(DESTDIR)$(bindir)"); then \
echo "Cleanup for distcheck build not implemented" ; \
else \
$(MAKE) python-uninstall; \
fi
endif
swtpm_localca_LDFLAGS = \
-L$(top_builddir)/src/utils -lswtpm_utils \
$(GLIB_LIBS)

swtpm_localca_CFLAGS = \
-I$(top_srcdir)/src/utils \
$(GLIB_CFLAGS)

install-data-local:
$(MKDIR_P) $(DESTDIR)$(localstatedir)/lib/swtpm-localca
Expand All @@ -62,19 +52,8 @@ install-data-local:
chmod 0750 $(DESTDIR)$(localstatedir)/lib/swtpm-localca || true; \
fi

# for out-of-tree builds we need to clean up
clean-local:
if test "$(top_srcdir)" != "$(top_builddir)"; then \
rm -f setup.py; \
fi
rm -rf py_swtpm_localca/__pycache__/
rm -rf swtpm_localca.egg-info/
rm -rf dist

EXTRA_DIST= \
setup.py \
swtpm-create-tpmca \
swtpm-create-user-config-files \
swtpm-localca \
swtpm-localca.conf \
swtpm-localca.options
Empty file.
Loading

0 comments on commit 74f66ac

Please sign in to comment.