mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

119 lines
3.4 KiB

# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
#
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# Please add additional copyright information _after_ the line containing
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
#
# ROCK Linux: rock-src/package/mnemoc/runit/djb-config
# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
#
# This program 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. A copy of the GNU General Public
# License can be found at Documentation/COPYING.
#
# Many people helped and are helping developing ROCK Linux. Please
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
# file for details.
#
# --- ROCK-COPYRIGHT-NOTE-END ---
# why to use this secure stuff?
# because we can be updating.
pkg_djb_securecopy() {
echo "'$1/$3' -> '$2/$3'"
rm -f $2/$3'{new}'
cp -p $1/$3 $2/$3'{new}'
mv -f $2/$3'{new}' $2/$3
}
pkg_djb_securelink() {
echo "create symbolic link '$1/$3' to '$2/$3'"
rm -f $2/$3'{new}'
ln -s $1/$3 $2/$3'{new}'
mv -f $2/$3'{new}' $2/$3
}
pkg_djb_installpackage() {
# requires ./package/commands
# and files in ./command
local package=$1
local altdir=$2
if [ "$ROCKCFG_PKG_DJB_LAYOUT" == "1" ]; then
echo 'Copying commands to package directory...'
mkdir -p $pkg_djb_packagedir/$package/$pkg-$ver/command
for i in `cat ./package/commands`; do
pkg_djb_securecopy ./command \
$pkg_djb_packagedir/$package/$pkg-$ver/command $i
done
echo "Creating symlink $pkg -> $pkg-$ver..."
rm -f $pkg_djb_packagedir/$package/$pkg
ln -sv $pkg-$ver $pkg_djb_packagedir/$package/$pkg
echo "Making command links in $pkg_djb_commanddir..."
mkdir -p $pkg_djb_commanddir
for i in `cat package/commands`; do
pkg_djb_securelink $pkg_djb_packagedir/$package/$pkg-$ver/command \
$pkg_djb_commanddir $i
done
if [ $ROCKCFG_PKG_DJB_COMPAT -eq 1 ]; then
echo "Making compatibility links in $pkg_djb_compatdir..."
mkdir -p $pkg_djb_compatdir
for i in `cat package/commands`; do
pkg_djb_securelink $pkg_djb_packagedir/$package/$pkg-$ver/command \
$pkg_djb_compatdir $i
done
fi
else
echo 'Copying commands to package directory...'
pkg_djb_commanddir=$altdir
mkdir -p $pkg_djb_commanddir
for i in `cat ./package/commands`; do
pkg_djb_securecopy ./command $pkg_djb_commanddir $i
done
fi
}
pkg_djb_installdoc() {
local package=$1
if [ "$ROCKCFG_PKG_DJB_LAYOUT" == "1" ]; then
echo 'Copying package files to package directory...'
mkdir -p $pkg_djb_packagedir/$package/$pkg-$ver/package
for i in `ls ./package`; do
case $i in
compile|install*|upgrade)
/bin/true ;;
*) pkg_djb_securecopy ./package \
$pkg_djb_packagedir/$package/$pkg-$ver/package $i ;;
esac
done
else
echo 'Copying package files to doc directory...'
mkdir -p $docdir
for i in `ls ./package`; do
case $i in
compile|install*|upgrade)
/bin/true ;;
*) pkg_djb_securecopy ./package $docdir $i ;;
esac
done
fi
}
pkg_djb_packagedir="$root/package"
pkg_djb_commanddir="$root/command"
pkg_djb_compatdir="$root/usr/local/bin"
if [ "$ROCKCFG_PKG_DJB_LAYOUT" == "1" ]; then
pkg_djb_servicedir="$root/service"
else
pkg_djb_servicedir="$root/etc/service"
fi