1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
#!/bin/bash
if ! [ -f options ]; then
echo "Must run configure 1st"
exit 1
fi
. options
# create the package
echo "Creating package."
eval `pkgsend open $pkgname`
pushd $basedir
# create/add directories
echo "Creating directories..."
for file in `find $contentdir -d`; do
pkgsend add dir mode=0555 owner=root group=bin path="/$file"
done
# create/add all files
echo "Adding files..."
for file in `find $contentdir -type f`; do
pkgsend add file $file
done
# set attribs for binary files
echo "Setting attributes for executable files..."
for file in `find $contentdir -perm /u=x -type f`; do
pkgsend add file "$file" mode=0755 owner=root group=bin path="$file"
done
# set attribs for data files
echo "Setting attributes for data files..."
for file in `find $contentdir -perm /u=x -type f`; do
pkgsend add file "$file" mode=0644 owner=root group=bin path="$file"
done
# add dependencies
# set pkg stuff
echo "Setting package info..."
pkgsend add set name=description value="$description"
pkgsend add set name=maintainer value="$maintainer"
echo "Closing transaction."
pkgsend close
|