Skip to content

Commit

Permalink
Add soname symlink
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordi committed Oct 31, 2013
1 parent b930c30 commit ad8343b
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 62 deletions.
4 changes: 2 additions & 2 deletions linux/build_all.sh
Expand Up @@ -53,7 +53,7 @@ fi


# check arguments
unset RELEASE FORCE VER
unset REVISION FORCE VER

for I in "$@"
do
Expand All @@ -70,7 +70,7 @@ do
FORCE="-f"
;;
-r*)
export RELEASE="${I:2}"
export REVISION="${I:2}"
;;
-v*)
VER="${I:2}"
Expand Down
8 changes: 4 additions & 4 deletions linux/dmd_apt.sh
Expand Up @@ -7,14 +7,14 @@ set -e -o pipefail
# set variables
KEYID="dmd-apt"
VERSION=${1:2}
if [ "$RELEASE" == "" ]
if [ "$REVISION" == "" ]
then
RELEASE=0
REVISION=0
fi
DESTDIR=`pwd`
APTDIR="apt"
DEB32="dmd_"$VERSION"-"$RELEASE"_i386.deb"
DEB64="dmd_"$VERSION"-"$RELEASE"_amd64.deb"
DEB32="dmd_"$VERSION"-"$REVISION"_i386.deb"
DEB64="dmd_"$VERSION"-"$REVISION"_amd64.deb"


# error function
Expand Down
8 changes: 4 additions & 4 deletions linux/dmd_arch.sh
Expand Up @@ -94,9 +94,9 @@ fi
# assign variables
MAINTAINER="Jordi Sayol <g.sayol@yahoo.es>"
VERSION=${1:2}
if [ "$RELEASE" == "" ]
if [ "$REVISION" == "" ]
then
RELEASE=0
REVISION=0
fi
DESTDIR=`pwd`
TEMPDIR='/tmp/'`date +"%s%N"`
Expand All @@ -108,7 +108,7 @@ elif test "$2" = "-m32" ;then
ARCH="i386"
fi
ZIPFILE=`basename $DMDURL`
ARCHFILE="dmd-"$VERSION"-"$RELEASE"-"$ARCH".pkg.tar.xz"
ARCHFILE="dmd-"$VERSION"-"$REVISION"-"$ARCH".pkg.tar.xz"


# check if destination arch file already exist
Expand Down Expand Up @@ -205,7 +205,7 @@ else

# create .PKGINFO file
echo -e 'pkgname = dmd
pkgver = '$VERSION-$RELEASE'
pkgver = '$VERSION-$REVISION'
pkgdesc = Digital Mars D Compiler
url = http://dlang.org/
builddate = '$(date +%s)'
Expand Down
39 changes: 12 additions & 27 deletions linux/dmd_deb.sh
Expand Up @@ -98,14 +98,10 @@ MAINTAINER="Jordi Sayol <g.sayol@yahoo.es>"
VERSION=${1:2}
MAJOR=0
MINOR=$(awk -F. '{ print $2 +0 }' <<<$VERSION)
BUG=$(awk -F. '{ print $3}' <<<$VERSION)
if [ "$BUG" == "" ]
RELEASE=$(awk -F. '{ print $3 +0 }' <<<$VERSION)
if [ "$REVISION" == "" ]
then
BUG=0
fi
if [ "$RELEASE" == "" ]
then
RELEASE=0
REVISION=0
fi
DESTDIR=`pwd`
TEMPDIR='/tmp/'`date +"%s%N"`
Expand All @@ -117,7 +113,7 @@ elif test "$2" = "-m32" ;then
ARCH="i386"
fi
ZIPFILE=`basename $DMDURL`
DMDDIR="dmd_"$VERSION"-"$RELEASE"_"$ARCH
DMDDIR="dmd_"$VERSION"-"$REVISION"_"$ARCH
DIR32="i386-linux-gnu"
DIR64="x86_64-linux-gnu"
DEBFILE=$DMDDIR".deb"
Expand Down Expand Up @@ -177,27 +173,16 @@ else
mkdir -p usr/lib
A_LIB="libphobos2.a"
SO_LIB="libphobos2.so"
SO_VERSION=$MAJOR.$MINOR.$BUG
SO_VERSION=$MAJOR.$MINOR
mkdir -p usr/lib/{$DIR32,$DIR64}
cp -f ../$UNZIPDIR/linux/lib32/$A_LIB usr/lib/$DIR32
cp -f ../$UNZIPDIR/linux/lib64/$A_LIB usr/lib/$DIR64
cp -f ../$UNZIPDIR/linux/lib32/$SO_LIB usr/lib/$DIR32/$SO_LIB.$SO_VERSION
cp -f ../$UNZIPDIR/linux/lib64/$SO_LIB usr/lib/$DIR64/$SO_LIB.$SO_VERSION
ln -s $SO_LIB.$SO_VERSION usr/lib/$DIR32/$SO_LIB
ln -s $SO_LIB.$SO_VERSION usr/lib/$DIR64/$SO_LIB

# links to libraries for backward compatibility
if [ "$ARCH" == "amd64" ]
then
mkdir -p usr/lib usr/lib32
ln -s ../lib/$DIR64/$SO_LIB.$SO_VERSION usr/lib
ln -s ../lib/$DIR32/$SO_LIB.$SO_VERSION usr/lib32
elif [ "$ARCH" == "i386" ]
then
mkdir -p usr/lib usr/lib64
ln -s ../lib/$DIR32/$SO_LIB.$SO_VERSION usr/lib
ln -s ../lib/$DIR64/$SO_LIB.$SO_VERSION usr/lib64
fi
cp -f ../$UNZIPDIR/linux/lib32/$SO_LIB usr/lib/$DIR32/$SO_LIB.$SO_VERSION.$RELEASE
cp -f ../$UNZIPDIR/linux/lib64/$SO_LIB usr/lib/$DIR64/$SO_LIB.$SO_VERSION.$RELEASE
ln -s $SO_LIB.$SO_VERSION.$RELEASE usr/lib/$DIR32/$SO_LIB.$SO_VERSION
ln -s $SO_LIB.$SO_VERSION.$RELEASE usr/lib/$DIR64/$SO_LIB.$SO_VERSION
ln -s $SO_LIB.$SO_VERSION.$RELEASE usr/lib/$DIR32/$SO_LIB
ln -s $SO_LIB.$SO_VERSION.$RELEASE usr/lib/$DIR64/$SO_LIB


# install include
Expand Down Expand Up @@ -286,7 +271,7 @@ else

# create control file
echo -e 'Package: dmd
Version: '$VERSION-$RELEASE'
Version: '$VERSION-$REVISION'
Architecture: '$ARCH'
Maintainer: '$MAINTAINER'
Installed-Size: '$(du -ks usr/ | awk '{print $1}')'
Expand Down
24 changes: 11 additions & 13 deletions linux/dmd_phobos.sh
Expand Up @@ -98,14 +98,10 @@ MAINTAINER="Jordi Sayol <g.sayol@yahoo.es>"
VERSION=${1:2}
MAJOR=0
MINOR=$(awk -F. '{ print $2 +0 }' <<<$VERSION)
BUG=$(awk -F. '{ print $3}' <<<$VERSION)
if [ "$BUG" == "" ]
RELEASE=$(awk -F. '{ print $3 +0 }' <<<$VERSION)
if [ "$REVISION" == "" ]
then
BUG=0
fi
if [ "$RELEASE" == "" ]
then
RELEASE=0
REVISION=0
fi
DESTDIR=`pwd`
TEMPDIR='/tmp/'`date +"%s%N"`
Expand All @@ -118,7 +114,7 @@ elif test "$2" = "-m32" ;then
fi
ZIPFILE=`basename $DMDURL`
PHOBOSPKG="libphobos2-"$MINOR
PHOBOSDIR=$PHOBOSPKG"_"$VERSION"-"$RELEASE"_"$ARCH
PHOBOSDIR=$PHOBOSPKG"_"$VERSION"-"$REVISION"_"$ARCH
DIR32="i386-linux-gnu"
DIR64="x86_64-linux-gnu"
PHOBOSFILE=$PHOBOSDIR".deb"
Expand Down Expand Up @@ -160,15 +156,17 @@ else

# install library
SO_LIB="libphobos2.so"
SO_VERSION=$MAJOR.$MINOR.$BUG
SO_VERSION=$MAJOR.$MINOR
if [ "$ARCH" == "amd64" ]
then
mkdir -p usr/lib/$DIR64
cp -f ../$UNZIPDIR/linux/lib64/$SO_LIB usr/lib/$DIR64/$SO_LIB.$SO_VERSION
cp -f ../$UNZIPDIR/linux/lib64/$SO_LIB usr/lib/$DIR64/$SO_LIB.$SO_VERSION.$RELEASE
ln -s $SO_LIB.$SO_VERSION.$RELEASE usr/lib/$DIR64/$SO_LIB.$SO_VERSION
elif [ "$ARCH" == "i386" ]
then
mkdir -p usr/lib/$DIR32
cp -f ../$UNZIPDIR/linux/lib32/$SO_LIB usr/lib/$DIR32/$SO_LIB.$SO_VERSION
cp -f ../$UNZIPDIR/linux/lib32/$SO_LIB usr/lib/$DIR32/$SO_LIB.$SO_VERSION.$RELEASE
ln -s $SO_LIB.$SO_VERSION.$RELEASE usr/lib/$DIR32/$SO_LIB.$SO_VERSION
fi


Expand Down Expand Up @@ -199,7 +197,7 @@ else
# create control file
echo -e 'Package: libphobos2-'$MINOR'
Source: libphobos
Version: '$VERSION-$RELEASE'
Version: '$VERSION-$REVISION'
Architecture: '$ARCH'
Maintainer: '$MAINTAINER'
Installed-Size: '$(du -ks usr/ | awk '{print $1}')'
Expand Down Expand Up @@ -251,7 +249,7 @@ else

# change folders and files permissions
chmod -R 0755 *
chmod 0644 $(find -L . ! -type d)
chmod 0644 $(find -L . ! -type d ! -name "$SO_LIB.$SO_VERSION")
chmod 0755 DEBIAN/{postinst,postrm}


Expand Down
29 changes: 17 additions & 12 deletions linux/dmd_rpm.sh
Expand Up @@ -96,9 +96,12 @@ do
# assign variables
MAINTAINER="Jordi Sayol <g.sayol@yahoo.es>"
VERSION=${1:2}
if [ "$RELEASE" == "" ]
MAJOR=0
MINOR=$(awk -F. '{ print $2 +0 }' <<<$VERSION)
RELEASE=$(awk -F. '{ print $3 +0 }' <<<$VERSION)
if [ "$REVISION" == "" ]
then
RELEASE=0
REVISION=0
fi
DESTDIR=`pwd`
TEMPDIR='/tmp/'`date +"%s%N"`
Expand All @@ -112,8 +115,8 @@ do
FARCH="x86-32"
fi
ZIPFILE=`basename $DMDURL`
DMDDIR="dmd-"$VERSION"-"$RELEASE"."$ARCH
RPMFILE="dmd-"$VERSION"-"$RELEASE"."$DNAME"."$ARCH".rpm"
DMDDIR="dmd-"$VERSION"-"$REVISION"."$ARCH
RPMFILE="dmd-"$VERSION"-"$REVISION"."$DNAME"."$ARCH".rpm"
RPMDIR=$TEMPDIR"/rpmbuild"


Expand Down Expand Up @@ -170,16 +173,18 @@ do
# install libraries
A_LIB="libphobos2.a"
SO_LIB="libphobos2.so"
SO_VERSION=0.$(awk -F. '{ print $2 +0 }' <<<$VERSION).0
SO_VERSION=$MAJOR.$MINOR
mkdir -p usr/lib
cp -f ../$UNZIPDIR/linux/lib32/$A_LIB usr/lib
cp -f ../$UNZIPDIR/linux/lib32/$SO_LIB usr/lib/$SO_LIB.$SO_VERSION
ln -s $SO_LIB.$SO_VERSION usr/lib/$SO_LIB
cp -f ../$UNZIPDIR/linux/lib32/$SO_LIB usr/lib/$SO_LIB.$SO_VERSION.$RELEASE
ln -s $SO_LIB.$SO_VERSION.$RELEASE usr/lib/$SO_LIB.$SO_VERSION
ln -s $SO_LIB.$SO_VERSION.$RELEASE usr/lib/$SO_LIB
if test "$ARCH" = "x86_64" ;then
mkdir -p usr/lib64
cp -f ../$UNZIPDIR/linux/lib64/$A_LIB usr/lib64
cp -f ../$UNZIPDIR/linux/lib64/$SO_LIB usr/lib64/$SO_LIB.$SO_VERSION
ln -s $SO_LIB.$SO_VERSION usr/lib64/$SO_LIB
cp -f ../$UNZIPDIR/linux/lib64/$SO_LIB usr/lib64/$SO_LIB.$SO_VERSION.$RELEASE
ln -s $SO_LIB.$SO_VERSION.$RELEASE usr/lib64/$SO_LIB.$SO_VERSION
ln -s $SO_LIB.$SO_VERSION.$RELEASE usr/lib64/$SO_LIB
fi


Expand Down Expand Up @@ -272,7 +277,7 @@ do
cd ..
echo -e 'Name: dmd
Version: '$VERSION'
Release: '$RELEASE'
Release: '$REVISION'
Summary: Digital Mars D Compiler
Group: Development/Languages
Expand All @@ -282,7 +287,7 @@ do
ExclusiveArch: '$ARCH'
Requires: '$DEPEND'
Provides: dmd = '$VERSION-$RELEASE', dmd('$FARCH') = '$VERSION-$RELEASE'
Provides: dmd = '$VERSION-$REVISION', dmd('$FARCH') = '$VERSION-$REVISION'
%description
D is a systems programming language. Its focus is on combining the power and
Expand Down Expand Up @@ -337,7 +342,7 @@ do


# place rpm package
mv $RPMDIR/$ARCH/dmd-$VERSION-$RELEASE.$ARCH.rpm $DESTDIR"/"$RPMFILE
mv $RPMDIR/$ARCH/dmd-$VERSION-$REVISION.$ARCH.rpm $DESTDIR"/"$RPMFILE


# delete temp dir
Expand Down

0 comments on commit ad8343b

Please sign in to comment.