sagemath / binary-pkg

Tools for creating binary tarballs
Other
13 stars 11 forks source link

Using my own packager #10

Open Geremia opened 7 years ago

Geremia commented 7 years ago

sage.yaml contains this:

dist: |
   tar cjf {dist}/sage-{version}-{osname}-{arch}.tar.bz2 {path}

But can I use my own packaging utility instead of simply using tar?

Slackware uses makepkg:

DESCRIPTION
       makepkg  creates  a new Slackware compatible package.  The package is constructed using the contents of the current directory and all subdirectories. If symbolic links
       exist, they will be converted to script code to recreate them when the package is installed.  This  code  will  be  appended  to  the  primary  installation  script  (
       install/doinst.sh  )  , or, if that script does not exist it will be created with those contents.  The package will be written out to the file packagename which should
       be the full name, including the extension.  This is usually .tgz, but .tbz, .tlz, and .txz are also accepted.  The proper compression utility (gzip,  bzip2,  lzma,  or
       xz) needs to be installed on the machine.

It makes a special doinst.sh script for dealing with symlinks, etc. It can even take an "onlyonce script," which sounds like what relocate-once.py is. How could I put relocate-once.py in the proper place of the package?

vbraun commented 7 years ago

Presumably the slackware packages are not relocatable, right? The easiest solution is probably to just install the binary (including running relocate-once.py) and then pack it up.

Geremia commented 7 years ago

the slackware packages are not relocatable, right?

@vbraun See this script for how SAGE is currently packaged on Slackware: https://slackbuilds.org/slackbuilds/14.2/academic/sage/sage.SlackBuild

It builds everything in /tmp/sage-7.6, copies to /tmp/package-sage (analogous to binary-pkg's dist directory) with the proper directory structure, and packages it from there. When you install the Slackware package, it will put SAGE in /opt/sage. However, the paths aren't properly rewritten; the binaries in /opt/sage think the install directory is /tmp/package-sage.