system/hddtemp: Fix build.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Willy Sudiarto Raharjo 2016-03-03 21:02:14 +07:00
parent 6da1dbfb26
commit 8ec75fa68d
2 changed files with 35 additions and 12 deletions

View file

@ -9,7 +9,7 @@
PRGNAM=hddtemp PRGNAM=hddtemp
SRCVERSION=${SRCVERSION:-0.3-beta15} SRCVERSION=${SRCVERSION:-0.3-beta15}
VERSION=$(echo $SRCVERSION | tr -d "-") VERSION=$(echo $SRCVERSION | tr -d "-")
BUILD=${BUILD:-1} BUILD=${BUILD:-2}
TAG=${TAG:-_SBo} TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then if [ -z "$ARCH" ]; then
@ -49,10 +49,12 @@ tar xvf $CWD/$PRGNAM-$SRCVERSION.tar.bz2
cd $PRGNAM-$SRCVERSION cd $PRGNAM-$SRCVERSION
chown -R root:root . chown -R root:root .
find -L . \ find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-exec chmod 755 {} \; -o \ -o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-exec chmod 644 {} \; -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
patch -p1 < $CWD/hddtemp.patch
CFLAGS="$SLKCFLAGS" \ CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \
@ -65,14 +67,11 @@ CXXFLAGS="$SLKCFLAGS" \
make make
make install DESTDIR=$PKG make install DESTDIR=$PKG
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
( cd $PKG/usr/man find $PKG/usr/man -type f -exec gzip -9 {} \;
find . -type f -exec gzip -9 {} \; for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
)
mkdir -p $PKG/etc/hddtemp mkdir -p $PKG/etc/hddtemp
cp -a $CWD/hddtemp.db $PKG/etc/hddtemp/hddtemp.db.new cp -a $CWD/hddtemp.db $PKG/etc/hddtemp/hddtemp.db.new

View file

@ -0,0 +1,24 @@
__USE_GNU needs to be in effect when including sys/ucontext.h,
and signal.h pulls it in in some setups.
diff -up hddtemp-0.3-beta15/src/backtrace.c~ hddtemp-0.3-beta15/src/backtrace.c
--- hddtemp-0.3-beta15/src/backtrace.c~ 2006-04-19 05:38:14.000000000 +0300
+++ hddtemp-0.3-beta15/src/backtrace.c 2010-02-14 21:59:47.000000000 +0200
@@ -27,13 +27,12 @@
#include <stdlib.h>
#include <unistd.h>
#include <linux/ptrace.h>
+#define __USE_GNU
+#include <ucontext.h>
#include <signal.h>
#include <bits/sigcontext.h>
#include <sys/param.h>
-#define __USE_GNU
-#include <ucontext.h>
-
#define MAX_BTSIZE 64
void backtrace_handler(int n, siginfo_t *ist, void *extra) {