summaryrefslogtreecommitdiffstats
path: root/redhat/build/get_rpm_package_name.sh
blob: 0ccdfa0366f4528cc40a1f99af4cbc38f164509e (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
#!/bin/bash

# Gets the RPM package name from the component name.
# This is useful because some RPM packages do not have prefix "trinity"
# while others do.
#
# E.g :
#  trinity-qt3 => qt3
#  trinity-tdelibs => trinity-tdelibs


PKGCATEGORY="${1%%/*}"
PKGNAME="${1##*/}"
DEVEL="$2"

# Some RPM packages have different name than the source tarball.
# Language package: install only French language package
case "${PKGNAME}" in
  "k3b-i18n"|"koffice-i18n"|"tde-i18n") PKGNAME="${PKGNAME}-French";;
  "koffice") PKGNAME="${PKGNAME}-suite";;
  "tqt3") PKGNAME="libtqt3-mt";;
  "tqtinterface") PKGNAME="libtqt4";;
  "avahi-tqt") PKGNAME="libavahi-tqt";;
  "dbus-tqt") PKGNAME="libdbus-tqt-1";;
  "dbus-1-tqt") PKGNAME="libdbus-1-tqt";;
  "libart-lgpl") PKGNAME="libart_lgpl_2-2";;
esac

# Use the Trinity Prefix, or not.
case "${PKGNAME}" in
  "trinity-"*|"qt3"|"python-qt3"|"esound"|"lib"*) PREFIX="";;
  "autoconf"|"automake"|"cmake"|"gnuchess"|"htdig"|"imlib1"|"libotr3"|"libtool"|"lilypond"|"m4"|"mftrace"|"pcsc-perl"|"torsocks"|"wv2") PREFIX="";;
  "curl") PREFIX="trinity-lib";;
  *) PREFIX="trinity-";;
esac

echo "${PREFIX}${PKGNAME}"

if [ -n "${DEVEL}" ]; then
  # Check if development package is required.
  # Applications do NOT have development packages, except K3B
  case "${PKGCATEGORY}" in
    "applications") if [ "${PKGNAME}" != "k3b" ]; then exit 0; fi;;
    "extras") if [ "${PKGNAME}" != "akode" ]; then exit 0; fi;;
  esac
  # Other packags NOT having development package
  case "${PKGNAME}" in
    "hal-info"|"lilypond"|"mftrace"|"pcsc-perl"|"torsocks") exit 0;;
    "tqca-tls"|"tdeadmin"|"tdetoys"|"tde-i18n"*|"tdeaddons"|"tdeartwork"|"libtqt-perl") exit 0;;
  esac
  
  echo "${PREFIX}${PKGNAME}-devel"
fi