File:  [LON-CAPA] / doc / loncapafiles / picins_check.piml
Revision 1.59: download - view: text, annotated - select for diffs
Fri Nov 15 16:25:30 2024 UTC (9 days, 8 hours ago) by raeburn
Branches: MAIN
CVS tags: version_2_12_X, version_2_11_X, HEAD
- - Support Fedora 41

<!DOCTYPE piml PUBLIC "-//TUX/DTD piml 1.0 Final//EN" 
	"http://lpml.sourceforge.net/DTD/piml.dtd">
<!-- picins_check.piml -->
<!-- Stuart Raeburn -->

<!-- $Id: picins_check.piml,v 1.59 2024/11/15 16:25:30 raeburn Exp $ -->

<!--

This file is part of the LearningOnline Network with CAPA (LON-CAPA).

LON-CAPA is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

LON-CAPA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with LON-CAPA; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

/home/httpd/html/adm/gpl.txt

http://www.lon-capa.org/

-->

<piml>
<files>
<file>
<perlscript mode="fg" dist="fedora9 fedora10 fedora11 fedora12 fedora13 fedora14 fedora15 fedora16 fedora17 fedora18 fedora19 fedora20 fedora21 fedora22 fedora 23 fedora24 fedora25 fedora26 fedora27 fedora28 fedora29 fedora30 fedora31 fedora32 fedora33 fedora34 fedora35 fedora36 fedora37 fedora38 fedora39 fedora40 fedora41 rhes6 scientific6 centos6 oracle6 rhes7 scientific7 centos7 oracle7 rhes8 centos8 oracle8 rocky8 alma8 centos8-stream centos9-stream rhes9 oracle9 rocky9 alma9 sles11 sles12 sles15 suse11.1 suse11.2 suse11.3 suse11.4 suse12.1 suse12.2 suse12.3 suse13.1 suse13.2 debian5 debian6 debian10 debian11 debian12 ubuntu8 ubuntu10 ubuntu12 ubuntu14 ubuntu16 ubuntu18 ubuntu20 ubuntu22 ubuntu24">
    my $picinspath = '/usr/share/texmf/tex/latex/picins'; 
    my $file = 'picins.sty';
    if (!-e "$picinspath/$file") {
        if (!-d $picinspath) {
            my @parts=split('/',$picinspath);
            my $filepath;
            foreach my $part (@parts) {
                $filepath.= '/'.$part;
                if (!-d $filepath) {
                    mkdir($filepath,0755);
                }
            }
        } else {
            chmod(0755,$picinspath);
        }
        if (-d $picinspath) {
            my $srcurl = 'http://install.loncapa.org/ctan/tex-archive/macros/latex209/contrib/picins/picins.sty';
            system("/usr/bin/wget -O $picinspath/$file $srcurl 1>/dev/null 2>/dev/null");
            die("/usr/bin/wget -O $srcurl failed") if $?;
            chmod(0644, "$picinspath/$file");
            if (-e $picinspath.'/'.$file) {
                if ('<DIST />' eq 'ubuntu16' || '<DIST />' eq 'ubuntu18' || 
                    '<DIST />' eq 'ubuntu20' || '<DIST />' eq 'ubuntu22' ||
                    '<DIST />' eq 'ubuntu24' || '<DIST />' eq 'centos9-stream' ||
                    '<DIST />' eq 'rhes9'    || '<DIST />' eq 'oracle9' ||
                    '<DIST />' eq 'rocky9'   || '<DIST />' eq 'alma9' ||
                    '<DIST />' eq 'debian10' || '<DIST />' eq 'debian11' ||
                    '<DIST />' eq 'debian12') {
                    system('/usr/bin/mktexlsr');
                    die("Can't run /usr/bin/mktexlsr") if $?;
                    print "$picinspath/$file created and /usr/bin/mktexlsr ran successfully.\n";
                } else { 
                    system('/usr/bin/texconfig rehash  1>/dev/null 2>/dev/null');
                    die("Can't run /usr/bin/texconfig rehash") if $?;
                    print "$picinspath/$file created and /usr/bin/texconfig rehash ran successfully.\n";
                }
                chmod(0644,"$picinspath/$file");
            } else {
                die("Can't find $picinspath/$file");
            }
        } else {
            die("Can't find $picinspath") if $?;
        }
    } else {
        chmod(0755,$picinspath);
        chmod(0644,"$picinspath/$file");
        print "No action required - $picinspath/$file already exists.\n";
    }
</perlscript>
</file>
</files>
</piml>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>