--- /dev/null
+# As there are no released versions of libxzfile, I'm using a
+# version from git.
+%global gitdate 20121126
+
+Name: libxzfile
+Version: 0
+Release: 0.1.git%{gitdate}%{?dist}
+Summary: Compressed XZ file I/O library
+
+License: Public Domain
+URL: http://git.tukaani.org/?p=libxzfile.git;a=summary
+
+# Prepare the tarball as follows:
+#
+# git clone http://git.tukaani.org/libxzfile.git
+# git archive --prefix=libxzfile/ -o libxzfile-%{gitdate}.tar.gz HEAD
+Source0: libxzfile-%{gitdate}.tar.gz
+
+BuildRequires: xz-devel
+BuildRequires: autoconf, automake, libtool
+
+
+%description
+xzfile is a library for reading and writing xz-compressed files.
+
+
+%package devel
+Summary: Development files for %{name}
+
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+
+%description devel
+The %{name}-devel package contains libraries and header files for
+developing applications that use %{name}.
+
+
+%prep
+%setup -q -n %{name}
+
+autoreconf -i
+
+
+%build
+%configure --disable-static
+make %{?_smp_mflags}
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%make_install
+
+find $RPM_BUILD_ROOT -name '*.la' -delete
+
+# Current sources don't install the include file.
+mkdir -p $RPM_BUILD_ROOT%{_includedir}
+install -m 0644 src/libxzfile/xzfile.h $RPM_BUILD_ROOT%{_includedir}
+
+# Add a pkg-config file.
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkgconfig
+cat > $RPM_BUILD_ROOT%{_libdir}/pkgconfig/%{name}.pc <<EOF
+prefix=%{_prefix}
+exec_prefix=%{_prefix}
+libdir=%{_libdir}
+includedir=%{_includedir}
+
+Name: %{name}
+Description: Compressed XZ file I/O library
+URL: http://tukaani.org/xz/
+Version: %{version}
+Cflags: -I${includedir}
+Libs: -L${libdir} -lxzfile
+Libs.private: -pthread
+EOF
+
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+%files
+%doc COPYING
+%{_libdir}/*.so.*
+%{_bindir}/xzfcat
+
+
+%files devel
+%doc COPYING TODO
+%{_includedir}/*
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/%{name}.pc
+
+
+%changelog
+* Sat Jun 22 2013 Richard W.M. Jones <rjones@redhat.com> 0-0.1.git20121126
+- Initial release.