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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
|
#!/bin/sh
#
# This script generate some valid Slackware packages
#
#
# Some variables.
#
CWD=`pwd`
PACKAGE=xine-lib.tgz
SLCK=$CWD/slack
PREFIX=${PREFIX:-"/usr/local"}
PKG=$CWD/slktmp
TMPBUILD=$CWD/tmpbuild
#DOINSTDIR=/install
#
# Create the post-install script
#
do_install_sh() {
cat > doinst.sh <<EOF
/sbin/ldconfig
EOF
}
#
# Create package description for pkgtool.
#
do_descr() {
cat > package_descriptions << EOF
xine-lib: xine-lib 1.1.19.
xine-lib:
xine-lib: xine-lib is the beating heart of xine (a free gpl-licensed
xine-lib: video player for unix-like systems) which among others provides
xine-lib: support for decoding (and playing back) of many today available
xine-lib: audio/video codecs, like mpeg-4 (DivX), mpeg-2 (DVD, SVCD),
xine-lib: mpeg-1 (VCD), Quicktime and RealMedia just to name a few.
xine-lib: This library contains (and uses) numerous processor specific
xine-lib: optimizations to provide a smooth playback and to minimize the
xine-lib: overall demand of CPU power.
xine-lib:
xine-lib: Don't hesitate to use %{name} in your own projects as long as
xine-lib: your usage complies to the GPL. More information about
xine-lib: GPL-license can be found at http://www.gnu.org/licenses/gpl.html
xine-lib:
xine-lib:
EOF
}
#
# Building binaries process, then install and move package in right place
#
do_build() {
cd $CWD
rm -rf $TMPBUILD
mkdir -p $TMPBUILD
cd $TMPBUILD && tar -xzf $CWD/xine-lib-1.1.19.tar.gz
do_install_sh;
cd xine-lib-1.1.19
DIE=1
echo "./configure --prefix=$PREFIX $CONFIG_OPT && make && make install-strip DESTDIR=$PKG LIBRARY_PATH=$TMPBUILD/xine-lib-1.1.19/src/xine-engine/.libs" && \
./configure --prefix=$PREFIX $CONFIG_OPT && make && make install-strip DESTDIR=$PKG LIBRARY_PATH=$TMPBUILD/xine-lib-1.1.19/src/xine-engine/.libs && \
mkdir -p $PKG/install && cp $TMPBUILD/doinst.sh $PKG/install && \
cd $PKG && \
echo "n" | /sbin/makepkg $PACKAGE && \
mv $PACKAGE $SLCK && \
cd $SLCK && DIE=0
do_descr
}
#
# Cleaning building directory
#
do_clean() {
rm -rf $TMPBUILD
rm -f $PACKAGE package_descriptions
rm -rf $PKG
cd $CWD
}
#
# Build for PPro
#
build_pentiumpro() {
echo "*****************************************************"
echo
echo "building slack for xine-lib 1.1.19"
echo
echo "current architecture:pentiumpro"
echo "slackware package will be copied to ./slack directory"
echo
echo "*****************************************************"
rm -rf $PKG
export XINE_BUILD=i686-pc-linux-gnu
do_build
if test "$DIE" -eq 0; then
tar -czvf xine-lib-1.1.19-i686.tar.gz $PACKAGE package_descriptions
fi
do_clean
}
#
# Build for Pentium
#
build_pentium() {
echo "*****************************************************"
echo
echo "building slack for xine-lib 1.1.19"
echo
echo "current architecture:pentium"
echo "slackware package will be copied to ./slack directory"
echo
echo "*****************************************************"
rm -rf $PKG
export XINE_BUILD=i586-pc-linux-gnu
do_build
if test "$DIE" -eq 0; then
tar -czvf xine-lib-1.1.19-i586.tar.gz $PACKAGE package_descriptions
fi
do_clean
}
#
# Build for K6
#
build_k6() {
echo "*****************************************************"
echo
echo "building slack for xine-lib 1.1.19"
echo
echo "current architecture:k6"
echo "slackware package will be copied to ./slack directory"
echo
echo "*****************************************************"
rm -rf $PKG
export XINE_BUILD=k6-pc-linux-gnu
do_build
if test "$DIE" -eq 0; then
tar -czvf xine-lib-1.1.19-k6.tar.gz $PACKAGE package_descriptions
fi
do_clean
}
#
# Build for K7
#
build_k7() {
echo "*****************************************************"
echo
echo "building slack for xine-lib 1.1.19"
echo
echo "current architecture:k7"
echo "slackware package will be copied to ./slack directory"
echo
echo "*****************************************************"
rm -rf $PKG
export XINE_BUILD=athlon-pc-linux-gnu
do_build
if test "$DIE" -eq 0; then
tar -czvf xine-lib-1.1.19-k7.tar.gz $PACKAGE package_descriptions
fi
do_clean
}
#
# Main function
#
main() {
rm -rf $SLCK
mkdir -p $SLCK
rm -f config.cache && ./autogen.sh && make dist
build_pentiumpro
build_pentium
build_k6
build_k7
mv -f $CWD/xine-lib-1.1.19.tar.gz $SLCK
}
#
# Handle arguments if available.
#
build_arch() {
rm -rf $SLCK
mkdir -p $SLCK
rm -f config.cache && ./autogen.sh && make dist
$barch
mv -f $CWD/xine-lib-1.1.19.tar.gz $SLCK
}
case "$1" in
pentiumpro | ppro | i686 | 686)
barch=build_pentiumpro
build_arch
;;
pentium | i586 | 586)
barch=build_pentium
build_arch
;;
k6)
barch=build_k6
build_arch
;;
k7 | athlon)
barch=build_k7
build_arch
;;
*)
main
;;
esac
|