File xchroot.spec of Package xchroot
#
# spec file for package xchroot
#
# Copyright (c) 2019 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: xchroot
Version: 2.7.5
Release: 0
Summary: chroot for Xorg/X11 with unionfs/aufs support
License: GPL-3.0-only
Group: System/X11/Utilities
URL: https://www.elstel.org/xchroot/
Source0: %{name}-v%{version}.tar
Source1: %{name}-doc-2023-01-16.tar
Requires: bash, coreutils, sudo
BuildRequires: coreutils
BuildRequires: man
BuildArch: noarch
%description
xchroot is a little convenience bash script that will allow you to run X-based programs with audio support in a chroot environment. User management is included. You may also chroot to a new environment without touching any of its files either by using aufs or unionfs. You may backup your temporary changes on exit and kill of xchroot as squashfs incrementally and restore them.
%prep
#tar -xzf %{source1}; cd www.elstel.org
%setup -q -b 1
%build
chmod +x xchroot
./xchroot --license >COPYING
sed -n '2,/^$/p' <xchroot | sed 's/^#//' >ChangeLog
pushd $RPM_BUILD_DIR/website
mv auxil/* xchroot/
sed -i 's#\(\.\.\)\?/auxil/##' xchroot/*.html
popd
sed "s#%{_datadir}/doc\[/packages\]/xchroot#%_docdir/xchroot#" xchroot.8 | gzip -c >xchroot.8.gz
%install
mkdir -p %{buildroot}%{_sbindir}
install xchroot %{buildroot}%{_sbindir}/xchroot
mkdir -p %{buildroot}%{_mandir}/man8/
install -m 0644 xchroot.8.gz %{buildroot}%{_mandir}/man8/
%post
%{_sbindir}/xchroot inst-root-sudo --quiet
%files
%{_sbindir}/xchroot
%license COPYING
%doc ChangeLog
%doc ../website/xchroot/*
%doc %_mandir/man8/xchroot.8*
# ext_man seems not defined in Mageia: %{_mandir}/man8/xchroot.8%{?ext_man}
%changelog