usr/src/cmd/samba/install-sfw
author Jon Tibble <meths@btinternet.com>
Mon, 04 May 2015 14:04:39 +0100
branchoi_151a
changeset 254 9c2a4ac793f0
parent 42 b6f829cb6d9e
permissions -rw-r--r--
Bash patch catchup including shellshock

#!/bin/sh
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
#
#ident	"@(#)install-sfw	1.36	10/08/05 SMI"

set -e

TOP=`pwd`
PREFIX=${ROOT}/usr
PAMDIR=${ROOT}/usr/lib/security
PAMDIR64=${ROOT}/usr/lib/security/${MACH64}
BINDIR=${PREFIX}/bin
SBINDIR=${PREFIX}/sbin
LIBDIR=${PREFIX}/lib
LIBDIR64=${PREFIX}/lib/${MACH64}
SAMBALIBDIR=${PREFIX}/lib/samba
SAMBALIBDIR64=${PREFIX}/lib/samba/${MACH64}
INCLUDEDIR=${PREFIX}/include/samba
SFWINCLUDEDIR=${PREFIX}/sfw/include
SFWLIBDIR=${PREFIX}/sfw/lib
VARDIR=${ROOT}/var/samba
SHAREDIR=${PREFIX}/share
MANDIR=${SHAREDIR}/man
MAN1DIR=${SHAREDIR}/man/man1
MAN4DIR=${SHAREDIR}/man/man4
MAN5DIR=${SHAREDIR}/man/man5
MAN1MDIR=${SHAREDIR}/man/man1m
SWATDIR=${PREFIX}/share/samba/swat
CODEPAGEDIR=${SAMBALIBDIR}/codepages
ETC=${ROOT}/etc
ETCSMBDIR=${ETC}/samba

. ${SRC}/tools/install.subr

MANSCRIPT=${TOP}/sunman-stability

# profiles already does exist in Solaris, we have to rename (see PSARC/2009/682)
mv -f ${BINDIR}/profiles ${BINDIR}/smbprofiles

# smbtorture
cd ${TOP}/${VER}/source3/bin
_install E smbtorture ${SAMBALIBDIR}/smbtorture 755

# Samba 64 bit shared libraries
cd ${TOP}/${VER64}/source3/bin
${SRC}/tools/install-proto -d -m 0755 ${SAMBALIBDIR64}
_install D libtalloc.so ${SAMBALIBDIR64}/libtalloc.so.1 555
_install L libtalloc.so.1 ${SAMBALIBDIR64}/libtalloc.so
_install D libtdb.so ${SAMBALIBDIR64}/libtdb.so.1 555
_install L libtdb.so.1 ${SAMBALIBDIR64}/libtdb.so
_install D libwbclient.so ${SAMBALIBDIR64}/libwbclient.so.0 555
_install L libwbclient.so.0 ${SAMBALIBDIR64}/libwbclient.so

# Samba PAM module(s)
${SRC}/tools/install-proto -d -m 0755 ${PAMDIR}
cd ${TOP}/${VER}/source3/bin
_install D pam_winbind.so ${PAMDIR}/pam_winbind.so.1 555
_install L pam_winbind.so.1 ${PAMDIR}/pam_winbind.so
${SRC}/tools/install-proto -d -m 0755 ${PAMDIR64}
cd ${TOP}/${VER64}/source3/bin
_install D pam_winbind.so ${PAMDIR64}/pam_winbind.so.1 555
_install L pam_winbind.so.1 ${PAMDIR64}/pam_winbind.so

# Samba nsswitch modules
cd ${TOP}/${VER}/nsswitch
_install D libnss_wins.so ${LIBDIR}/nss_wins.so.1 555
_install D libnss_winbind.so ${LIBDIR}/nss_winbind.so.1 555
_install L nss_wins.so.1 ${LIBDIR}/nss_wins.so
_install L nss_winbind.so.1 ${LIBDIR}/nss_winbind.so

${SRC}/tools/install-proto -d -m 0755 ${LIBDIR64}
cd ${TOP}/${VER64}/nsswitch
_install D libnss_wins.so ${LIBDIR64}/nss_wins.so.1 555
_install D libnss_winbind.so ${LIBDIR64}/nss_winbind.so.1 555
_install L nss_wins.so.1 ${LIBDIR64}/nss_wins.so
_install L nss_winbind.so.1 ${LIBDIR64}/nss_winbind.so


# header files deployment - used by other packages built:
${SRC}/tools/install-proto -d -m 0755 ${INCLUDEDIR}
cd ${INCLUDEDIR}
mv -f ../libsmbclient.h ../netapi.h ../smb_share_modes.h \
      ../talloc.h ../tdb.h ../wbclient.h ../wbc_async.h .

################################################################################
# Application released under GPLv2 can not link GPLv3 libraries so the original
# libsmbclient API from samba 3.0.x released under the GPLv2 should be provided
# for such apps.
# Currently only JDS part called gnome-VFS is using libsmbclient under the
# LSARC/2006/350/commitment.materials/materials/contracts/PSARC-2000-488-samba.txt
#
cd ${TOP}/${VER30}/source
_install N include/libsmbclient.h ${SFWINCLUDEDIR}/libsmbclient.h 444
_install D bin/libsmbclient.so ${SFWLIBDIR}/libsmbclient.so.0 555
_install L libsmbclient.so.0 ${SFWLIBDIR}/libsmbclient.so
################################################################################

cd ${TOP}

# deliver the service files

# Modify smb.conf.default as smb.conf-example for Solaris use.
rm -f ${ETCSMBDIR}/smb.conf-example
sed -f Solaris/smbconf.sed ${VER}/examples/smb.conf.default \
	> ${ETCSMBDIR}/smb.conf-example
chmod 444 ${ETCSMBDIR}/smb.conf-example

# deliver the pam.conf-winbind configuration template
_install N Solaris/pam.conf-winbind ${ROOT}/etc/pam.conf-winbind 444

# install smf manifests
_install N Solaris/wins.xml ${ROOT}/lib/svc/manifest/network/wins.xml 444
_install N Solaris/samba.xml ${ROOT}/lib/svc/manifest/network/samba.xml 444
_install N Solaris/swat.xml ${ROOT}/lib/svc/manifest/network/swat.xml 444
_install N Solaris/winbind.xml ${ROOT}/lib/svc/manifest/network/winbind.xml 444


################################################################################
# Man pages
################################################################################

(
	cd ${VER}/docs-xml/output/manpages-3

	for i in *.1
	do
		case "$i" in
			profiles.1)
				# Name clash
				_install M ${i} ${MAN1DIR}/smb${i} 444
				;;
			*)
				_install M ${i} ${MAN1DIR}/${i} 444
				;;
		esac
	done

	# *.7 go to section .5 "facilities"
	for i in *.7
	do
		base=`basename $i 7`
		manpage=${base}5
		_install M ${i} ${MAN5DIR}/${manpage} 444
	done


	# Section 5 of the Solaris man pages is normally reserved for
	# "Standards, Environments, and Macros".  Therefore, any man
	# pages describing "File Formats" should be moved to section 4
	# as per project requirements described in PSARC/2000/488.
	for i in *.5
	do
		base=`basename $i 5`
		manpage=${base}4
		_install M ${i} ${MAN4DIR}/${manpage} 444
	done

	# *.8 goes to section 1m
	for i in *.8
	do
		case "$i" in
			mount.cifs.8 | umount.cifs.8 )
				echo Not installing $i
				;;
			smbd.8)
				# Name clash
				base=`basename $i 8`
				manpage=${base}1m
				_install M ${i} ${MAN1MDIR}/smb${manpage} 444
				;;
			*)
				base=`basename $i 8`
				manpage=${base}1m
				_install M ${i} ${MAN1MDIR}/${manpage} 444
				;;
		esac
	done
)

exit 0