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
14 # First build the codepages and append codepage entries to prototype
15 echo "#\n# Codepages \n#"
16 echo d none samba/lib/codepages 0755 root other
18 CODEPAGELIST="437 737 850 852 861 932 866 949 950 936"
19 # Check if make_smbcodepage exists
20 if [ ! -f $DISTR_BASE/source/bin/make_smbcodepage ]; then
21 echo "Could not find $DISTR_BASE/source/bin/make_smbcodepage to generate codepages.\n\
22 Please create the binaries before packaging." >&2
26 for p in $CODEPAGELIST; do
27 $DISTR_BASE/source/bin/make_smbcodepage c $p $DISTR_BASE/source/codepages/codepage_def.$p $DISTR_BASE/source/codepages/codepage.$p
28 echo f none samba/lib/codepages/codepage.$p=source/codepages/codepage.$p 0644 root other
31 # Add the binaries, docs and SWAT files
33 echo "#\n# Binaries \n#"
34 cd $DISTR_BASE/source/bin
37 if [ -f $binfile ]; then
38 echo f none samba/bin/$binfile=source/bin/$binfile 0755 root other
41 echo "#\n# HTML documentation \n#"
42 echo d none samba/docs/htmldocs 0755 root other
43 cd $DISTR_BASE/docs/htmldocs
46 if [ -f $htmldoc ]; then
47 echo f none samba/docs/htmldocs/$htmldoc=docs/htmldocs/$htmldoc 0644 root other
50 echo "#\n# Text Docs \n#"
51 echo d none samba/docs/textdocs 0755 root other
52 cd $DISTR_BASE/docs/textdocs
55 if [ -f $textdoc ]; then
56 echo f none samba/docs/textdocs/$textdoc=docs/textdocs/$textdoc 0644 root other
61 list=`find swat -type d`
64 echo "d none samba/$i 0755 root other"
66 list=`find swat -type f`
69 echo "f none samba/$i=$i 0644 root other"
71 echo "#\n# HTML documentation for SWAT\n#"
72 cd $DISTR_BASE/docs/htmldocs
75 if [ -f $htmldoc ]; then
76 echo f none samba/swat/help/$htmldoc=docs/htmldocs/$htmldoc 0644 root other
84 # Try to guess the distribution base..
86 DISTR_BASE=`echo $CURR_DIR | sed 's|\(.*\)/packaging.*|\1|'`
87 echo "Assuming Samba distribution is rooted at $DISTR_BASE.."
93 if [ ! -d $DISTR_BASE ]; then
94 echo "Source build directory $DISTR_BASE does not exist."
98 # Set up the prototype file from prototype.master
99 if [ -f prototype ]; then
103 # Setup version from version.h
104 VERSION=`sed 's/#define VERSION \"\(.*\)\"$/\1/' ../../source/include/version.h`
105 sed -e "s|__VERSION__|$VERSION|" -e "s|__ARCH__|`uname -p`|" -e "s|__BASEDIR__|$INSTALL_BASE|g" pkginfo.master >pkginfo
107 sed -e "s|__BASEDIR__|$INSTALL_BASE|g" inetd.conf.master >inetd.conf
108 sed -e "s|__BASEDIR__|$INSTALL_BASE|g" samba.server.master >samba.server
110 cp prototype.master prototype
112 # Add the dynamic part to the prototype file
113 (add_dynamic_entries >> prototype)
116 pkgmk -o -d /tmp -b $DISTR_BASE -f prototype
119 pkgtrans /tmp samba.pkg samba
121 echo The samba package is in /tmp