|
|
cRUST is more than simply a console version of the RUST. It is the backend
for the GUI but it also allows you to perform additional tasks, such as
creating RPMs from source tar balls by using the sandbox and a few additional functions,
like listing the files that have been added or modified since
the last initialization.
Creating an RPM with cRUST is simple - although not so much as with
the rust GUI. The steps required to do so are:
- Select and initialize a new root
- Place your files under the new root.
- Run cRUST to create the RPM
1. Select a new root and initialize it
Select a directory (it doesn't need to exist in advance) in which you will
place the files to include in the RPM, for example
~/newroot, and run
$ crush --init --nomd5 ~/newroot
You will find that the directory now contains many of the directories
typically found under /.
$ ls ~/newroot
bin build etc lib opt root tmp var
boot dev home mnt proc sbin usr
2. Place the files
Place the files you wish to include in the RPM in the filesystem created
under the new root (~/newroot). For example,
if you want a program to be installed by your RPM in /usr/local/myproject
$ mkdir ~/newroot/usr/local/myproject
$ cp myprog ~/newroot/usr/local/myproject
Do this for every file and directory you wish to include in the RPM.
3. Create the RPM
You can create the RPM with cRUST by calling the program from the
command line like so
$ crust --makerpm --nomd5 --name myrpm \
--version 0.1 --release 2 --group \
"Applications/Text" --license "GNU GPL" \
--sum "A short summary" --desc "A longer \
description of the package"
~/newroot
The RPM will be created and installed in the rust directory in your
home, do an
$ rpm -qlp ~/rust/RPMS/i386/myrpm-0.1-2.i386.rpm
to see the files included in the RPM.
A more interesting use of cRUST involves creating sandbox,
installing programs from within the sandbox and automatically generating
RPMs for these third party sources.
The following crust manpage is included in the
installation.
The crust manpage
Section: User Manuals (1)
Updated: AUGUST 2001
Index
-
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- OPTIONS (Administrative)
-
- OPTIONS (Package Creation)
-
- FILES
-
- BUGS
-
- AUTHOR
-
- LICENSE
-
- SEE ALSO
NAME
crust - console RUST, rpm creator and sandbox.
SYNOPSIS
crust --diff|--clean|--chroot|--init [--include
include-dir ] [--copy|--fullcopy] [--nomd5]
[--nocreate]|--makerpm [--name NAME ] [--version VER
] [--release REL ] [--group GRP ] [--license
LICENSE ] [--requires REQ ] [--sum SUM
] [--desc DESC ] [--post post-file ] [--postun
postun-file ] DIRECTORY
DESCRIPTION
crust is more than
simply a console version of rust(1). It is the backend for the GUI
(so anything you can do with rust(1) may also be done on the command
line with crust ) but it also allows you to perform additional tasks,
such as creating RPMs from source tar balls by using the sandbox.
OPTIONS (Administrative)
- --chroot
- Specifying --chroot NEWROOT
with NEWROOT being a previously initialized directory,
will cause crust to change root to NEWROOT and spawn a
shell. The directory must have been initialized with --init
--copy or --init --fullcopy for the chroot to
succeed. This is the one instance in which crust must be run
as root (in order to make the chroot() system call. To
use the --chroot feature to create RPMs from arbitrary
source code tar balls:
- Initialize
a directory with:
crust
--init --copy /path/to/a/newroot
- Copy
the source into the build subdirectory and build it:
cp
source.tar.gz /path/to/a/newroot/build and do
what you need to do to compile the software (./configure; make or
whatever).
- Become
the superuser:
su
- Get into
the sandbox. As root, do:
crust
--chroot /path/to/a/newroot
- Install
the software in the sandbox:
cd
/build/source-0.2/ ; make install
- Get out
of the sandbox
exit
- Make
yourself the owner of all the files:
chown
-R username /path/to/a/newroot
- Return
to your lowely normal user status:
exit
- Make
the RPM:
crust
--makerpm --name myrpm --version 0.2 ...
as described
below.
- --clean
- Calling crust with --clean
causes it to remove all files and directories added under the 'new root'
directory since the last --init
- --copy
- Used with --init,
--copy copies a minimal set of files over under the new root
directory. These programs and files will be needed when entering the
sandbox (with --chroot ).
- --diff
- Ouput a list of directories and files that have
been added or modified (when not using
--nomd5) since the last initialization.
- --fullcopy
- Similare to the --copy argument,
but uses a more complete list of files and directories, which includes
those duplicated with --copy
Using fullcopy will be necessary in cases where make
install causes the software to attempt to recompile in the sandbox
but some required files or programs are not available within the chroot
ed environment. If even --fullcopy is not enough
to get things going, you need to figure out what is missing and use
crust --init --include /path/to/missingstuff --include
/more/missingstuff /path/to/a/newroot
or modify the /usr/local/rust/conf/rustdirs.fullcp.conf file
and redo the
crust --init --fullcopy /path/to/a/newroot
-
- --include
- --I
- Using --include FILE|[R ]DIRECTORY
or -I [FILE|[R ]DIRECTORY] in conjunction with --init
and possibly --copy or --fullcopy
also duplicates FILE or DIRECTORY (recursively if the 'R' option is
used, as in --include 'R /path/to/dir/'
) when initializing the new root.
-
- --init
- Initialize the DIRECTORY. This creates the basic
file system directory structure under DIRECTORY and a file containing
the initial (or 'clean') contents of the directory. This list is then
compared with the current list when creating the packages.
- --nocreate
- If the DIRECTORY to use as the 'new root' does
not exist and the --nocreate option is used, DIRECTORY
will not be created and crust will exit.
- --nomd5
- By default, md5 sums are calculated for each
file under DIRECTORY and then recalculated and compared when doing a
--diff or creating the package (with --makerpm
). It is usually important to leave this md5sum checking active when
using the sandbox and related commands ( --chroot
, --(full)copy ... ), as crust will
not be able to determine wether a file has been replaced (as opposed
to simply added or removed) without the md5sums. However, in cases where
the sandbox is not being used, e.g. when using the rust(1) GUI
interface, it may be desirable to skip this time consumming process
(crust can take 2 minutes doing all the md5 sums on an --init
--fullcopy new root directory). The --nomd5
allows you to do so.
OPTIONS (Package Creation)
- --makerpm
- DIRECTORY Using the --makerpm
argument tells crust find the files which have been added or modified
under DIRECTORY since the last initialization. These files are
then packaged into an RPM file. The created RPM can be found
in ~/rust/i386/RPMS . The options below
all affect the properties of the created RPM.
-
-
- --desc
- DESC
Specifies DESC (a single word or quoted string) as the description
for the package to build.
-
- --group
- GRP
Specifies GRP (a single word or quoted string) as the group of the
package to build. Defaults to Applications/Rust
-
- --license
- LICENSE
Specifies LICENSE (a single word or quoted string) as the software
distribution license of the contents of the package to build. Defaults
to GPL
-
- --name
- NAME
Specifies NAME (a single word, no spaces) as the name of the package
to build. Defaults to NoNameRPM
-
-
- --post
- FILE
Specifies FILE (a /path/to/file.sh), a file who's contents are a
script to be executed after RPM installation.
-
-
- --postun
- FILE
Specifies FILE (a /path/to/file.sh), a file who's contents are a
script to be executed after RPM un installation.
-
- --release
- REL
Specifies REL (a single word, no spaces) as the release of the package
to build. Defaults to 1
-
- --requires
- REQ
Specifies REQ (a single word or quoted string) as the list of additional
RPMs that are required to be installed on the system before the dependancies
are met and this package may be installed.
-
- --sum
- SUM
Specifies SUM (a single word or quoted string) as the summary for
the package to build.
-
- --version
- VER
Specifies VER (a single word, no spaces) as the version of the package
to build. Defaults to 0.1
FILES
/usr/local/rust/conf/rustdirs.conf
/usr/local/rust/conf/rustdirs.cp.conf
/usr/local/rust/conf/rustdirs.fullcp.conf
-
- The configuration files that determine which
directories are created and copied when calling crust with --init
and --copy or --fullcopy
See rustdirs.conf(5) for further details.
~/rust/RPMS/i386
-
- Directory containing RPMs created by crust
BUGS
crust does not deal
with symbolic links at this time.
AUTHOR
Patrick Deegan <
email
me>
LICENSE
crust is part of
the rust package and is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
rust, crust and their associated configuration and support
files are distributed in the hope that they will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SEE ALSO
rust(1), rustdirs.conf(5)
|
|
|