summaryrefslogtreecommitdiffstats
path: root/psi/build/psi-lang.SlackBuild
blob: 7f4c2842417110ce02a4a9d24a610ef76007fbc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/sh
# Copyright (c) 2006 Eric Hameleers <alien@slackware.com>
# Distributed under the terms of the GNU General Public License, Version 2
# $Id$
# -----------------------------------------------------------------------------
#
# Slackware SlackBuild script 
# ===========================
# By:        Eric Hameleers <alien@slackware.com>
# For:       psi-lang
# URL:       http://psi-im.org/
# Needs:     psi
# 0.10-1:    13/jan/2006 by Eric Hameleers <alien@slackware.com>
#            * The final 0.10 release is here (including laguage packs).
# 
# Run 'sh SlackBuild --cleanup' to build a Slackware package.
# The package (.tgz) plus descriptive .txt file are created in /tmp .
# Install using 'installpkg'. 
#
# -----------------------------------------------------------------------------

# --- INIT ---
# Set initial variables:
CWD=`pwd`
if [ "$TMP" = "" ]; then
  TMP=/tmp
fi

PRGNAM=psi-lang
VERSION=0.10
ARCH=noarch
BUILD=1

PKG=$TMP/package-$PRGNAM

if [ ! -d $TMP/tmp-$PRGNAM ]; then
  mkdir -p $TMP/tmp-$PRGNAM # location to build the source
fi
if [ ! -d $PKG ]; then
  mkdir -p $PKG # place for the package to be built
fi

LANG="es eo fr hu nl pl pt_BR sl vi bg mk"
for NN in $LANG; do
  if ! [ -f psi_${NN}.qm ]; then
    echo "Getting language pack '$NN' for $PRGNAM - version ${VERSION}"
    URL="http://psi-im.org/files/translation/${VERSION}/psi_${NN}.qm"
    wget -nv "$URL"
  fi
done


# --- PACKAGE BUILDING ---

echo "++"
echo "|| $PRGNAM-$VERSION"
echo "++"

# Separate package "psi-lang" for the language translation files

rm -rf $PKG/*

# Add some translations
mkdir -p ${PKG}/usr/share/psi
cp $CWD/psi_*.qm ${PKG}/usr/share/psi/


# --- OWNERSHIP, RIGHTS ---

chown -R root:root $PKG
chmod -R o-w $PKG


# --- PACKAGE DESCRIPTION ---

mkdir -p ${PKG}/install
cat <<-ENDDESC > ${PKG}/install/slack-desc
	# HOW TO EDIT THIS FILE:
	# The "handy ruler" below makes it easier to edit a package description.  Line
	# up the first '|' above the ':' following the base package name, and the '|'
	# on the right side marks the last column you can put a character in.  You must
	# make exactly 11 lines for the formatting to be correct.  It's also
	# customary to leave one space after the ':'.
	        |-----handy-ruler------------------------------------------------------|
	psi-lang: psi-lang (Language pack for Psi)
	psi-lang:
	psi-lang: Psi is a multi-platform Jabber client.
	psi-lang: This package adds several translations as a package to the Psi
	psi-lang: installation (release ${VERSION})
	psi-lang: Available are: ${LANG}
	psi-lang:
	psi-lang:
	psi-lang:
	psi-lang: Homepage is http://psi-im.org/
	psi-lang:
	ENDDESC


# --- MAKE PACKAGE ---

cd ${PKG}
makepkg --linkadd y --chown n $TMP/${PRGNAM}-$VERSION-noarch-$BUILD.tgz \
  2>&1 | tee $CWD/makepkg-${PRGNAM}.log
(cd $TMP && md5sum ${PRGNAM}-$VERSION-noarch-$BUILD.tgz > ${PRGNAM}-$VERSION-noarch-$BUILD.tgz.md5)
cat install/slack-desc | grep "^${PRGNAM}" > $TMP/${PRGNAM}-$VERSION-noarch-$BUILD.txt


# --- CLEANUP ---

# Clean up the extra stuff:
if [ "$1" = "--cleanup" ]; then
  rm -rf $TMP/tmp-$PRGNAM
  rm -rf $PKG
fi