PACKAGE LAYOUT
-The LSB implementation in Debian is currently divided into four
+The LSB implementation in Debian is currently divided into five
packages:
* The "lsb-core" package depends on the Debian packages that are
roughly equivalent to the LSB 1.3 specification, except X11 libraries
are not required. It also includes some subroutines that are used
by LSB-compliant applications when they are being installed or
- removed, and a series of functions used by init.d scripts in some
- LSB packages.
+ removed.
* The "lsb-graphics" package depends on the X11 libraries required for
the LSB-Graphics 2.0 specification.
* The "lsb" package depends on the above three packages, and exists
for backwards compatibility purposes with LSB 1.3.
+* The "lsb-base" package includes a number of functions used by init.d
+ scripts in some LSB packages; this package was separated in Debian's
+ lsb 2.0-6 package so other packages could make use of the init
+ functionality without requiring a full LSB installation.
+
The first three packages are architecture-specific because of
differences in the requirements of the LSB on various binary
architectures. In particular, each package provides
For proper LSB conformance in woody, you will also need to backport
other Debian packages, including alien.
-The default version of Python in Debian 3.1 (sarge) is Python 2.3.4.
+The default version of Python in Debian 3.1 (sarge) is Python 2.3.5.
COMPLIANCE TESTING
An example init script that tests some of these features is provided
as /usr/share/doc/lsb/examples/init-skeleton.
- -- Chris Lawrence <lawrencc@debian.org>, Mon Sep 20 21:37:40 2004
+ -- Chris Lawrence <lawrencc@debian.org>, Fri Mar 4 17:41:50 2005
LocalWords: LSB
+lsb (2.0-6) unstable; urgency=low
+
+ * Create lsb package in binary-indep step. (Closes: #297788)
+ * Merge /lib/lsb/init-functions from Ubuntu.
+ * Split /lib/lsb/init-functions into arch-all lsb-base package; this
+ functionality is thus available for use by other, non-LSB packages.
+ * Update README.Debian.
+
+ -- Chris Lawrence <lawrencc@debian.org> Fri, 4 Mar 2005 17:42:11 -0600
+
lsb (2.0-5) unstable; urgency=low
* Upload to unstable. (Closes: #278093)
Package: lsb-core
Architecture: any
-Depends: lsb-release, libz1, exim4 | mail-transport-agent, at, bc, binutils, bsdmainutils, cpio, cron, file, libc6-dev | libc-dev, locales, lpr, m4, make, man-db, mawk | gawk, ncurses-term, passwd, patch, pax, procps, psmisc, rsync, alien (>= 8.36), python (>> 2.2.2), ${misc:Depends}, ${depends}
+Depends: lsb-release, libz1, exim4 | mail-transport-agent, at, bc, binutils, bsdmainutils, cpio, cron, file, libc6-dev | libc-dev, locales, lpr, m4, make, man-db, mawk | gawk, ncurses-term, passwd, patch, pax, procps, psmisc, rsync, alien (>= 8.36), python (>> 2.2.2), ${misc:Depends}, ${depends}, lsb-base
Provides: lsb-core-noarch, ${provides}
Conflicts: python (>> 2.5), libutahglx1, lsb (<< 2.0-2)
Replaces: lsb (<< 2.0-2)
presence does not imply that we believe that Debian fully complies
with the Linux Standard Base, and should not be construed as a
statement that Debian is LSB-compliant.
+
+Package: lsb-base
+Architecture: all
+Depends: sed, ncurses-bin
+Replaces: lsb (<< 2.0-5)
+Conflicts: lsb (<< 2.0-5)
+Description: Linux Standard Base 2.0 init script functionality
+ The Linux Standard Base (http://www.linuxbase.org/) is a standard
+ core system that third-party applications written for Linux can
+ depend upon.
+ .
+ This package only includes the init-functions shell library, which
+ may be used by other packages' initialization scripts for console
+ logging and other purposes.
-lib/lsb
usr/lib/lsb
var/lib/lsb
usr/X11R6/bin
build: build-stamp
-build-stamp: configure-stamp
+build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
# Add here commands to install the package into debian/lsb.
#$(MAKE) install DESTDIR=$(CURDIR)/debian/lsb
cp initdutils.py install_initd remove_initd debian/lsb-core/usr/lib/lsb
- cp init-functions debian/lsb-core/lib/lsb
+ cp init-functions debian/lsb-base/lib/lsb
# Build architecture-independent files here.
binary-indep: build install
-# We have nothing to do by default.
+ dh_testdir
+ dh_testroot
+ dh_installdebconf -i
+ dh_installdocs -i
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_installinit
+ dh_installcron -i
+ dh_installman -i
+ dh_installinfo -i
+# dh_undocumented
+ dh_installchangelogs -i
+ dh_link -i
+ dh_strip -i
+ dh_compress -i
+ dh_fixperms -i
+# dh_makeshlibs
+ dh_installdeb -i
+# dh_perl
+ dh_shlibdeps -i
+ dh_gencontrol -i
+ dh_md5sums -i
+ dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
- dh_installdebconf
- dh_installdocs
- dh_installexamples init-skeleton
- dh_installmenu
+ dh_installdebconf -a
+ dh_installdocs -a
+ dh_installexamples -a init-skeleton
+ dh_installmenu -a
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
- dh_installcron
- dh_installman lsb.8
- dh_installinfo
+ dh_installcron -a
+ dh_installman -a lsb.8
+ dh_installinfo -a
# dh_undocumented
- dh_installchangelogs
+ dh_installchangelogs -a
@[ ${DEB_BUILD_ARCH} = 'amd64' ] && mkdir -p debian/lsb-core/lib64 && echo >> debian/lsb-core.substvars "depends=ia32-libs" || true
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
+ dh_link -a
+ dh_strip -a
+ dh_compress -a
+ dh_fixperms -a
# dh_makeshlibs
- dh_installdeb
+ dh_installdeb -a
# dh_perl
- dh_shlibdeps
+ dh_shlibdeps -a
@echo >> debian/lsb-core.substvars "provides=lsb-core-${lsbarch}"
@echo >> debian/lsb-cxx.substvars "provides=lsb-cxx-${lsbarch}"
@echo >> debian/lsb-graphics.substvars "provides=lsb-graphics-${lsbarch}"
- dh_gencontrol
- dh_md5sums
- dh_builddeb
+ dh_gencontrol -a
+ dh_md5sums -a
+ dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
if [ -f "$pidfile" ]; then
read -d "" line < "$pidfile"
for i in $line; do
- [ -z "${p//[0-9]/}" -a -d "/proc/$i" ] && pids="$i $pids"
+ if [ -z "$(echo $p | sed 's/[0-9]//g')" -a -d "/proc/$i" ]; then
+ pids="$i $pids"
+ fi
done
if [ -n "$pids" ]; then
echo "$pids"
fi
}
-log_msg() {
- local esc extd warn done norm stat
- local rc_done rc_warning rc_failure
- if test -z "$LINES" -o -z "$COLUMNS" ; then
- eval `stty size 2>/dev/null | (read L C; \
- echo LINES=${L:-24} COLUMNS=${C:-80})`
- fi
+log_success_msg () {
+ echo " * $@"
+}
- test $LINES -eq 0 && LINES=24
- test $COLUMNS -eq 0 && COLUMNS=80
- export LINES COLUMNS
-
- if test -t 1 -a "$TERM" != "raw" -a "$TERM" != "dumb" && stty size > /dev/null 2>&1 ; then
- esc=`echo -en "\033"`
- extd="${esc}[1m"
- warn="${esc}[1;31m"
- done="${esc}[1;32m"
- attn="${esc}[1;33m"
- norm=`echo -en "${esc}[m\017"`
- done="${esc}[1;32m"
- attn="${esc}[1;33m"
- norm=`echo -en "${esc}[m\017"`
- stat=`echo -en "\015${esc}[${COLUMNS}C${esc}[10D"`
-
- rc_done="${stat}${done}done${norm}"
- rc_warning="${stat}${attn}warning${norm}"
- rc_failure="${stat}${warn}failed${norm}"
+log_failure_msg () {
+ TPUT=/usr/bin/tput
+ if [ -x $TPUT ] && $TPUT hpa 60 >/dev/null 2>&1; then
+ RED=`$TPUT setaf 1`
+ NORMAL=`$TPUT op`
+ echo " $RED*$NORMAL $@"
else
- esc=".."
- norm=
- warn=
+ echo " * $@"
+ fi
+}
- rc_done="..done"
- rc_warning="..warning"
- rc_failed="..failed"
+log_warning_msg () {
+ TPUT=/usr/bin/tput
+ if [ -x $TPUT ] && $TPUT hpa 60 >/dev/null 2>&1; then
+ YELLOW=`$TPUT setaf 3`
+ NORMAL=`$TPUT op`
+ echo " $YELLOW*$NORMAL $@"
+ else
+ echo " * $@"
fi
- case "$1" in
- done)
- echo "$2$rc_done"
- ;;
- warning)
- echo "$2$rc_warning"
- ;;
- failure)
- echo "$2$rc_failure"
- ;;
- *)
- echo "$2${stat}${attn}$1${norm}"
- ;;
- esac
}
-log_success_msg () {
- log_msg "done" "$1"
+#
+# NON-LSB HELPER FUNCTIONS
+#
+# int get_lsb_header_val (char *scriptpathname, char *key)
+get_lsb_header_val () {
+ if [ ! -f "$1" ] || [ -z "$2" ]; then
+ return 1
+ fi
+ LSB_S="### BEGIN INIT INFO"
+ LSB_E="### END INIT INFO"
+ sed -n "/$LSB_S/,/$LSB_E/ s/# $2: \(.*\)/\1/p" $1
}
-log_failure_msg () {
- log_msg "failure" "$1"
+
+# int log_begin_message (char *message)
+log_begin_msg () {
+ if [ -z "$1" ]; then
+ return 1
+ fi
+ echo " * $@"
}
-log_warning_msg () {
- log_msg "warning" "$1"
+
+# int log_end_message (int exitstatus)
+log_end_msg () {
+
+ # If no arguments were passed, return
+ [ -z "$1" ] && return 1
+
+ # Only do the fancy stuff if we have an appropriate terminal
+ # and if /usr is already mounted
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ if [ -x $TPUT ] && [ -x $EXPR ] && $TPUT hpa 60 >/dev/null 2>&1; then
+ COLS=`$TPUT cols`
+ if [ -n "$COLS" ]; then
+ COL=`$EXPR $COLS - 7`
+ else
+ COL=73
+ fi
+ UP=`$TPUT cuu1`
+ END=`$TPUT hpa $COL`
+ START=`$TPUT hpa 0`
+ RED=`$TPUT setaf 1`
+ NORMAL=`$TPUT op`
+ if [ $1 -eq 0 ]; then
+ echo "$UP$END[ ok ]"
+ else
+ echo -e "$UP$START $RED*$NORMAL$END[${RED}fail${NORMAL}]"
+ fi
+ else
+ if [ $1 -eq 0 ]; then
+ echo " ...done."
+ else
+ echo " ...fail!"
+ fi
+ fi
+ return $1
}
+