81 lines
1.9 KiB
Text
81 lines
1.9 KiB
Text
|
#!/bin/sh -x
|
||
|
|
||
|
# variables
|
||
|
CWD=$(pwd)
|
||
|
|
||
|
PRGNAM=$(basename $CWD)
|
||
|
VERSION=${VERSION:-$(date +"%Y.%m.%d_%H.%M")}
|
||
|
ARCH=${ARCH:-$(uname -m)}
|
||
|
BUILD=1
|
||
|
|
||
|
TAG=cyco
|
||
|
TMP=/tmp/$TAG
|
||
|
PKG=$TMP/pkg-$PRGNAM
|
||
|
OUTPUT=/tmp
|
||
|
|
||
|
REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM
|
||
|
|
||
|
PREFIX=/usr
|
||
|
|
||
|
SLCKFLAGS=" -O "
|
||
|
|
||
|
# nettoyage préalable
|
||
|
rm -fr $PKG $TMP/$PRGNAM
|
||
|
|
||
|
mkdir -p $PKG
|
||
|
|
||
|
# mise en place
|
||
|
cd $TMP
|
||
|
if [ ! -e $REPOSITORY ]; then
|
||
|
git clone http://git.zx2c4.com/password-store $REPOSITORY
|
||
|
else
|
||
|
( cd $REPOSITORY
|
||
|
git pull
|
||
|
)
|
||
|
fi
|
||
|
cp -R $REPOSITORY $TMP/$PRGNAM
|
||
|
|
||
|
cd $TMP/$PRGNAM
|
||
|
|
||
|
# installation
|
||
|
make install DESTDIR=$PKG
|
||
|
mv $PKG$PREFIX/share/man $PKG$PREFIX/
|
||
|
rm -fr $PKG$PREFIX/share
|
||
|
mkdir -p $PKG$PREFIX/doc/$PRGNAM/
|
||
|
cp -r COPYING INSTALL README contrib/ $PKG$PREFIX/doc/$PRGNAM/
|
||
|
|
||
|
# correction
|
||
|
cd $PKG
|
||
|
chown -R root:root *
|
||
|
|
||
|
find $PKG -name \.git\* -exec rm -fr {} \;
|
||
|
|
||
|
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
|
||
|
|
||
|
# Strip binaries
|
||
|
( cd $PKG
|
||
|
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
||
|
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
||
|
)
|
||
|
|
||
|
|
||
|
# embaumement
|
||
|
mkdir -p $PKG/install
|
||
|
cat <<EOF > $PKG/install/slack-desc
|
||
|
$PRGNAM: $PRGNAM (the standard unix password manager)
|
||
|
$PRGNAM:
|
||
|
$PRGNAM: Password management should be simple and follow Unix philosophy. With pass,
|
||
|
$PRGNAM: each password lives inside of a gpg encrypted file whose filename is the
|
||
|
$PRGNAM: title of the website or resource that requires the password. These encrypted
|
||
|
$PRGNAM: files may be organized into meaningful folder hierarchies, copied from
|
||
|
$PRGNAM: computer to computer, and, in general, manipulated using standard command
|
||
|
$PRGNAM: line file management utilities.
|
||
|
$PRGNAM:
|
||
|
$PRGNAM: http://zx2c4.com/projects/password-store/
|
||
|
$PRGNAM:
|
||
|
EOF
|
||
|
|
||
|
# empaquetage
|
||
|
cd $PKG
|
||
|
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz
|