[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Welcome to the Slackware Documentation Project
本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。
<note warning>本页面目前由dom_kital进行翻译,如有疑问或建议请联系dom_kital@outlook.com</note> ====== SlackBuild scripts ====== SlackBuild脚本本质上是一个shell脚本(通常采用bash shell语法), 它可以自动地配置、编译和创建Slackware包(*.tgz, *.txz, *.tbz 文件) ===== Overview ===== The basic process of creating a Slackware package from source can be summarized as follows, while details may vary from one build system to another. - Uncompress the source archive (usually .tar.gz or .tar.bz2 file) into a "work directory." - Create a ''slack-desc'' file, with the description of the software in the correct format. - Configure the source, and apply patches if needed. - Compile/build the source and generate the binaries. - Install the program to a temporary directory. This step may be a little bit tricky, depending on how the ''make install'' (or similar functionality) of the build system works. In standard GNU Makefiles, the ''DESTDIR'' variable passed to the ''make install'' command should be sufficient. In non-standard Makefiles and build systems which don't support that option, this might involve patching the ''Makefile'' (or similar file) or editing a build configuration setting of the build system. - Copy the program documentation and other necessary files (including post-installation scripts) to the appropriate subdirectories in the temporary installation directory. These locations should adhere to default directory structure used by Slackware to store applications installed by the package manager, viz. inside the ''/usr/'' folder. - Use the ''makepkg'' utility from the temporary directory (installation location) to create a Slackware package that can then be installed using the ''installpkg'' utility. While the above steps can be done by hand, the process is tedious, sometimes complex, and involves typing in a lot of commands. Automating the process by a shell script allows the user to share the process with the community at large. It also makes sense to use and modify existing SlackBuild scripts for upgrading the same program to a newer version. ===== Creating SlackBuild scripts ===== A good hands-on tutorial on creating a SlackBuild script can be found [[http://www.slackwiki.com/Writing_A_SlackBuild_Script|here]], and there are also a few [[http://slackbuilds.org/templates/|templates]] available to get a feeling for what is needed from a script. However, software may be written in different programming languages, use different build systems, or may even simply be written in an interpreted programming language with no obvious way to "install" it. In such cases, many steps involved in writing a SlackBuild script will differ from the standard way. Blindly copying and pasting commands from other SlackBuild scripts may or may not work. It is recommended that anybody who wishes to write a SlackBuild script, study and understand the build system of a software project before attempting to write a SlackBuild script for it. A degree of proficiency in writing shell scripts is also a definite benefit, as it is the practice to use Bourne shell compatible scripts for SlackBuilds. Ideally, simple C projects which use the standard GNU Make system is a good way to start practicing writing SlackBuild scripts. <note tip>For new script writers, it is a good idea to perform the above steps manually to create the package from source, before actually writing a SlackBuild script. This reduces the chances of bugs and unexpected behaviour in the script.</note> Submitting SlackBuild scripts to a public repository such as http://www.slackbuilds.org may additionally require adherence to certain conventions and coding standards. For instance, it would be necessary for the script to determine the target architecture at runtime rather than hard-coding it into the script. These standards attempt to make SlackBuild scripts as portable as possible. ===== SlackBuild 自动生成器===== 这里有些工具也许能辅助你创建SlackBuild脚本,具体如下所示: * [[http://alien.slackbook.org/AST/ | Alien's SlackBuild Toolkit (AST)]] \\ 基于web实现的“向导”工具 by [[wiki:user:alienbob|Eric Hameleers]] * [[http://www.dawoodfall.net/slackbuilds/noversion/mkslack/ | mkslack]] \\ SlackBuild生成脚本 by David Woodfall ===== 扩展链接 ===== * SlackBuilds 仓库 - http://www.slackbuilds.org/ * SlackBuild 模板 - http://slackbuilds.org/templates/ ===== Sources ===== * Originally written by [[wiki:user:vharishankar|V.Harishankar]] for the SlackDocs Wiki Project <!-- Please do not change anything below this line--> {{tag>slackware slackbuild}}
您的足迹:
登录
文章
讨论
阅读
显示源文件
修订记录
搜索
导航
Main Page
Project Charter
Site News
Staff
Table of Contents
打印/导出
做为PDF下载
可打印版本
工具
反向链接
最近更改
媒体管理器
网站地图
永久链接
引用此文
SlackDocs
Request an account
Dokuwiki Manual
Dokuwiki Syntax
SlackDocs Style Guide
Authoring Guidelines
Translation Guide
Slackware Links
Slackware.com
Slackware-Current Change Log
Package Browser
Slackware Mirrors
@LinuxQuestions.org