r3265: fix lmhosts lookup so that we don't say we found something when we really...
[Samba.git] / packaging / Solaris / makepkg.sh.tmpl
blob0d4dc02d1ce97675eab3d98dcc2dbf29cdb16e46
1 #!/bin/sh
3 # Copyright (C) Shirish A Kalele 2000
5 # Builds a Samba package from the samba distribution.
6 # By default, the package will be built to install samba in /usr/local
7 # Change the INSTALL_BASE variable to change this: will modify the pkginfo
8 # and samba.server files to point to the new INSTALL_BASE
10 INSTALL_BASE=/usr/local
12 add_dynamic_entries()
14 # Add the binaries, docs and SWAT files
16 echo "#\n# Binaries \n#"
17 cd $DISTR_BASE/source/bin
18 for binfile in *
20 if [ -f $binfile ]; then
21 case $file in
22 CP*.so)
23 echo echo f none samba/lib/charset/$binfile=source/bin/$binfile 0755 root other
26 echo f none samba/bin/$binfile=source/bin/$binfile 0755 root other
28 esac
30 done
32 # Add the scripts to bin/
33 echo "#\n# Scripts \n#"
34 cd $DISTR_BASE/source/script
35 for shfile in *
37 if [ -f $shfile ]; then
38 echo f none samba/bin/$shfile=source/script/$shfile 0755 root other
40 done
42 # add libraries to /lib for winbind
43 echo "#\n# Libraries \n#"
44 if [ -f $DISTR_BASE/source/nsswitch/libnss_winbind.so ] ; then
45 echo f none /usr/lib/libnss_winbind.so=source/nsswitch/libnss_winbind.so 0755 root other
46 echo s none /usr/lib/libnss_winbind.so.1=/usr/lib/libnss_winbind.so 0755 root other
47 echo s none /usr/lib/libnss_winbind.so.2=/usr/lib/libnss_winbind.so 0755 root other
48 echo s none /usr/lib/nss_winbind.so.1=/usr/lib/libnss_winbind.so 0755 root other
49 echo s none /usr/lib/nss_winbind.so.2=/usr/lib/libnss_winbind.so 0755 root other
52 # add pam_winbind module to /usr/lib/security
53 if [ -f $DISTR_BASE/source/nsswitch/pam_winbind.so ] ; then
54 echo f none /usr/lib/security/pam_winbind.so.1=source/nsswitch/pam_winbind.so 0755 root bin
55 echo s none /usr/lib/security/pam_winbind.so=/usr/lib/security/pam_winbind.so.1 0777 root root
58 # add the .dat codepages
59 echo "#\n# Codepages \n#"
60 for file in $DISTR_BASE/source/codepages/*.dat ; do
61 bfile=`basename $file`
62 echo f none /usr/local/samba/lib/$bfile=source/codepages/$bfile
63 done
65 # Add the manpages
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
72 cd $DISTR_BASE/docs/manpages
73 for i in 1 2 3 4 5 6 7 8 9
75 manpages=`ls *.$i 2>/dev/null`
76 if [ $? -eq 0 ]
77 then
78 echo d none /usr/share/man/man$i ? ? ?
79 for manpage in $manpages
81 echo f none /usr/share/man/man${i}/${manpage}=docs/manpages/$manpage 0644 root other
82 done
84 done
86 echo "#\n# HTML documentation \n#"
87 cd $DISTR_BASE
88 list=`find docs/htmldocs -type d | grep -v "/CVS$"`
89 for docdir in $list
91 if [ -d $docdir ]; then
92 echo d none samba/$docdir 0755 root other
94 done
96 list=`find docs/htmldocs -type f | grep -v /CVS/`
97 for htmldoc in $list
99 if [ -f $htmldoc ]; then
100 echo f none samba/$htmldoc=$htmldoc 0644 root other
102 done
104 # Create a symbolic link to the Samba book in docs/ for beginners
105 echo 's none samba/docs/samba_book=htmldocs/using_samba'
107 echo "#\n# SWAT \n#"
108 cd $DISTR_BASE
109 list=`find swat -type d | grep -v "/CVS$"`
110 for i in $list
112 echo "d none samba/$i 0755 root other"
113 done
114 list=`find swat -type f | grep -v /CVS/`
115 for i in $list
117 echo "f none samba/$i=$i 0644 root other"
118 done
119 # add the .msg files for SWAT
120 echo "#\n# msg files \n#"
121 for file in $DISTR_BASE/source/po/*.msg ; do
122 bfile=`basename $file`
123 echo f none /usr/local/samba/lib/$bfile=source/po/$bfile
124 done
126 echo "#\n# HTML documentation for SWAT\n#"
127 cd $DISTR_BASE/docs/htmldocs
128 for htmldoc in *
130 if [ -f $htmldoc ]; then
131 echo f none samba/swat/help/$htmldoc=docs/htmldocs/$htmldoc 0644 root other
133 done
135 echo "#\n# Using Samba Book files for SWAT\n#"
136 cd $DISTR_BASE/docs/htmldocs
138 # set up a symbolic link instead of duplicating the book tree
139 echo 's none samba/swat/using_samba=../docs/htmldocs/using_samba'
143 if [ $# = 0 ]
144 then
145 # Try to guess the distribution base..
146 CURR_DIR=`pwd`
147 DISTR_BASE=`echo $CURR_DIR | sed 's|\(.*\)/packaging.*|\1|'`
148 echo "Assuming Samba distribution is rooted at $DISTR_BASE.."
149 else
150 DISTR_BASE=$1
154 if [ ! -d $DISTR_BASE ]; then
155 echo "Source build directory $DISTR_BASE does not exist."
156 exit 1
159 # Set up the prototype file from prototype.master
160 if [ -f prototype ]; then
161 rm prototype
164 # Setup version from version.h
165 VERSION=PVERSION
166 sed -e "s|__VERSION__|$VERSION|" -e "s|__ARCH__|`uname -p`|" -e "s|__BASEDIR__|$INSTALL_BASE|g" pkginfo.master >pkginfo
168 sed -e "s|__BASEDIR__|$INSTALL_BASE|g" inetd.conf.master >inetd.conf
169 sed -e "s|__BASEDIR__|$INSTALL_BASE|g" samba.server.master >samba.server
171 cp prototype.master prototype
173 # Add the dynamic part to the prototype file
174 (add_dynamic_entries >> prototype)
176 # Create the package
177 pkgmk -o -d /tmp -b $DISTR_BASE -f prototype
178 if [ $? = 0 ]
179 then
180 pkgtrans /tmp samba.pkg samba
182 echo The samba package is in /tmp