jw-pkg/make/mkspec.sh
2002-07-02 12:49:50 +00:00

138 lines
3.7 KiB
Bash

#!/bin/sh
MYNAME=`basename $0`
INSTALL_LOG=/var/tmp/%{name}-buildroot/install.log
usage()
{
echo usage: $MYNAME -h [-N name] [-T topdir] [-V version] [-S source]
[ "$1" ] && exit $1
}
set -- `getopt T:V:S:N:h $*`
while [ $1 != -- ]; do
case $1 in
-h)
usage 0;;
-T)
TOPDIR=$2
shift;;
-V)
V=$2
shift;;
-S)
SOURCE=$2
shift;;
-N)
NAME=$2
shift;;
*)
usage 1;;
esac
shift
done
shift
[ -z "$TOPDIR" ] && TOPDIR=.
if [ -z "$V" ]; then
if [ -f $TOPDIR/VERSION ]; then
VERSION="`cat $TOPDIR/VERSION | cut -d- -f1`"
RELEASE="`cat $TOPDIR/VERSION | cut -d- -f2-`"
else
VERSION=noversion
RELEASE=norelease
fi
else
VERSION="`echo $V | cut -d- -f1`"
RELEASE="`echo $V | cut -d- -f2-`"
fi
if [ -z "$NAME" ]; then
NAME=`pwd | xargs basename`
fi
echo "Name: $NAME"
echo "Summary: Jannet IT Services Tool Library"
echo "Version: $VERSION"
echo "Release: $RELEASE"
echo "License: LGPL"
echo "Group: System Environment/Libraries"
[ -n "$SOURCE" ] && echo "Source: $SOURCE"
echo "Vendor: Jannet IT Services, Berlin"
echo "URL: http://www.jannet.de"
echo "BuildRoot: /var/tmp/%{name}-buildroot"
echo "%define post /sbin/ldconfig"
#echo "%define __spec_install_post /sbin/ldconfig"
echo ""
echo "%description"
echo "This is a library providing easy-to-use interfaces for:"
echo ""
echo "+ platform independent logging"
echo "+ platform independent locking"
echo "+ platform independent threads"
echo "+ platform independent profiling"
echo "+ a platform independent config file reader"
echo "+ shared memory"
echo "+ a lightweight middleware suite"
echo ""
echo "It was originally designed to be a versatile pool of"
echo "programming tools to be used in my projects as a freelancing"
echo "software developer."
echo ""
echo "%package -n $NAME-run"
echo "Summary: The runtime library package."
echo "Group: System Environment/Libraries"
echo "%description -n $NAME-run"
echo "runtime library package of the ytools library"
echo ""
echo "%package -n $NAME-devel"
echo "Summary: The development library package."
echo "Group: System Environment/Libraries"
echo "%description -n $NAME-devel"
echo "development library package of the ytools library"
echo ""
echo "%prep"
#echo "echo hallo"
echo "%setup -q -n $NAME-$V"
#echo "%setup -c"
#echo 'echo prep; pwd'
echo ""
echo "%build"
echo 'pwd'
echo 'make clean libclean'
echo 'make'
echo ""
echo "%install"
#echo 'mkdir -p $RPM_BUILD_ROOT/'
#echo 'mkdir -p $RPM_BUILD_ROOT/opt/ytools/lib'
#echo 'mkdir -p $RPM_BUILD_ROOT/usr/share/doc/packages/ytools'
#echo 'pwd'
echo "export ENV_PREFIX=\$RPM_BUILD_ROOT"
echo "export INSTALL_LOG=$INSTALL_LOG"
echo "mkdir -p `dirname $INSTALL_LOG`"
echo "> $INSTALL_LOG"
echo "make install"
echo "cat $INSTALL_LOG | sed \"s% \$RPM_BUILD_ROOT% %\" | grep -ve 'include\|devel\|make\|lib.*\.a$' > $INSTALL_LOG.$NAME"
echo "cat $INSTALL_LOG | sed \"s% \$RPM_BUILD_ROOT% %\" | grep -e 'include\|devel\|make\|lib.*\.a$' > $INSTALL_LOG.$NAME-devel"
#echo "install -m 755 $TOPDIR/lib/*.so \$RPM_BUILD_ROOT/opt/ytools/lib"
#echo "install -m 644 $TOPDIR/doc/ytools/dist/* \$RPM_BUILD_ROOT/usr/share/doc/packages/ytools"
#echo "install -m 644 $TOPDIR/COPYING \$RPM_BUILD_ROOT/usr/share/doc/packages/ytools"
#echo "echo $VERSION.$RELEASE > \$RPM_BUILD_ROOT/usr/share/doc/packages/ytools/VERSION"
echo ""
#echo "%post /sbin/ldconfig"
echo ""
echo "%clean"
echo 'rm -rf $RPM_BUILD_ROOT'
echo "%files -n $NAME-run -f $INSTALL_LOG.$NAME"
echo "%files -n $NAME-devel -f $INSTALL_LOG.$NAME-devel"
echo '%defattr (-, root, root)'
#echo "%dir /opt/ytools/lib"
#echo "/opt/ytools/lib"
#find /opt/ytools/lib -type f
#echo "%dir /usr/share/doc/packages/ytools"
#echo "/usr/share/doc/packages/ytools"
#find /usr/share/doc/packages/ytools -type f
echo ""