RPerl

 view release on metacpan or  search on metacpan

script/rperl_installer.sh  view on Meta::CPAN


#            # DEV NOTE: prefer already-fixed tarball below
#            B wget https://github.com/mongodb/mongo-cxx-driver/archive/r3.2.0.tar.gz
#            S mv ./r3.2.0.tar.gz /root/rpmbuild/SOURCES/mongo-cxx-driver-3.2.0.tar.gz
#            CD /root/rpmbuild/SOURCES
#            S tar -xzvf mongo-cxx-driver-3.2.0.tar.gz
#            S mv mongo-cxx-driver-r3.2.0 mongo-cxx-driver-3.2.0
#            S rm mongo-cxx-driver-3.2.0.tar.gz
#            S tar -czvf mongo-cxx-driver-3.2.0.tar.gz ./mongo-cxx-driver-3.2.0
            # DEV NOTE: prefer our own already-fixed tarball below, for convenience
            B wget https://github.com/wbraswell/mongo-cxx-driver-mirror/raw/master/mongo-cxx-driver-3.2.0.tar.gz
            S mv ./mongo-cxx-driver-3.2.0.tar.gz /root/rpmbuild/SOURCES/mongo-cxx-driver-3.2.0.tar.gz
            CD /root/rpmbuild/SPECS
            S wget https://raw.githubusercontent.com/wbraswell/mongo-cxx-driver-mirror/master/mongo-cxx-driver.spec
            S rpmbuild -ba /root/rpmbuild/SPECS/mongo-cxx-driver.spec
            S rpm -i -vv /root/rpmbuild/RPMS/x86_64/mongo-cxx-driver-libs-3.2.0-1.el7.centos.x86_64.rpm
            S rpm -i -vv /root/rpmbuild/RPMS/x86_64/mongo-cxx-driver-3.2.0-1.el7.centos.x86_64.rpm
            S rpm -i -vv /root/rpmbuild/RPMS/x86_64/mongo-cxx-driver-devel-3.2.0-1.el7.centos.x86_64.rpm

            # DEV NOTE: copy our own pre-built packages into CPANtoFPM directory structure
            CD ~/cpantofpm_packages/SPECS/
            B wget https://github.com/wbraswell/mongo-cxx-driver-mirror/raw/master/mongo-cxx-driver.spec    
            CD ~/cpantofpm_packages/SRPMS/
            B wget https://github.com/wbraswell/mongo-cxx-driver-mirror/raw/master/mongo-cxx-driver-3.2.0-1.el7.centos.src.rpm
            CD ~/cpantofpm_packages/x86_64/
            B wget https://github.com/wbraswell/mongo-cxx-driver-mirror/raw/master/mongo-cxx-driver-libs-3.2.0-1.el7.centos.x86_64.rpm
            B wget https://github.com/wbraswell/mongo-cxx-driver-mirror/raw/master/mongo-cxx-driver-3.2.0-1.el7.centos.x86_64.rpm
            B wget https://github.com/wbraswell/mongo-cxx-driver-mirror/raw/master/mongo-cxx-driver-devel-3.2.0-1.el7.centos.x86_64.rpm
        fi

        # [[[ RPM, YUM REPOSITORY ]]]
        # [[[ RPM, YUM REPOSITORY ]]]
        # [[[ RPM, YUM REPOSITORY ]]]

        # server, install deps, RUN ONCE ONLY
        if [[ "$OS_CHOICE" == "ubuntu" ]]; then
            S apt-get install createrepo yum-utils gnupg2 gnupg-agent rng-tools
        elif [[ "$OS_CHOICE" == "centos" ]]; then
            S yum install createrepo yum-utils gnupg2 rng-tools
        fi

        # server, prepare to receive RPMs tarball
        S mkdir -p /srv/www/packages.rperl.org/public_html/centos/7/rperl
        CD /srv/www/packages.rperl.org/public_html/centos/7/rperl
        S rm -Rf DEPS SPECS SRPMS x86_64 *.tar.gz
        
        # packager machine, create & transfer RPMs tarball
        B ~/manual_packages_copy.sh
        CD ~/cpantofpm_packages
        B tar -czvf ./perl-RPerl-VERSION-1-RPM_ALL_DEPS.tar.gz ./*
        B scp ./perl-RPerl-VERSION-1-RPM_ALL_DEPS.tar.gz packages.rperl.org:/srv/www/packages.rperl.org/public_html/centos/7/rperl/

        # server, unpack RPMs tarball & set initial permissions
        CD /srv/www/packages.rperl.org/public_html/centos/7/rperl
        B tar -xzvf perl-RPerl-VERSION-1-RPM_ALL_DEPS.tar.gz
        S chown -R www-data.www-data /srv/www/packages.rperl.org/
        S chmod -R g+rwX,o-w /srv/www/packages.rperl.org/

        # server, generate & export & import GPG keys, RUN ONCE ONLY
        S rngd -r /dev/urandom
        B gpg2 --full-gen-key
            # William N. Braswell, Jr. (packages.rperl.org) <william.braswell@autoparallel.com>
        B gpg2 --list-keys
        B gpg2 --export --armor "William N. Braswell, Jr. (packages.rperl.org) <william.braswell@autoparallel.com>" > /srv/www/packages.rperl.org/public_html/centos/RPM-GPG-KEY-RPerl-7
        B less /srv/www/packages.rperl.org/public_html/centos/RPM-GPG-KEY-RPerl-7  # confirm key has been exported
        B rpmkeys --import /srv/www/packages.rperl.org/public_html/centos/RPM-GPG-KEY-RPerl-7
        B rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{SUMMARY}\n'  # confirm key has been imported

        # server, prepare to sign RPMs, RUN ONCE ONLY
        B vi ~/.rpmmacros
            # %_signature gpg
            # %_gpg_name William N. Braswell, Jr. (packages.rperl.org) <william.braswell@autoparallel.com>
            # %_gpg_bin /usr/bin
            # %__gpg /usr/bin/gpg2

        # server, sign RPMs & confirm signed
        CD /srv/www/packages.rperl.org/public_html/centos/7/rperl
        B export GPG_TTY=$(tty)
        B rpmsign --addsign SRPMS/*.rpm x86_64/*.rpm
        B rpm -qpi SRPMS/*.rpm x86_64/*.rpm | grep Signature

        # server, create repo & sign repo metadata & confirm signed
        CD /srv/www/packages.rperl.org/public_html/centos/7/rperl/x86_64
        B rm -Rf ./repodata/
        B createrepo --verbose .
        B gpg2 --detach-sign --armor repodata/repomd.xml
        B less repodata/repomd.xml.asc

        # server, generate repo file, RUN ONCE ONLY
        B vi /srv/www/packages.rperl.org/public_html/centos7-perl-cpan.repo
            [centos7-perl-cpan]
            name=CentOS 7 Perl CPAN Repository
            baseurl=https://packages.rperl.org/centos/7/rperl/x86_64/
            enabled=1
            gpgcheck=1
            repo_gpgcheck=1
            gpgkey=https://packages.rperl.org/centos/RPM-GPG-KEY-RPerl-7

        # server, set final permissions
        S chown -R www-data.www-data /srv/www/packages.rperl.org/
        S chmod -R g+rwX,o-w /srv/www/packages.rperl.org/

        # [[[ DEB, APT REPOSITORY ]]]
        # [[[ DEB, APT REPOSITORY ]]]
        # [[[ DEB, APT REPOSITORY ]]]

# DEB START HERE: set up server, set up client, install
# DEB START HERE: set up server, set up client, install
# DEB START HERE: set up server, set up client, install

    elif [ $MACHINE_CHOICE == '1' ] || [ $MACHINE_CHOICE == 'existing' ]; then
        echo "Nothing To Do On Existing Machine!"
    fi
    CURRENT_SECTION_COMPLETE
fi

if [ $SECTION_CHOICE -le 23 ]; then
    echo '23. [[[ LINUX, INSTALL RPERL DEPENDENCIES ]]]'
    echo
    if [ $MACHINE_CHOICE == '0' ] || [ $MACHINE_CHOICE == 'new' ]; then
        echo '[ Overview Of RPerl Dependencies In This Section ]'
        echo '[ GCC: gcc & g++ Required For Compiling ]'
        echo '[ libc: libcrypt.(a|so) Required For Compiling ]'
        echo '[ libperl: libperl.(a|so) & perl.h etc, Required For Compiling ]'
        echo '[ openssl: err.h Required By RPerl Subdependency Net::SSLeay From IO::Socket::SSL From ... From Alien::* ]'
        echo '[ zlib: zlib.h Required By SDL.pm, Itself Required For Graphics In RPerl Applications ]'
        echo '[ GMP: GNU Multiple-Precision Arithmetic Library Required For Math ]'
        echo '[ GSL: GNU Scientific Library Required For Math ]'
        echo '[ Pluto polyCC: polycc Required For Parallel Compiling, Depends On texinfo flex bison ]'
        echo '[ AStyle: Artistic Style C++ Formatter, Required By RPerl Test Suite ]'
        echo '[ pkg-config: Compilation Library Detection Tool, Required By RPerl Support For MongoDB ]'
        echo '[ MongoDB Drivers: Both C & C++, Required By RPerl Support For MongoDB ]'
        echo

        # DEV NOTE: libperl packages in Ubuntu vs CentOS
        # Ubuntu, libperl-dev,  /usr/lib/x86_64-linux-gnu/libperl.so SYMLINK    /usr/lib/x86_64-linux-gnu/libperl.a REAL FILE
        # Ubuntu, libperl5.XX,  /usr/lib/x86_64-linux-gnu/libperl.so.5.XX.Y REAL FILE    /usr/lib/x86_64-linux-gnu/perl/5.26.0/CORE/perl.h  and other *.h *.so *.pm *.ph files
        # CentOS 7, perl-libs,  /usr/lib64/perl5/CORE/libperl.so
        # CentOS 7, perl-devel, /usr/lib64/perl5/CORE/perl.h     /usr/bin/h2xs  and other *.h files

        if [[ "$OS_CHOICE" == "ubuntu" ]]; then
            VERIFY_UBUNTU
            echo '[ Add Non-Base APT Repositories ]'
            S add-apt-repository \"deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse\"
            echo '[ Update APT Repositories ]'
            S apt-get update
            echo '[ Install RPerl Dependencies ]'
            S apt-get install g++ make libc6-dev perl libperl-dev libssl-dev zlib1g zlib1g-dev libgmp10 libgmpxx4ldbl libgmp-dev libgsl0-dev texinfo flex bison astyle

            echo '[ Install RPerl Dependencies, MongoDB C++ Driver Prerequisites, pkg-config ]'
            S apt-get install pkg-config

# DEB START HERE: build & use our own libbson & libmongoc & libmongocxx packages, remove use of Bionic repo below
# DEB START HERE: build & use our own libbson & libmongoc & libmongocxx packages, remove use of Bionic repo below
# DEB START HERE: build & use our own libbson & libmongoc & libmongocxx packages, remove use of Bionic repo below

            echo "[ Install RPerl Dependencies, MongoDB C & C++ Drivers; Must Use Latest libbson & libmongoc From Bionic v18.04 Repositories ]"

script/rperl_installer.sh  view on Meta::CPAN

            echo
            echo '__OR__ '
            echo
            echo '24b. [[[ PERL, INSTALL RPERL, LATEST STABLE VIA CPANM, SINGLE-USER ]]]'
            echo '    [ You SHOULD NOT Use This Instead Of Stable Via Packages In Section 24a, Unless You Are An RPerl System Developer ]'
            echo '    [ This Option Will Install The Latest Stable Public Release Of RPerl, Built & Compiled On Your System, Using `cpanm` For Your Single User Only ]'
            echo
            echo '__OR__ '
            echo
            echo '24c. [[[ PERL, INSTALL RPERL, LATEST STABLE VIA CPANM, SYSTEM-WIDE ]]]'
            echo '    [ You SHOULD NOT Use This Instead Of Stable Via Packages In Section 24a, Unless You Are An RPerl System Developer ]'
            echo '    [ This Option Will Install The Latest Stable Public Release Of RPerl, Built & Compiled On Your System, Using `cpanm` For The Entire System ]'
            echo
            echo '__OR__ '
            echo
            echo '24d. [[[ PERL, INSTALL RPERL, LATEST STABLE VIA CPAN, SINGLE-USER ]]]'
            echo '    [ You SHOULD NOT Use This Instead Of Stable Via Packages In Section 24a, Unless You Are An RPerl System Developer ]'
            echo '    [ This Option Will Install The Latest Stable Public Release Of RPerl, Built & Compiled On Your System, Using `cpan` For Your Single User Only ]'
            echo
            echo '__OR__ '
            echo
            echo '24e. [[[ PERL, INSTALL RPERL, LATEST STABLE VIA CPAN, SYSTEM-WIDE ]]]'
            echo '    [ You SHOULD NOT Use This Instead Of Stable Via Packages In Section 24a, Unless You Are An RPerl System Developer ]'
            echo '    [ This Option Will Install The Latest Stable Public Release Of RPerl, Built & Compiled On Your System, Using `cpan` For The Entire System ]'
            echo
            echo '__OR__ '
            echo
            echo '24f. [[[ PERL, INSTALL RPERL, LATEST UNSTABLE VIA GITHUB, SINGLE-USER, SECURE GIT ]]]'
            echo '    [ You SHOULD NOT Use This Instead Of Stable Via Packages In Section 24a, Unless You Are An RPerl System Developer ]'
            echo '    [ This Option Will Install The Latest Unstable Development Release Of RPerl, Built & Compiled On Your System, Using Secure Github For Your Single User Only ]'
            echo
            echo '__OR__ '
            echo
            echo '24g. [[[ PERL, INSTALL RPERL, LATEST UNSTABLE VIA GITHUB, SINGLE-USER, PUBLIC GIT ]]]'
            echo '    [ You SHOULD NOT Use This Instead Of Stable Via Packages In Section 24a, Unless You Are An RPerl System Developer ]'
            echo '    [ This Option Will Install The Latest Unstable Development Release Of RPerl, Built & Compiled On Your System, Using Public Github For Your Single User Only ]'
            echo
            echo '__OR__ '
            echo
            echo '24h. [[[ PERL, INSTALL RPERL, LATEST UNSTABLE VIA GITHUB, SINGLE-USER, PUBLIC ZIP ]]]'
            echo '    [ You SHOULD NOT Use This Instead Of Stable Via Packages In Section 24a, Unless You Are An RPerl System Developer ]'
            echo '    [ This Option Will Install The Latest Unstable Development Release Of RPerl, Built & Compiled On Your System, Using Public Github For Your Single User Only ]'

            C 'Please read the warnings above.  Seriously.'
            echo

            P $RPERL_INSTALL_CHOICE $'letter or word for an RPerl installation option:\n[a] packages\n[b] cpanm-single\n[c] cpanm-system\n[d] cpan-single\n[e] cpan-system\n[f] github-secure-git\n[g] github-public-git\n[h] github-public-zip\n'
            RPERL_INSTALL_CHOICE=$USER_INPUT
        fi

        if [ $RPERL_INSTALL_CHOICE == 'a' ] || [ $RPERL_INSTALL_CHOICE == 'packages' ]; then
            echo '24a. [[[ PERL, INSTALL RPERL, LATEST STABLE VIA PACKAGES.RPERL.ORG ]]]'
            echo

            if [[ "$OS_CHOICE" == "ubuntu" ]]; then
                # DEB START HERE: create packages
                # DEB START HERE: create packages
                # DEB START HERE: create packages
                echo 'NEED DEB COMMANDS HERE'
            elif [[ "$OS_CHOICE" == "centos" ]]; then
                S yum install pygpgme  # check GPG signatures of repo metadata & packages
                S yum-config-manager --add-repo https://packages.rperl.org/centos7-perl-cpan.repo
                S yum-config-manager --enable centos7-perl-cpan
                S yum repolist all    # confirm repo is in list
                S yum clean metadata  # clean metadata from other repos, or after updating our repo
                S yum install perl-RPerl

                echo '[ CHECK RPERL INSTALL ]'
                B which rperl
                B rpm -qf /usr/bin/rperl

                echo '[ UNINSTALL RPERL, IF LAST TRANSACTION ]'
                S yum history
                S yum history undo last
            fi

        elif [ $RPERL_INSTALL_CHOICE == 'b' ] || [ $RPERL_INSTALL_CHOICE == 'cpanm-single' ]; then
            echo '24b. [[[ PERL, INSTALL RPERL, LATEST STABLE VIA CPANM, SINGLE-USER ]]]'
            echo '[ You Should Only Use This Option 24b If local::lib Or Perlbrew Is Installed For Your User ]'
            echo

            echo '[ Install Problematic RPerl Dependency IO::Socket::SSL, Skip Tests ]'
            B cpanm -v --notest IO::Socket::SSL
            echo '[ Install Missing Alien::GMP Dependencies ]'
            B cpanm -v --notest File::Which FFI::CheckLib Path::Tiny File::chdir Capture::Tiny Alien::GMP
            echo '[ Install RPerl ]'
            B cpanm -v --notest RPerl

        elif [ $RPERL_INSTALL_CHOICE == 'c' ] || [ $RPERL_INSTALL_CHOICE == 'cpanm-system' ]; then
            echo '24c. [[[ PERL, INSTALL RPERL, LATEST STABLE VIA CPANM, SYSTEM-WIDE ]]]'
            echo '[ You Should Only Use This Option 24c If local::lib Or Perlbrew Is NOT Installed For Your User ]'
            echo

            echo '[ Install Problematic RPerl Dependency IO::Socket::SSL, Skip Tests ]'
            S cpanm -v --notest IO::Socket::SSL
            echo '[ Install Missing Alien::GMP Dependencies ]'
            S cpanm -v --notest File::Which FFI::CheckLib Path::Tiny File::chdir Capture::Tiny Alien::GMP
            echo '[ Install RPerl ]'
            S cpanm -v --notest RPerl

        elif [ $RPERL_INSTALL_CHOICE == 'd' ] || [ $RPERL_INSTALL_CHOICE == 'cpan-single' ]; then
            echo '24d. [[[ PERL, INSTALL RPERL, LATEST STABLE VIA CPAN, SINGLE-USER ]]]'
            echo '[ You Should Only Use This Option 24d If local::lib Or Perlbrew Is Installed For Your User, And You Do NOT Have CPANM Installed ]'
            echo

            echo '[ Install Problematic RPerl Dependency IO::Socket::SSL ]'
            B cpan -T IO::Socket::SSL
            echo '[ Install Missing Alien::GMP Dependencies ]'
            B cpan -T --notest File::Which FFI::CheckLib Path::Tiny File::chdir Capture::Tiny Alien::GMP
            echo '[ Install RPerl ]'
            B cpan -T RPerl

        elif [ $RPERL_INSTALL_CHOICE == 'e' ] || [ $RPERL_INSTALL_CHOICE == 'cpan-system' ]; then
            echo '24e. [[[ PERL, INSTALL RPERL, LATEST STABLE VIA CPAN, SYSTEM-WIDE ]]]'
            echo '[ You Should Only Use This Option 24e If local::lib Or Perlbrew Is NOT Installed For Your User, And You Do NOT Have CPANM Installed ]'
            echo

            echo '[ Install Problematic RPerl Dependency IO::Socket::SSL ]'
            S cpan -T IO::Socket::SSL
            echo '[ Install Missing Alien::GMP Dependencies ]'
            S cpan -T --notest File::Which FFI::CheckLib Path::Tiny File::chdir Capture::Tiny Alien::GMP



( run in 1.980 second using v1.01-cache-2.11-cpan-df04353d9ac )