--- /dev/null
+diff --git a/Makefile.in b/Makefile.in
+index 2d36791..6bd4219 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -396,7 +396,8 @@ expect: exp_main_exp.o $(PKG_LIB_FILE)
+ @TCL_LIB_SPEC@ \
+ @TCL_DL_LIBS@ @PKG_LIBS@ @MATH_LIBS@ \
+ @TCL_CC_SEARCH_FLAGS@ \
+- @EXP_CC_SEARCH_FLAGS@
++ @EXP_CC_SEARCH_FLAGS@ \
++ -pie
+ $(SETUID) expect
+
+ expectk:
--- /dev/null
+Name: expect
+Version: 5.45.4
+Release: 0
+Summary: A Tool for Automating Interactive Programs
+License: Public-Domain
+Group: Development/Languages/Tcl
+Url: http://expect.nist.gov
+Source: %{name}%{version}.tar.gz
+Source1: expect-rpmlintrc
+Source2: add_pie_compile_option.patch
+Source1001: expect.manifest
+
+BuildRequires: autoconf
+BuildRequires: tcl-devel
+
+%description
+Expect is a tool primarily for automating interactive applications,
+such as telnet, ftp, passwd, fsck, rlogin, tip, and more. Expect
+really makes this stuff trivial. Expect is also useful for testing
+these applications. It is described in many books, articles, papers,
+and FAQs. There is an entire book on it available from O'Reilly.
+
+%package devel
+Summary: Header Files and C API Documentation for expect
+Group: Development/Libraries/Tcl
+
+%description devel
+This package contains header files and documentation needed for linking
+to expect from programs written in compiled languages like C, C++, etc.
+This package is not needed for developing scripts that run under the
+/usr/bin/expect interpreter, or any other Tcl interpreter with the
+expect package loaded.
+
+%prep
+%setup -q -n %name%version
+cp %{SOURCE1001} .
+%{__patch} -p1 < %{SOURCE2}
+
+%build
+%reconfigure \
+ --with-tcl=%_libdir \
+ --with-tk=no_tk \
+ --with-tclinclude=%_includedir \
+ --enable-shared
+
+make %{?_smp_mflags} all
+
+# %check
+# make test
+
+%install
+make install DESTDIR=$RPM_BUILD_ROOT
+# Remove some executables and manpages we don't want to ship
+rm $RPM_BUILD_ROOT%_prefix/bin/*passwd
+rm $RPM_BUILD_ROOT%_mandir/*/*passwd*
+
+%{remove_docs}
+
+%files
+%manifest %{name}.manifest
+%{_prefix}/bin/*
+%{_libdir}/%{name}%{version}/lib*.so
+%{_libdir}/%{name}%{version}/pkgIndex.tcl
+
+%files devel
+%manifest %{name}.manifest
+%{_includedir}/*
+
+%changelog