texmf.sh (2500B)
1do_build() { 2 local f p 3 # Extract the source files 4 mkdir -p "build/usr/share/texmf-dist" 5 find . -maxdepth 1 -print -name "*.tar.xz" \ 6 -exec bsdtar -C "build/usr/share/texmf-dist" -xf {} \; 7 cd "build/usr/share/texmf-dist/" 8 # Everything in usr/share/texmf-dist/texmf-dist should really be in 9 # usr/share/texmf-dist, so we move it 10 if [ -d "texmf-dist" ] ; then 11 rsync -ar texmf-dist/ ./ 12 rm -rf texmf-dist/ 13 fi 14 # LICENSEs are unneeded 15 rm -f LICENSE* 16 17 # We have some conflicting files between different packages. To work 18 # around this, we use an ownership file that maps which conflicting 19 # files should be in which packages. Here, each file in the map list is 20 # checked whether it is in the package, and if it shouldn't be it is 21 # removed. 22 while IFS=' ' read -r f p ; do 23 if [ "$p" = "$pkgname" ] && ! [ -e "$f" ]; then 24 # Error out if the ownership map expects this package to have a 25 # file but it dosen't 26 msg_error "$pkgver: missing file $f\n" 27 elif [ "$p" != "$pkgname" ] && [ -e "$f" ]; then 28 # Remove a file that according to the ownership map belongs to 29 # another file 30 echo "removed $f" 31 # Install a file that lists the removed packages 32 mkdir -p ../texlive/removed 33 echo "$f" >> ../texlive/removed/$pkgname.txt 34 rm -f "$f" 35 fi 36 done < "${XBPS_COMMONDIR}/environment/build-style/texmf/ownership.txt" 37} 38 39do_check() { 40 # This is essentially a helper for generating the ownership map. It checks 41 # to see if there are any conflicts between all of the different packages. 42 local f p current_ver current_rev exitcode=0 43 cd build 44 45 while read p; do 46 # Don't check against the texlive-bin* packages, ourselves, -dbg or -32bit pkgs 47 if [[ ${p%-*} =~ .*-bin$ ]] || [ "${p%-*}" = "$pkgname" ] || [[ ${p%-*} =~ .*-dbg$ ]] || [[ ${p%-*} =~ .*-32bit$ ]]; then 48 continue 49 fi 50 # Don't check against any version other than the version in the source tree 51 current_ver="$(grep -m 1 version= ${XBPS_SRCPKGDIR}/${p%-*}/template | cut -d= -f2)" 52 current_rev="$(grep -m 1 revision= ${XBPS_SRCPKGDIR}/${p%-*}/template | cut -d= -f2)" 53 if [ "${p%-*}-${current_ver}_${current_rev}" != "${p}" ]; then 54 # They are not the same version 55 continue 56 fi 57 echo checking conflicts with ${p}... 58 while IFS= read -r f; do 59 if [ -e ".$f" ]; then 60 msg_red "both contain file $f\n" 61 exitcode=1 62 fi 63 done < <(xbps-query -Rf $p | sed 's/ -> .*//') 64 done < <(xbps-query -Rs texlive -p pkgver | cut -d : -f 1) 65 return $exitcode 66} 67 68do_install() { 69 vcopy build/usr . 70}