Skip to content

Instantly share code, notes, and snippets.

@tesch1
Last active December 18, 2019 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tesch1/444d09b62bd49756c59ae89b4b9244c9 to your computer and use it in GitHub Desktop.
Save tesch1/444d09b62bd49756c59ae89b4b9244c9 to your computer and use it in GitHub Desktop.
creates fake rpm for centos/fedora that "provides" all known texlive packages, so other packages cooperate with a local texlive install
#/bin/bash
set -e
SPECFILE=texlive17.spec
cat << EOF > "$SPECFILE"
Name: texlive-FAKE
Version: 2017
Release: 4%{?dist}
Summary: Dummy wrapper for manual texlive install
License: Artistic 2.0 and GPLv2 and GPLv2+ and LGPLv2+ and LPPL and MIT and Public Domain and UCD and Utopia
URL: http://www.tug.org/texlive/quickinstall.html
Source0: texlive.profile
#Source1: http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
BuildRequires: perl
Requires: perl
EOF
# add all the texlive package as conflicts and as provided by this
# package >:)
BINARY_PACKAGES=()
while read line; do
pkg=$(echo "$line" | sed 's/\..*//')
#echo "$line -> $pkg"
case "$pkg" in
"")
# do nothing, empty
echo "$line -> $pkg"
;;
texlive-FAKE*)
# that's us.. ignore
;;
texlive*-bin|texlive*-lib)
echo "Provides: $pkg" >> "$SPECFILE"
echo "Conflicts: $pkg" >> "$SPECFILE"
;;
texlive*)
BINARY_PACKAGES+=($pkg)
;;
*)
# some junk output from 'yum search'
;;
esac
done < <(yum search texlive)
#
# Create a common sub-package
#
cat << EOF >> "$SPECFILE"
%package common
BuildArch: noarch
Summary: Dummy wrapper for manual texlive install, binary files
EOF
for pkg in "${BINARY_PACKAGES[@]}" ; do
echo "Provides: $pkg" >> "$SPECFILE"
echo "Conflicts: $pkg" >> "$SPECFILE"
done
cat << EOF >> "$SPECFILE"
%description
This package just tells rpm/yum/dnf that all texlive packages are
available. You actually have to install them yourself using the
texlive installer from: http://www.tug.org/texlive/quickinstall.html
%description common
blah
%prep
#%setup -q
%build
#./install-tl -profile texlive.profile %{_bindir}
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}
#install %{_builddir}
%files
%files common
%doc
%changelog
EOF
rpmbuild -ba -v "$SPECFILE"
cp ~/rpmbuild/RPMS/*/texlive*.rpm .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment