Skip to content

dev_templateGuide

Xmetalfanx edited this page Mar 30, 2023 · 3 revisions

Non Default-Repo Installs

Flatpak and Snap

Flatpaks

installFlatpakApp function

  • What gets passed (in order)

    • programName/programTitle,

    • flatpakName

    • flatpakRepo

    • Function task(s):

      1. support for Flatpaks is done inside
        • (installed if needed)
      2. Flathub support is checked for and/or installed (since so many things come from there anyway)
      3. the Flatpak is installed
  • How to use/call function:

    • flatpak install $flatpakInfo $flatpakRepo

Snaps

installSnapApp function

  • What gets passed
    • programName/programTitle,

    • snapName

    • snapType

      • the snapType would be --classic or --beta, for example
    • How to use/call function:

      • snap install $snapType $snapName

Third Party Downloads

Github Links

  • Tarball, Zip, RPM, DEB, Appimages (NOT Github links)
  • (TODO)

Non-Github Links

metaExternalDownload function

  • function description:

    • this third party meta function(s), handles

      • .tar.gz|.tgz|.tar.bz2|.zip
      • .deb|.rpm|
      • .AppImage
    • function tasks

      1. Strips info based on the URL: stripFileInfo function called
      2. Downloads files with extensions (listed above): downloadFile function called
      3. Extracts/Installs:
        • function passed to: handleDownloaded
          • Zip and Tar Archives:
            • Extract zip, and tar archives
          • RPM:
            • Installs RPM (using zypper or dnf over "rpm -i" since the former handles dependencies better)
          • DEB:
            • Installs DEBs via "gdebi"
              • reasoning: I heard gdebi handles dependencies better than "dpkg -i"
              • this checks if gdebi is installed,
                • if not, gdebi gets installed
          • AppImage:
            • Asks if a user wants to "+x" the AppImage, to mark it as executable
  • Issue:

    • At the moment due to issues getting the exact file name, Sourceforge linked files MAY have to be hardcoded ... even if i dont like that.
      • Update: the unrollURL type function i nabbed from deb-get may address this
        • I renamed this to unpackURL and it's in the f_thirdparty.cfg file

Install from the AUR on Arch based installs

aurAppInstall function

  • What gets passed:

    • packageName
  • Function tasks:

    • What AUR Helper to use?:
      • Pass to a function to check if trizen or yay is installed: AURHelperCheck

        • ​ if both are installed, the user is prompted for which one they rather use
        • I have a archSettings.cfg file that has this assigned in it, at some point.
          • I can not remember if the file + var is detected, if i still ask the user what they want to do OR just use that default AUR Helper. If i dont ask the user in this case, the user CAN change the default elsewhere
        • ​ if one or the other (trizen or yay) is installed, the right steps are taken using that AUR Helper
      • installYay and installTrizen functions

        • to actually install yay or trizen AUR Helpers
          • this DOES NOT install any apps via those two AUR Helpers

Universal Software Application Function

  • The example below is a general guide, for a software function

    • Not all sections have to be filled out but I listed them all here, so you could copy and paste.

      function installProgramFoobar
      {
        programName=""`
        programTitle=""`
        programHomepage=""
        debURL=""
        rpmURL=""
        tarURL=""
      
          # Universal Apps
          snapName=""
          snapType=""
      
          flatpak=""
      
          appImageURL=""
      
          case $distroBase in
      
              arch) ;;
      
              fedora) ;;
      
              opensuse) ;;
      
              solus) ;;
      
              ubuntu)  ;;
      
          esac
      
      }
  • Supported formats: tar.gz. tgz, tar.bz2, DEB, RPM, AppImage


PPA Related

ppa function template

  • This is the setup for adding a PPA function

    function install(appname)PPA
    {
      PPATitle=""
      PPAName=""
      PPASource=""
      PPARef=""
      packageNames=""
      supportedBase=""
    
    }

Explaination

  • PPATitle

    • The General name of the app or program you are using the PPA for
  • PPAName

    • (not sure this is needed) Name of PPA (more shorten then PPATitle, i think was my idea)
  • PPASource

    • PPA Source
    • format:
  • PPARef

    • PPA "Homepage" of the PPA (I am thinking Launchpad mostly)
    • a URL
  • packageNames

    • package name or names that will be installed
  • supportedBase -ubuntu bases supported by said-PPA

Example

function installSMPlayerPPA() {
    PPATitle="SMPlayer"
    PPAName="smplayer"
    PPASource="ppa:rvm/smplayer"
    PPARef="https://launchpad.net/~rvm/+archive/ubuntu/smplayer/"
    packageNames="smplayer smplayer-themes smplayer-skins"
    supportedBase="bionic focal jammy"

    universalAddRepo ${PPATitle} ${PPASource} ${packageNames}
}
  • supported base - the list of ubuntu bases the ppa supports
    • separate by spaces only
    • ??? - I think I should have a case/if statement around the install code ... maybe even a var to control that "$ppaInstallApp" or something ... if yes/true ... the app installs ... if not ... it returns to the menu
      • apps listed in PPAPackages var

(Summary) Functions - What to pass/what is needed

  • This info is a summary of what is above

    • Snap Installs,

      • [Idea] Shouldn't i have the first argument as the programName (pushing the snap name to second, and snapType to third argument)
      • First Argument is the snap name (EXACTLY)
      • The Second Argument is the snap type
        • examples
          • classic - installs with snap install --classic
          • beta - installs with snap install --beta
    • Flatpak Installs,

      1. $flatpakRepo (example "flathub" ... i think)
      2. $flatpakName - EXACT name of flatpak
    • Third Party (DEB, AppImage, Tarballs, ..etc)

      • the first argument is programName/programTitle (I haven't decided yet)
      • the second argument varies but it is the link to the file, to be downloaded
        • update: I think "programURL" is that var, exactly
      • pass to "metaExternalDownload" IF not a github link
      • pass to "gitDownload" (which passes to metaExternalDownload, later) if the link is a github link
        • "metaExternalDownload" needs a URL passed and that is what gitDownload gets, so that is the reason for this

Github Installs

  • gitDownload function called
  • What is needed to be known here
    • programName
    • repoName
    • fileFormat to download
    • nameFormat
      • (in software function so no need to assign that here)
      • this helps determine the correct file to download, when say the programName or fileFormat variables are not enough
Clone this wiki locally