3 # Copyright (C) Shirish A Kalele 2000
4 # Copyright (C) Gerald Carter 2004
6 # script for build solaris Samba package
9 INSTALL_BASE
=/opt
/samba
11 SBINPROS
="smbd nmbd winbindd swat"
12 BINPROGS
="findsmb nmblookup pdbedit rpcclient smbclient smbcquotas smbspool smbtar tdbbackup testparm wbinfo net ntlm_auth profiles smbcacls smbcontrol smbpasswd smbstatus smbtree tdbdump testprns"
13 MSGFILES
="de.msg en.msg fr.msg it.msg ja.msg nl.msg pl.msg tr.msg"
14 VFSLIBS
="audit.so default_quota.so extd_audit.so full_audit.so readonly.so shadow_copy.so cap.so expand_msdfs.so fake_perms.so netatalk.so recycle.so"
15 DATFILES
="lowcase.dat upcase.dat valid.dat"
16 CHARSETLIBS
="CP437.so CP850.so"
20 # Add the binaries, docs and SWAT files
21 cd $TMPINSTALLDIR/$INSTALL_BASE
23 echo "#\n# Server Binaries \n#"
24 for file in $SBINPROGS; do
25 echo f none sbin
/$file 0755 root other
28 echo "#\n# User Binaries \n#"
29 for file in $BINPROGS; do
30 echo f none bin
/$file 0755 root other
33 echo "#\n# Libraries\n#"
34 for file in $MSGFILES; do
35 echo f none lib
/$file 0644 root other
37 for file in $VFSLIBS; do
38 echo f none lib
/vfs
/$file 0755 root other
40 for file in $DATFILES; do
41 echo f none lib
/$file 0644 root other
43 for file in $CHARSETLIBS; do
44 echo f none lib
/charset
/$file 0755 root other
47 echo "#\n# libsmbclient\n#"
48 echo f none lib
/libsmbclient.so
0755 root other
49 echo f none include
/libsmbclient.h
0644 root other
51 echo "#\n# smbwrapper\n#"
52 echo f none lib
/smbwrapper.so
0755 root other
53 echo f none bin
/smbsh
0755 root other
55 echo "#\n# nss_winbind.so\n#"
56 echo f none
/usr
/lib
/nss_winbind.so
.1=lib
/libnss_winbind.so
0755 root other
57 echo s none
/lib
/nss_winbind.so
.1=..
/usr
/lib
/nss_winbind.so
.1 0755 root other
58 if [ -f lib
/pam_winbind.so
]; then
59 echo f none
/usr
/lib
/security
/pam_winbind.so
=lib
/pam_winbind.so
0755 root other
61 if [ -f lib
/pam_smbpass.so
]; then
62 echo f none
/usr
/lib
/security
/pam_pam_smbpass.so
=lib
/pam_winbind.so
0755 root other
66 echo "#\n# man pages \n#"
67 echo d none
/usr ? ? ?
68 echo d none
/usr
/share ? ? ?
69 echo d none
/usr
/share
/man ? ? ?
71 # Create directories for man page sections if nonexistent
73 for i
in 1 2 3 4 5 6 7 8 9; do
74 manpages
=`ls *.$i 2>/dev/null`
76 echo d none
/usr
/share
/man
/man
$i ? ? ?
77 for manpage
in $manpages; do
78 echo f none
/usr
/share
/man
/man
${i}/${manpage}=docs
/manpages
/$manpage 0644 root other
85 list
=`find swat -type d | grep -v "/.svn$"`
88 echo d none
$dir 0755 root other
92 list
=`find swat -type f | grep -v /.svn/`
95 echo f none
$file 0644 root other
99 # Create entries for docs for the beginner
100 echo s none docs
/using_samba
=$BASEDIR/swat
/help
/using_samba
101 for file in docs
/*pdf
; do
102 echo f none
$file 0644 root other
106 #####################################################################
108 #####################################################################
110 TMPINSTALLDIR
=$HOME/build
112 # Try to guess the distribution base..
114 DISTR_BASE
=`echo $CURR_DIR | sed 's|\(.*\)/packaging.*|\1|'`
115 echo "Assuming Samba distribution is rooted at $DISTR_BASE.."
118 ## first build the source
121 cd $DISTR_BASE/source
123 if [ "x$1" != "xnobuild" ]; then
124 .
/configure
--prefix=$INSTALL_DIR \
126 --with-included-popt \
128 --localstatedir=/var
/lib
/samba \
129 --with-piddir=/var
/run \
130 --with-logfilebase=/var
/log
/samba \
131 --with-privatedir=/etc
/samba
/private \
132 --with-configdir=/etc
/samba \
135 if [ $?
-ne 0 ]; then
136 echo "Build failed! Exiting...."
141 make DESTDIR
=$TMPINSTALLDIR install
144 ( cd $TMPINSTALLDIR; du
-a |
grep \.old$ |
awk '{print "rm -rf "$2}' | sh
)
148 ## Now get the install locations
150 SBINDIR
=`bin/smbd -b | grep SBINDIR | awk '{print $2}'`
151 BINDIR
=`bin/smbd -b | grep BINDIR | grep -v SBINDIR | awk '{print $2}'`
152 SWATDIR
=`bin/smbd -b | grep SWATDIR | awk '{print $2}'`
153 CONFIGFILE
=`bin/smbd -b | grep CONFIGFILE | awk '{print $2}'`
154 CONFIGDIR
=`dirname $CONFIGFILE`
155 LOGFILEBASE
=`bin/smbd -b | grep LOGFILEBASE | awk '{print $2}'`
156 LIBDIR
=`bin/smbd -b | grep LIBDIR | awk '{print $2}'`
157 PIDDIR
=`bin/smbd -b | grep PIDDIR | awk '{print $2}'`
158 PRIVATE_DIR
=`bin/smbd -b | grep PRIVATE_DIR | awk '{print $2}'`
159 DOCDIR
=$INSTALL_BASE/docs
162 ## copy some misc files that are ont done as part of 'make install'
164 cp -fp nsswitch
/libnss_winbind.so
$TMPINSTALLDIR/$LIBDIR/libnss_winbind.so
165 if [ -f nsswitch
/pam_winbind.so
]; then
166 cp -fp nsswitch
/pam_winbind.so
$TMPINSTALLDIR/$LIBDIR/pam_winbind.so
169 cp -p bin
/smbwrapper.so
$TMPINSTALLDIR/$INSTALL_BASE/lib
170 cp -p bin
/smbsh
$TMPINSTALLDIR/$INSTALL_BASE/bin
172 mkdir
-p $TMPINSTALLDIR/$INSTALL_BASE/docs
173 cp -p ..
/docs
/*pdf
$TMPINSTALLDIR/$INSTALL_BASE/docs
176 cd $DISTR_BASE/packaging
/Solaris
182 # Setup version from smbd -V
184 VERSION
=`$TMPINSTALLDIR/$SBINDIR/smbd -V | awk '{print $2}'`
185 sed -e "s|__VERSION__|$VERSION|" -e "s|__ARCH__|`uname -p`|" -e "s|__BASEDIR__|$INSTALL_BASE|g" pkginfo.master
> pkginfo
187 sed -e "s|__BASEDIR__|$INSTALL_BASE|g" inetd.conf.master
> inetd.conf
188 sed -e "s|__BASEDIR__|$INSTALL_BASE|g" samba.init.master
> samba.init
191 ## copy over some scripts need for packagaing
193 mkdir
-p $TMPINSTALLDIR/$INSTALL_BASE/scripts
194 for i
in inetd.conf samba.init smb.conf.default services
; do
195 cp -fp $i $TMPINSTALLDIR/$INSTALL_BASE/scripts
199 ## Start building the prototype file
201 echo "SBINDIR=sbin" >> pkginfo
202 echo "BINDIR=bin" >> pkginfo
203 echo "SWATDIR=swat" >> pkginfo
204 echo "CONFIGDIR=$CONFIGDIR" >> pkginfo
205 echo "LOGFILEBASE=$LOGFILEBASE" >> pkginfo
206 echo "LIBDIR=lib" >> pkginfo
207 echo "PIDDIR=$PIDDIR" >> pkginfo
208 echo "DOCDIR=docs" >> pkginfo
209 echo "PRIVATE_DIR=$PRIVATE_DIR" >> pkginfo
211 cp prototype.master prototype
213 # Add the dynamic part to the prototype file
214 (add_dynamic_entries
>> prototype
)
217 ## copy packaging files
219 for i
in prototype pkginfo copyright preremove postinstall request i.swat r.swat
; do
220 cp $i $TMPINSTALLDIR/$INSTALL_BASE
224 pkgmk
-o -d /tmp
-b $TMPINSTALLDIR/$INSTALL_BASE -f prototype
227 pkgtrans
/tmp samba.pkg samba
230 echo The samba package is
in /tmp