1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../jabberd/jabberd.conf
5 # Copyright (C) 2004 - 2005 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; version 2 of the License. A copy of the
12 # GNU General Public License can be found in the file COPYING.
13 # --- T2-COPYRIGHT-NOTE-END ---
15 # Unfortunately jabberd uses different package names for the same
16 # packages. So we need a way to convert T2 package names to jabberd
17 # package names. Just pass the T2 package name and the jabberd
18 # packaage name will be returned.
19 get_jabberd_package_name() {
21 postgresql) echo "pgsql" ;;
23 openldap) echo "ldap" ;;
24 openssl) echo "ssl" ;;
30 # Jabber wants its own directory with the proper group rights.
34 extraincdir="$(pkgprefix includedir glibc)"
35 extralibdir="$(pkgprefix libdir glibc)"
37 # Add support for the following packages if they are available.
38 for pkgname in openssl libidn postgresql mysql bdb pam openldap; do
39 # unfortunately the configure option sometimes uses different names.
40 confpkgname=$(get_jabberd_package_name $pkgname)
41 # Is this package available?
42 if pkginstalled $pkgname; then
43 # Yuck, mysql header files and libs can not be found in the
44 # normal include and lib dir, but in include dir / mysql.
45 include_dir=$(pkgprefix includedir $pkgname)
46 library_dir=$(pkgprefix libdir $pkgname)
47 if [ "$pkgname" == mysql ]; then
48 include_dir="$include_dir/mysql"
49 library_dir="$library_dir/mysql"
52 # Include this package properly in the configure options.
53 var_append extraconfopt " " "--enable-$confpkgname"
54 var_append extraincdir ":" "$include_dir"
55 var_append extralibdir ":" "$library_dir"
57 var_append extraconfopt " " "--disable-$confpkgname"
61 # Add additional include dirs if available.
62 if [ -n $extraincdir ]; then
63 # Now add the extra include dirs to the configure options.
64 var_append extraconfopt " " "--with-extra_include_path=$extraincdir"
67 # Same for additional library dirs.
68 if [ -n $extralibdir ]; then
69 # Now add the extra library dirs to the configure options.
70 var_append extraconfopt " " "--with-extra_library_path=$extralibdir"
74 # Make sure the prefix directory has the proper access rights.
75 chgrp jabber $root/$prefix
76 chmod a+rx,g+ws $root/$prefix
78 # Also ensure the state dir has the proper access rights.
79 chgrp jabber $localstatedir
80 chmod a+rx,g+ws $localstatedir
83 hook_add preconf 5 "jabber_preconf"