diff options
author | MagicMan <MagicMan07@bluebottle.com> | 2010-05-11 14:56:19 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-05-11 14:56:19 +0200 |
commit | 1b0527472e17ba395acfa8e34ef534c592cee531 (patch) | |
tree | 358cfd9fca5c7828be86448671e9475b7d2ed052 /libraries/libgphoto2/libgphoto2.SlackBuild | |
parent | 30be639280c1dcace064da2e8930409f0b5c6264 (diff) | |
download | slackbuilds-1b0527472e17ba395acfa8e34ef534c592cee531.tar.gz |
libraries/libgphoto2: Initial import
Diffstat (limited to 'libraries/libgphoto2/libgphoto2.SlackBuild')
-rw-r--r-- | libraries/libgphoto2/libgphoto2.SlackBuild | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/libraries/libgphoto2/libgphoto2.SlackBuild b/libraries/libgphoto2/libgphoto2.SlackBuild new file mode 100644 index 0000000000..b7400cdb12 --- /dev/null +++ b/libraries/libgphoto2/libgphoto2.SlackBuild @@ -0,0 +1,118 @@ +#!/bin/sh + +# Slackware build script for libgphoto2 + +# Written by MagicMan <MagicMan07@bluebottle.com> +# No Guarantees. Use this SlackBuild at your own risk. +# Public Domain + +# Modified by the SlackBuilds.org project + +# Modified by Michael Wagner <lapinours@web.de> +# (include hal device information files, change group ownership +# for udev rules to plugdev, adjust README) +# Do not blame the original author if anything goes wrong with these changes. + +PRGNAM=libgphoto2 +VERSION=2.3.1 +ARCH=${ARCH:-i486} +BUILD=${BUILD:-3} +TAG=${TAG:-_SBo} +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +PDOCS="ABOUT-NLS ChangeLog HACKING INSTALL MAINTAINERS README.in TESTERS" + +# If you have HAL installed, pass HAL=YES when running the build script +# HAL=YES ./libgphoto2.SlackBuild +HAL=${HAL:-NO} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +fi + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP || exit 1 +rm -rf $PRGNAM-$VERSION +tar -xvjf $CWD/$PRGNAM-$VERSION.tar.bz2 || exit 1 +cd $PRGNAM-$VERSION || exit 1 +chown -R root:root . +chmod -R u+w,go+r-w,a-s . + +# Patch print-camera-list.c to ignore zero vendor IDs on udev >= 098 +# https://bugs.launchpad.net/ubuntu/+source/udev/+bug/76077 +# This is a harmless patch for stock 11.0 +patch -p0 < $CWD/print-camera-list.c.diff || exit 1 + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --enable-static=no \ + --mandir=/usr/man \ + --with-doc-dir=/usr/doc/$PRGNAM-$VERSION \ + || exit 1 + +make || exit 1 + +# Make sure udev helper scripts are put in the right place and +# install the other utilities to /usr/bin instead of /usr/lib/libgphoto2/ +make \ + udevscriptdir=/lib/udev \ + utilsdir=/usr/bin \ + install-strip DESTDIR=$PKG \ + || exit 1 + +# Install usbcam file for old hotplug subsystem to work properly +install -D -m 0755 packaging/linux-hotplug/usbcam.group \ + $PKG/etc/hotplug/usb/usbcam + +# Install "dummy" udev rules files and (maybe) HAL device information files so +# they will be removed later if the package is uninstalled; the post-install +# script will append auto-generated rules to these files +mkdir -p $PKG/etc/udev/rules.d + +cat << EOF > $PKG/etc/udev/rules.d/90-libgphoto2.rules +# DO NOT EDIT THIS FILE! +# Any custom changes will be lost if the libgphoto package is upgraded. + +EOF + +# If HAL is installed, then also install the fdi files for it +if [ "$HAL" = "YES" ]; then +mkdir -p $PKG/usr/share/hal/fdi/information/20thirdparty +cat << EOF > $PKG/usr/share/hal/fdi/information/20thirdparty/10-camera-libgphoto2.fdi +<!-- DO NOT EDIT THIS FILE! --> +<!-- Any custom changes will be lost if the libgphoto package is upgraded. --> + +EOF + +cat << EOF > $PKG/usr/share/hal/fdi/information/20thirdparty/10-camera-libgphoto2-device.fdi +<!-- DO NOT EDIT THIS FILE! --> +<!-- Any custom changes will be lost if the libgphoto package is upgraded. --> + +EOF +fi + +( cd $PKG/usr/man + find . -type f -exec gzip -9 {} \; + for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done +) + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $PDOCS $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz |