Files
mozjpeg/release/makedpkg.in
DRC 2de2cf9e54 Further enhancements/fixes to the packaging system:
-- The Mac and Cygwin packages will now be created with the directory structure defined by the configure variables "prefix", "bindir", "libdir", etc., with the exception that the docs are always installed under /usr/share/doc/{package_name}-{version} on Cygwin and /Library/Documentation/{package_name} on Mac.
-- Fixed a duplicate filename warning when generating RPMs with the default prefix of /opt/libjpeg-turbo.
-- Moved the TurboJPEG libraries out of the system directory on Windows and Mac.  It is no longer necessary to put them there, since we are not trying to be backward compatible with TurboJPEG/IPP anymore.
-- Fixed an issue whereby building the "installer" target on Windows would not build the Java JAR file, thus causing an error if the JAR had not been previously built.
-- Building the "install" target on Windows will now install libjpeg-turbo into c:\libjpeg-turbo[-gcc][64] (the same directories used by the installers.)  This can be overridden by setting CMAKE_INSTALL_PREFIX.
-- The Java classes on all platforms will now look for the JNI library in the directory under which the build/packaging system installs it.
2013-04-23 22:29:00 +00:00

69 lines
1.5 KiB
Bash

#!/bin/sh
set -u
set -e
trap onexit INT
trap onexit TERM
trap onexit EXIT
TMPDIR=
onexit()
{
if [ ! "$TMPDIR" = "" ]; then
sudo rm -rf $TMPDIR
fi
}
makedeb()
{
SUPPLEMENT=$1
DIRNAME=$PACKAGE_NAME
if [ $SUPPLEMENT = 1 ]; then
PACKAGE_NAME=$PACKAGE_NAME\32
DEBARCH=amd64
fi
umask 022
rm -f $PACKAGE_NAME\_$VERSION\_$DEBARCH.deb
TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
mkdir $TMPDIR/DEBIAN
(cat $SRCDIR/release/deb-control.tmpl | sed s/{__PKGNAME}/$PACKAGE_NAME/g \
| sed s/{__VERSION}/$VERSION/g | sed s/{__BUILD}/$BUILD/g \
| sed s/{__ARCH}/$DEBARCH/g > $TMPDIR/DEBIAN/control)
if [ $SUPPLEMENT = 1 ]; then
make install DESTDIR=$TMPDIR bindir=/dummy/bin datadir=/dummy/data \
docdir=/dummy/doc includedir=/dummy/include mandir=/dummy/man
rm -f $TMPDIR$LIBDIR/*.la
rm -rf $TMPDIR/dummy
else
make install DESTDIR=$TMPDIR docdir=/usr/share/doc/$DIRNAME-$VERSION \
exampledir=/usr/share/doc/$DIRNAME-$VERSION
rm -f $TMPDIR$LIBDIR/*.la
if [ "$PREFIX" = "/opt/libjpeg-turbo" -a "$DOCDIR" = "/opt/libjpeg-turbo/doc" ]; then
ln -fs /usr/share/doc/$DIRNAME-$VERSION $TMPDIR$DOCDIR
fi
fi
/sbin/ldconfig -n $TMPDIR$LIBDIR
sudo chown -Rh root:root $TMPDIR/*
dpkg -b $TMPDIR $PACKAGE_NAME\_$VERSION\_$DEBARCH.deb
}
PACKAGE_NAME=@PKGNAME@
VERSION=@VERSION@
BUILD=@BUILD@
DEBARCH=@DEBARCH@
SRCDIR=@abs_top_srcdir@
PREFIX=%{__prefix}
DOCDIR=%{__docdir}
LIBDIR=%{__libdir}
makedeb 0
if [ "$DEBARCH" = "i386" ]; then makedeb 1; fi
exit