"Fossies" - the Fresh Open Source Software Archive 
As a special service "Fossies" has tried to format the requested text file into HTML format (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1 ##############################################################################
2 # # checkinstall 1.6.2 # #
3 # ############################# #
4 # #
5 # Installs a compiled program from the program's source directory using #
6 # "make install" or any other command supplied on checkinstall's command #
7 # line. checkinstall will create a Slackware, RPM or Debian compatible #
8 # package and install it using your distribution's standard package #
9 # administration utilities. #
10 # #
11 # This version of checkinstall needs enough free space on the partition #
12 # holding the temp dir (/var/tmp by default) to write there a #
13 # temporary copy of the package. #
14 # #
15 ##############################################################################
16
17 ====== CONTENTS ======
18
19 1. Introduction
20
21 2. Usage
22
23 2.1. Download, configure, build
24
25 2.2. The "doc-pak" directory
26
27 2.3. Package description
28
29 2.4. Preinstall, postinstall, preremove and postremove
30
31 2.5. Package information
32
33 2.6. Package creation
34
35 2.6.1 Slackware packages
36
37 2.6.2 RPM packages
38
39 2.6.3 Debian packages
40
41 3. Customization
42
43 3.1. The checkinstallrc file
44
45 3.2. Command line switches
46
47 3.3. Native language support
48
49 4. Notes
50
51
52 ====== 1. INTRODUCTION ======
53
54 A lot of people has asked me how can they remove from their boxes a program
55 they compiled and installed from source. Some times - very few - the program's
56 author adds an "uninstall" rule to the Makefile, but that's not usually the
57 case. That's my primary reason to write checkinstall. After you ./configure;make
58 your program, It will run "make install" (or whatever you tell it to run) and
59 keep track of every file modified by this installation, using the excellent
60 installwatch utility written by Pancrazio 'Ezio' de Mauro <p at demauro.net>.
61
62 When "make install" is done, checkinstall will create a Slackware, RPM or
63 Debian package and install it with Slackware's installpkg, "rpm -i" or "dpkg -i"
64 as appropriate, so you can view it's contents in /var/log/packages or remove it
65 with removepkg (for Slackware), "rpm -ql" and "rpm -e" (RPM) or "dpkg -I" and
66 "dpkg -r" (Debian).
67
68
69 Additionally, this script will leave a copy of the installed package in the
70 source directory or in the storage directory you specify (see the PAK_DIR option
71 later in the checkinstallrc file) so you can install it wherever you want,
72 which is my second motivation: I don't have to compile the same software again
73 and again every time I need to install it on another box :-).
74
75
76 Another nice thing about checkinstall is that it can be run simultaneously by
77 any number of users and each instance will get only the files modified by it's
78 processes and no one else's, unlike some other tools based on a
79 "find / -atime etc etc etc". Not to mention that checkinstall is A LOT faster =)
80
81
82 It is important to note that checkinstall can keep track of files modified by
83 any command line, not just a "make install". You can create your own
84 installation script with lots of command in it and then have checkinstall track
85 them for you.
86
87
88
89 ====== 2. USAGE ======
90
91
92 == 2.1 == Download, configure, build
93
94 o Download your software, i.e. Afterstep-1.8.4.tgz
95
96 o Extract the files:
97
98 tar xzvf Afterstep-1.8.4
99
100 o cd to the source directory, configure and compile:
101
102 cd Afterstep-1.8.4
103 ./configure
104 make
105
106 == 2.2 == The "doc-pak" directory
107
108 o Optionally you can make a directory called "doc-pak" whose contents
109 will be installed in /usr/doc/<package_name> inside the package you're
110 about to create. checkinstall will remind you about this one if it notices
111 there is no "doc-pak" on the source directory. Good candidates to be there
112 are: README, INSTALL, COPYING, Changelog, TODO, CREDITS, etc. It's up to you
113 what to copy in there.
114
115 mkdir doc-pak
116 cp README INSTALL COPYING Changelog TODO CREDITS doc-pak
117
118 As of checkinstall-1.1 if you don't create the "doc-pak" directory then
119 checkinstall will ask if you want it to build a default documentation
120 directory with files having common documentation names like those mentioned
121 in the above paragraph. If you say no, your package will have no
122 documentation.
123
124
125 == 2.3 == Package description (Changed in checkinstall-1.3.0)
126
127 If you create a file named "description-pak" it's contents will be used to
128 include a description and summary in the new package, which will be
129 displayed when you use "pkgtool" or "rpm -qi". For example:
130
131 Create the file "description-pak":
132
133 ---------------------- Cut here ----------------------
134 AfterStep window manager
135
136 The one and only!
137 This is a window manager with a NexT inspiration.
138 ---------------------- Cut here ----------------------
139
140 If checkinstall doesn't find that file it will create one, asking you
141 for a description to put in it.
142
143 NOTE: Slackware's pkgtool doesn't seem to handle package filenames longer
144 than 8 characters when displaying the package list in the "Remove" section,
145 but the "View" option works OK. I hope that Pat or someone can take the
146 time to fix this. I'll try to fix it myself if i find the time to do it.
147
148 As a result, I've decided not to prepend every line in the PACKAGE
149 DESCRIPTION section of the /var/log/packages entry with package-name:. It is
150 difficult to read in the /var/log/packages file and it's pretty useless in
151 the pkgtool's remove package section listing. The description is stored
152 "as is".
153
154 Anyway, it's not that bad.. ;-)
155
156 NOTE 2: As of checkinstall 1.5.3, support for the new (8.1+) Slackware
157 description file format is included, available when using the "--newslack"
158 command line switch.
159
160 == 2.4 == Preinstall, postinstall, preremove and postremove scripts
161
162 CheckInstall supports preinstall, postinstall, preremove and postremove
163 scripts for RPM and Debian packages.
164
165 For Debian, these scripts must meet some requirements to be accepted by dpkg
166 while building the .deb package. See:
167
168 http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
169
170 In short, any shell script will do as long as it specifies an interpreter
171 (i.e. put #!/bin/sh as the first line) and has an exit status of zero for
172 success or non-zero for failure.
173
174 To include the scripts in your package, put them in the current directory
175 and name them:
176
177 +-----------------+--------------------------------------+
178 | Script name | Action |
179 +--------------------------------------------------------+
180 | preinstall-pak | Run BEFORE the package is INSTALLED |
181 +--------------------------------------------------------+
182 | postinstall-pak | Run AFTER the package is INSTALLED |
183 +--------------------------------------------------------+
184 | preremove-pak | Run BEFORE the package is REMOVED |
185 +--------------------------------------------------------+
186 | postremove-pak | Run AFTER the package is REMOVED |
187 +--------------------------------------------------------+
188
189 All scripts are optional. You can write all of them if you need them, or
190 only the ones you need, or even none.
191
192 Remember that the scripts are run only when the .rpm or .deb package is
193 installed or removed. NOT when the initial install command (i.e. "make
194 install") is run.
195
196 For Slackware packages, the "postinstall-pak" script is already supported as
197 "install-pak". Either name will work.
198
199
200 == 2.5 == Package information
201
202 CheckInstall will display a menu with several values that can be customized
203 for this package, like the package's name, version, release number, etc.
204
205 Most of the values are self-descriptive, however there are three values that
206 deserve special attention: "Name", "Source Location" and "Alternate Source
207 Location".
208
209 The "Name" field allows you to change the name for the package you are about
210 to create. This is useful when CheckInstall fails to properly set this name
211 from the source directory's name. This also applies to the version field.
212
213 The "Source Location" values are -for now- only hooks for the upcoming
214 "auto-unpack-configure-compile-install" feature in future CheckInstall's
215 versions. The "Source Location" will tipically be the original source archive
216 and the "Alternate Source Location" would be some FTP or HTTP URL where the
217 source archive can be retrieved from. Keep your eyes on these ones ;-).
218
219 Please note that as of checkinstall-1.5.0 (not 1.5.0betax) all of these values
220 can be specified via command line options. See the COMMAND LINE OPTIONS
221 section below.
222
223 == 2.6 == Package creation
224
225 o You normally would su and make install. Now it's only su:
226
227 su
228 password: xxxxx
229
230 o Run checkinstall:
231
232 checkinstall
233
234 NOTE: If you give no arguments to checkinstall it will run a "make install".
235 If you give arguments, the first non-option argument will be used as the
236 install command. This is useful when the install command is not "make install"
237 but something else like "make install_packages" or "setup" or whatever, i.e.
238
239 checkinstall make install_packages
240 checkinstall make modules_install
241 checkinstall install.sh
242 checkinstall setup
243 checkinstall rpm -i my-package-1.0.i386-1.rpm
244
245
246 == 2.6.1 == Slackware packages
247
248 o checkinstall will ask if you want to see the installation results, then run
249 the modified Slackware package maker "makepak". If you want checkinstall to
250 use the original Slackware's "makepkg" then change the MAKEPKG variable
251 inside the checkinstall script and read this:
252
253 makepkg will ask you a couple of questions:
254
255 If there are any symbolic links in the installed package it will ask you
256 to remove them and make an installation script to re-create them whenever
257 you install the package. This is a GOOD THING, so answer YES. --> BTW,
258 makepkg doesn't always ask you this (depending on whether you have symbolic
259 links or not) so be careful and read before you answer, you could be
260 answering the wrong question. Read on:
261
262 makepkg will *always* ask if you want to change the owner, group and
263 permissions of EVERY file in the package to root:root:755. This is BAD most
264 of the times, always answer NO to that question, unless you know
265 what you are doing, of course ;)
266
267
268 o In the end, checkinstall will install the package with installpkg so you
269 can remove it later with Slackware's removepkg (Our initial intention :) ).
270 Additionally, it will leave a copy of the package in the source directory,
271 the package's name will be name-version-architecture-release.tgz. Using the
272 Afterstep example, the file would be named Afterstep-1.8.4-i386-1.tgz.
273
274 Starting with checkinstall-1.5.1, the created packages will be named
275 using the new (post-Slackware 8.0) Slackware package naming scheme.
276
277 o You can add a customized installation script which will be run by "installpkg"
278 every time you use it to install your new package.
279
280 Write it and name it "install-pak" or "postinstall-pak" and checkinstall will
281 include it for you.
282
283 This script can be useful to set up the system to fit the newly installed
284 package: create new users, set permissions, initialize databases, rcscripts,
285 etc.
286
287
288 == 2.6.2 == RPM package creation support
289
290 CheckInstall has the ability to build binary RPM packages. After you write
291 the package's description the script will prompt you to choose a package
292 type. If you chose RPM ("R") then it will figure out some sane values and write
293 a minimal spec file. You can of course supply your own file, in this case
294 checkinstall will use the values you put in there to build the rpm and skip
295 the spec file writing step. If any problems arise while building/installing
296 the rpm you'll get a chance to see the log files and figure out what went
297 wrong.
298
299
300 == 2.6.3 == Debian package creation support
301
302
303 That's right, CheckInstall can now create Debian packages. Do I need to say
304 more? =)
305
306 The Debian support in CheckInstall is still new, so handle it with care.
307 It has been reported to work OK in some Debian systems and it certainly works
308 OK in my Slackware development system with dpkg installed. Your mileage may
309 vary.
310
311 And of course, it it *does* vary, I'd really like it if you send me a message
312 telling me about it so I can fix it ;-).
313
314 NOTE to non-Debian-based users:
315 ===============================
316
317 To build Debian packages you need the dpkg utility. I got mine from:
318
319 http://www.debian.org/Packages/unstable/base/dpkg.html
320
321 Also, you should have all of your basic filesystem structure included
322 ("installed") in your dpkg database, or you won't be able to remove most
323 .deb packages installed (either checkinstall-generated ones or not). dpkg
324 seems to be unwilling to remove things like "/", "/usr" and such, wich are
325 obviously included in nearly every package you install. The way to avoid this
326 particular problem is to have a "base" package installed containing those
327 directories, in this way dpkg won't complain about removing other packages.
328
329 I've put a "aaa_base-1.0-1.deb" package in the CheckInstall's home page as a
330 work-around for this problem. Install it with "dpkg -i aaa_base-1.0-1.deb" and
331 then forget about it =).
332
333 "dpkg -I aaa_base-1.0-1.deb" should give you some useful info about the package.
334
335
336
337 ====== 3. CheckInstall customization ======
338
339
340 == 3.1 == The checkinstallrc file
341
342 CHANGE in CheckInstall 1.4.0:
343
344 The variable declaration section in the checkinstall script has been removed,
345 you should now edit the checkinstallrc file, normally installed under
346 /usr/local/lib/checkinstall.
347
348
349 In the checkinstallrc file you will find some variables wich modify
350 checkinstall's default behaviour. They're described here (and are also well
351 commented in the file, BTW).
352
353
354 The checkinstallrc values are these:
355
356 o DEBUG: Set the debug level (Default: 0)
357 0 => No debug
358 1 => Keep all files except the ones inside the package
359 3 => Keep those files too.
360
361 o INSTALLWATCH_PREFIX: Prefix to installwatch's library and program
362
363 o INSTALLWATCH: Location of the installwatch program
364
365 o MAKEPKG: Location of Slackware's makepkg
366
367 Location of the makepkg program. "makepak" is the default, and is
368 included with checkinstall. If you want to use Slackware's native "makepkg"
369 then set this to "makepkg"
370
371 o MAKEPKG_FLAGS: makepkg optional flags.
372
373 These are recommended if running a newer Slackware version: "-l y -c n"
374
375 o SHOW_MAKEPKG: Boolean (Default: 0)
376
377 Show -or not- the results of the MAKEPKG command as it runs. Useful when
378 running it with interactive options. If checkinstall seems to halt and
379 sleep after saying "Building Slackware package..." then you might want to
380 set this to 1.
381
382 o BASE_TMP_DIR: Prefix to all checkinstall's temporary files/dirs
383
384 NEVER, EVER set this to "/tmp" or "/". Setting it to "/tmp" will
385 change /tmp's permission to 700 (definitely no good) and setting it
386 to "/" one will erase all of your files by means of a "rm -rf /*".
387
388 You have been warned!
389
390 o DOC_DIR: Where to place the installed document files
391
392 o ARCHITECTURE: Default target architecture for the package. (Default: empty)
393
394 If your rpm program is configured to build packages for i686 instead of i386
395 (for example) then you'll find this handy to avoid the need to tell
396 checkinstall your architecture type every time it is run. The default is
397 auto-detect.
398
399 o INSTYPE: What kind of packages are we building? (Default: empty)
400
401 Set it to "S" for Slackware's .tgz, "R" for RedHat and friends' .rpm,
402 "D" for Debian and leave it empty to have checkinstall ask you every time.
403
404 o RPM_FLAGS: RPM install command optional flags.
405
406 o DPKG_FLAGS: dpkg install command optional flags.
407
408 o PAK_DIR: Package storage directory
409
410 If non-empty, all the created packages will be saved in this directory.
411 In this way you can keep all of your packages in one place.
412
413 o CKUMASK: Set the umask to this value (Default: 0022)
414
415 o SHOW_INSTALL: Boolean (0 or 1) (Default: 1)
416 Show -or not- the results of the install command as it runs. Useful for
417 interactive install commands.
418
419 o SHOW_SLACK_INSTALL: Boolean (0 or 1) (Default: 0)
420 Show -or not- the results of the Slackware's installpkg command as it runs.
421 As the option above, this can be useful for interactive install scripts.
422
423 o DEL_DOCPAK: Boolean (Default: 1)
424 Delete -or not- the "doc-pak" directory upon program's termination.
425
426 o DEL_SPEC: Boolean (Default: 1)
427 Delete -or not- the .spec file upon termination.
428
429 o DEL_DESC: Boolean (Default: 1)
430 Delete -or not- the "description-pak" file.
431
432 o STRIP_ELF: Boolean (Default: 1)
433 Strip -or not- any ELF binaries found inside the package.
434
435 o STRIP_SO_ELF: Boolean (Default: 0)
436 Automatically strip all ELF shared libraries?
437 Note: this setting will automatically be set to "0" if STRIP_ELF=0
438
439 o ADD_SO: Boolean (Default: 0)
440 Automatically search for shared libraries and add them to /etc/ld.so.conf?
441
442 o COMPRESS_MAN: Boolean (Default: 1)
443 Automatically compress all man pages?
444
445 o BACKUP: Boolean (Default: 1)
446 Backup -or not- any pre-existent files that would be overwritten by the
447 package installation.
448
449 o AUTODOINST: Boolean (Default: 1)
450 Write a doinst.sh script wich will be executed everytime you install the
451 package with installpkg.
452
453 o NEW_SLACK: Boolean (Default: 1)
454 Use the new (8.1+) Slackware description file format?
455
456 o EXCLUDE: Comma delimited list
457 List of files/directories to be ignored when searching for files to be
458 included in the package.
459
460 Example: EXCLUDE="/dev,/tmp,bad_file,bad_dir"
461
462 o CK_INCLUDE_FILE: Path to a file
463 This file should contain a list of files and directories that will
464 be included in the package in addition to the ones installed by your
465 installation command. The files or directories should be listed one per line.
466
467 Example: INCLUDE="/home/include-list.txt"
468
469 o ACCEPT_DEFAULT: Boolean (Default: 0)
470 Accept default values for all questions?
471
472 o CK_INSPECT: Boolean
473 Enable inspection of the list of files that will be included in the package,
474 before the package is created.
475
476 o REVIEW_SPEC: Boolean
477 Enable review of the .spec file before the creation of a RPM package.
478
479 o REVIEW_CONTROL: Boolean
480 Enable review of the Debian control file before the creation of
481 a Debian package.
482
483 o INSTALL: Boolean
484 Install or not the package as we create it.
485
486 == 3.2 == Command line options
487
488 Starting at version 1.4.0, checkinstall supports a lot of command line
489 switches, which if specified will override the options set in the
490 checkinstallrc file.
491
492
493 The command line options are these:
494
495 Usage: checkinstall [options] [command [command arguments]]
496 Options:
497
498 *Package type selection*
499
500 -t,--type=<slackware|rpm|debian> Choose packaging system
501 -S Build a Slackware package
502 -R Build a RPM package
503 -D Build a Debian package
504
505 *Install options*
506
507 --install=<yes|no> Toggle created package installation
508 --fstrans=<yes|no> Enable/disable the filesystem translation code
509
510 *Scripting options*
511
512 -y, --default Accept default answers to all questions
513 --pkgname=<name> Set name
514 --pkgversion=<version> Set version
515 -A, --arch, --pkgarch=<arch> Set architecture
516 --pkgrelease=<release> Set release
517 --pkglicense=<license> Set license
518 --pkggroup=<group> Set software group
519 --pkgsource=<source> Set source location
520 --pkgaltsource=<altsource> Set alternate source location
521 --pakdir=<directory> The new package will be saved here
522 --maintainer=<email addr> The package maintainer (.deb)
523 --provides=<list> Features provided by this package (.rpm)
524 --requires=<list> Features required by this package (.rpm)
525 --rpmflags=<flags> Pass this flags to the rpm installer
526 --rpmi Use the -i flag for rpm when installing a .rpm
527 --rpmu Use the -U flag for rpm when installing a .rpm
528 --dpkgflags=<flags> Pass this flags to the dpkg installer
529 --spec=<path> .spec file location
530 --nodoc Do not include documentacion files
531
532 *Info display options*
533
534 -d<0|1|2> Set debug level
535 -si Run an interactive install command
536 --showinstall=<yes|no> Toggle interactive install command
537 -ss Run an interactive Slackware installation script
538 --showslack=<yes|no> Toggle interactive Slackware installation script
539
540 *Package tuning options*
541
542 --autodoinst=<yes|no> Toggle the creation of a doinst.sh script
543 --strip=<yes|no> Strip any ELF binaries found inside the package
544 --stripso=<yes|no> Strip any ELF binary libraries (.so files)
545 --addso=<yes|no> Search for any shared libs and add
546 them to /etc/ld.so.conf
547 --reset-uids=<yes|no> Reset perms for all files/dirs to 755 aand
548 the owner/group for all dirs to root.root
549 --gzman=<yes|no> Compress any man pages found inside the package
550 --docdir=<path> Where to put documentation files
551 --umask=<mask> Set the umask value
552 --exclude=<file|dir[,...]> Exclude these files/directories from the package
553 --include=<listfile> Force the inclusion in the package of the
554 files/dirs listed in "listfile"
555 --inspect Inspect the package's file list
556 --review-spec Review the spec file before creating a .rpm
557 --review-control Review the control file before creating a .deb
558 --newslack Use the new (8.1+) Slackware description format
559 ("--newslack" implies "-S")
560 --with-tar=/path/to/tar Manually set the path to the tar binary
561 in this system
562
563 *Cleanup options*
564
565 --deldoc=<yes|no> Delete doc-pak upon termination
566 --deldesc=<yes|no> Delete description-pak upon termination
567 --delspec=<yes|no> Delete spec file upon termination
568 --bk Backup any overwritten files
569 --backup=<yes|no> Toggle backup
570
571 *About CheckInstall*
572
573 --help, -h Show this message
574 --copyright Show Copyright information
575 --version Show version information
576
577
578 == 3.3 == Native Language Support
579
580 Checkinstall now uses GNU gettext to support native language translation of
581 all messages sent to the terminal. Set your LC_ALL variable to your
582 ISO-639 language and ISO-3166 country codes. For example, to set spanish and
583 Mexico you would use:
584
585 export LC_ALL=es_MX
586
587
588 Translators needed!
589
590 Please read the file NLS_SUPPORT for information on how to translate
591 checkinstall if your language is not already supported.
592
593 The supported languages so far are:
594
595 o English
596 o Spanish
597
598
599 ====== 4. Notes ======
600
601 So far I've seen -or heard of- checkinstall running and building packages
602 in these distributions/operating systems:
603
604 o Slackware 7.x/8.x,9.x
605 o RedHat 6.2/7.x/8.x
606 o SuSe 7.x/8.x/9.x
607 o Mandrake 7.x/8.x/9.x
608 o Gentoo Linux
609 o Solaris (version?)
610 o Debian 2.x/3.0
611
612 In x86, ppc, sparc and arm, BTW.
613
614 If you have succesfully used checkinstall in some other distro I'd really
615 appreciate if you let me know =).
616
617 CheckInstall currently is unable to track any file system changes made by
618 statically linked programs. This is being worked on and I hope to have it ready
619 in a couple of weeks or so. Then again, it could be a couple of months, but the
620 important thing is that it will be ready soon ;).
621
622 NOTE ON SUID/SGID PROGRAMS: CheckInstall can't track their actions because of
623 some limitations in the LD_PRELOAD system that installwatch uses. This is
624 good for security reasons, but it can generate unexpected results when
625 the installation process uses SUID/SGID binaries.
626
627 So, before asking questions about some files not being included in your
628 package, check the binaries that you're using ;-).
629
630 SLACKWARE 8.0 USERS:
631
632 Slack8.0 ships with a statically linked "ln", so any symlinks your installation
633 process creates WON'T be detected nor included in your package. The way to
634 fix this is to substitute your static "ln" for a dynamically linked one, like
635 the one from a Slackware 7.x installation. There's link to download it
636 from the CheckInstall's homepage.
637
638 Debian support is now included!
639
640 UPDATE jan-18-2001: RPM support is already in place, inst2rpm supplied the
641 template for the mini-spec file used by checkinstall. Thanks to
642 Jon A. Christopher for writing it.
643
644 Another thing in the works is the addition of a friendlier interface based on
645 the dialog tool (which will give us curses-like character based menus AND X11
646 graphical menus at no extra cost =) )
647
648 There are some extra features planned like package updating, automated friendly
649 installation process going from extracting the files to the installation
650 including configure options, build, etc.
651
652 Sometime in the future I will rewrite this in C/Gtk or something, too.
653
654 Ideas, bug reports, patches, etc:
655
656 * CheckInstall author: <izto at asic-linux.com.mx>
657
658 ------------
659
660 * CheckInstall users list: <checkinstall-list at asic-linux.com.mx>
661
662 To join the list, send an empty message to:
663
664 <checkinstall-list-subscribe at asic-linux.com.mx>
665
666 ------------
667
668 * CheckInstall developers list: <checkinstall-devel at asic-linux.com.mx>
669
670 To join the list, send an empty message to:
671
672 <checkinstall-devel-subscribe at asic-linux.com.mx>
673
674
675 ==========
676