#!/bin/bash # db44.SlackBuild # Heavily based on the original Slackware build scripts, # Modified by Stuart Winter # Record toolchain & other info for the build log: slackbuildinfo # Paths to skeleton port's source & real Slackware source tree: export CWD=$SLACKSOURCE/$PKGSERIES/$PKGNAM export PORTCWD=$PWD # Temporary build locations: export TMPBUILD=$TMP/build-$PKGNAM export PKG=$TMP/package-$PKGNAM mkpkgdirs # Delete & re-create temporary directories then cd into $TMPBUILD # Extract source: tar xvvf $CWD/db-$VERSION.tar.bz2 cd db-$VERSION || exit 1 slackhousekeeping # Official patches: zcat $CWD/patch.4.4.20.1.gz | patch -p0 --verbose zcat $CWD/patch.4.4.20.2.gz | patch -p0 --verbose # Configure: rm -rf build-dir mkdir build-dir cd build-dir CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ../dist/configure \ --prefix=/usr \ --enable-shared \ --enable-rpc \ --enable-cxx \ --enable-compat185 \ --build=$ARCH-slackware-linux-gnueabi || failconfig # Build: make $NUMJOBS || failmake # Install into package: make install DESTDIR=$PKG # Remove WAY TOO LARGE (and misplaced) docs: rm -rf $PKG/usr/docs mkdir -p $PKG/usr/doc/db-$VERSION cp -a \ ../LICENSE ../README \ $PKG/usr/doc/db-$VERSION cat << EOF > $PKG/usr/doc/db-$VERSION/README-DOCS For a ton of additional documentation (too large to include here) on writing source code that uses libdb44, please see the source tarball db-$VERSION.tar.bz2, which can be found in the Slackware source tree in source/l/db44/, or on Sleepycat's web site: http://www.sleepycat.com. EOF # Move include files: ( cd $PKG/usr/include mkdir -vpm755 db44 mv -fv *.h db44 for file in db44/* ; do ln -vsf $file . done # Better add this symlink, too, just to be safe... ln -vsf db44 db4 ) # Rename binaries to avoid overlap: ( cd $PKG/usr/bin mv -fv berkeley_db_svc berkeley_db44_svc for file in db_* ; do mv -fv $file db44_`echo $file | cut -f 2- -d _` done ) # Put libdb-4.4.so into /lib since it might be needed # before /usr is mounted (eg, nsswitch.conf can be set up to # use databases instead of flat files) mkdir -vpm755 $PKG/lib mv -fv $PKG/usr/lib/libdb-4.4.so $PKG/lib/libdb-4.4.so ( cd $PKG/usr/lib ln -vsf /lib/libdb-4.4.so . ) # Some things might look for these libraries by other names. ( cd $PKG/usr/lib ln -vsf libdb-4.4.a libdb-4.a ln -vsf libdb-4.4.a libdb4.a ln -vsf libdb-4.4.a libdb.a ln -vsf libdb_cxx-4.4.a libdb_cxx-4.a ln -vsf libdb_cxx-4.4.a libdb_cxx.a ln -vsf libdb-4.4.so libdb4.so ln -vsf libdb-4.4.so libdb.so ) chmod 755 $PKG/usr/bin/* # If necessary, start the fakeroot server so we can set file/dir ownerships: start_fakeroot # Apply generic Slackware packaging policies: cd $PKG slackstripall # strip all .a archives and all ELFs slackgzpages -i # compress man & info pages and delete usr/info/dir slackslack # chown -R root:root, chmod -R og-w, slackchown (root:bin), slack644docs slackdesc # install slack-desc and doinst.sh slackmp # run makepkg -l y -c n # Perform any final checks on the package: cd $PKG slackhlinks # search for any hard links