如何使用slackware的installpkg工具安装软件包时设置特定的目标目录



我正在尝试制作一个软件包并将其安装在slackware OS中。我的包只有一个二进制可执行文件。我已经使用makepkg工具创建了带有.tgz文件的包。但是当我尝试使用installpkg工具安装包时,二进制文件总是被解压缩到根目录。那么我如何将目标目录更改为其他位置(如/usr/bin)呢?

doinst.sh脚本在包里有什么用?我可以用它写我自己的剧本吗?

谢谢

  1. 创建临时目录
  2. 创建树形结构的安装文件
  3. 用'slack-desc'文件和(可选)创建install/目录"doinst.sh"
  4. 运行makepkg/tmp/package-name-version-arch-build_tag.txz

    # mkdir /tmp/pkg; cd /tmp/pkg
    # mkdir -p usr/bin
    # cp /path/to/your/file usr/bin/
    # chmod a+x usr/bin/file
    # mkdir install
    # cat <<EOF >install/slack-desc
    appname: appname (short description of app)
    appname:
    appname: Long description of appname, wrapped at 71 characters *after* the
    appname: colon following "appname" (and the 'handy ruler' should start at
    appname: that colon and be exactly 71 characters long).
    appname: If there is room, there might be a link to the homepage of the
    appname: application on one of these lines, but it's not necessary.
    appname:
    appname: The maximum number of lines prefixed by "appname:" is 11.
    appname: Lines without any other text should *not* have a space after the :
    appname:
    EOF
    # makepkg /tmp/appname-1.0-x86_64-1_me.txz
    # upgradepkg --install-new /tmp/appname-1.0-x86_64-1_me.txz
    

最新更新