4 # This script creates all four packages of ComixCursors for distribution
6 # It's ment to be run from the directory containig the sources e.g.
9 # -rw-r--r-- 1 user users 433 20. Jun 12:07 build-all-packages.sh
10 # drwxr-xr-x 4 user users 4096 20. Jun 11:56 ComixCursors-LH-opaque-sources-0.6.1
11 # drwxr-xr-x 8 user users 4096 20. Jun 11:56 ComixCursors-LH-sources-0.6.1
12 # drwxr-xr-x 8 user users 4096 20. Jun 11:56 ComixCursors-opaque-sources-0.6.1
13 # drwxr-xr-x 8 user users 4096 20. Jun 12:06 ComixCursors-sources-0.6.1
18 PKGS
="ComixCursors-LH-opaque ComixCursors-LH ComixCursors-opaque ComixCursors"
22 if [ ! -d $DISTDIR ] ; then mkdir
$DISTDIR; fi
28 SUBDIR
=$PKG-sources-$VERSION
30 if [ ! -d $SUBDIR ] ; then
31 echo "Error: directory $SUBDIR not found, exiting."
35 echo "Packaging $PKG $VERSION..."
40 echo "Creating source package..."
45 TARFILE
=$SUBDIR.
tar.bz2
46 if [ -f $TARFILE ] ; then rm $TARFILE; fi
47 tar -cjf $TARFILE $SUBDIR
50 echo "Installing cursor files..."
54 cp link-cursors.sh ~
/.icons
/
59 echo "Creating cursors package..."
61 # now it's important that the $PKGS get processed in an "reverse" order,
62 # so only directories matching package name get packed.
65 TARFILE
=$PKG-$VERSION.
tar.bz2
66 if [ -f $TARFILE ] ; then rm $TARFILE; fi
67 tar -cjhf $TARFILE $PKG* link-cursors.sh
74 PKGDIR
=/usr
/src
/packages
75 if [ -d $PKGDIR ] ; then
76 echo "Creating RPM package..."
78 cp $SUBDIR/$PKG.spec
$PKGDIR/SPECS
/$PKG.spec
79 cp $DISTDIR/$PKG-$VERSION.
tar.bz2
$PKGDIR/SOURCES
/$PKG-$VERSION.
tar.bz2
81 rpmbuild
-bb $PKGDIR/SPECS
/$PKG.spec
82 mv $PKGDIR/RPMS
/noarch
/$PKG* $DISTDIR
84 echo "Directory /usr/src/packages not found, skipping RPM packaging."