wok-next view samba/receipt @ rev 20274

remove samba-pam (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Nov 08 10:13:28 2017 +0100 (2017-11-08)
parents 81ae85517a60
children db29d0888402
line source
1 # SliTaz package receipt v2.
3 PACKAGE="samba"
4 VERSION="4.6.7"
5 CATEGORY="system-tools"
6 SHORT_DESC="File and print services with SMB/CIFS"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL3"
9 WEB_SITE="https://www.samba.org/"
10 BUGS="Open directory needs MIT kerberos support (krb5)"
11 COOKOPTS="!menus"
13 TARBALL="$PACKAGE-$VERSION.tar.gz"
14 WGET_URL="https://download.samba.org/pub/samba/stable/$TARBALL"
16 BUILD_DEPENDS="python-dev perl acl-dev docbook-xsl openldap-dev \
17 gnutls-dev krb5-dev cyrus-sasl-dev zlib-dev popt-dev libtdb-dev talloc-dev \
18 libgcrypt-dev nss-dev cups-dev dbus-dev pam pam-dev"
19 SPLIT="samba samba-pam samba-dev" # TODO: swat
21 version() {
22 wget -O- -q https://download.samba.org/pub/samba/ | \
23 sed '/LATEST-IS-SAMBA/!d; s|.*SAMBA-\([^<]*\).*|\1|'
24 }
26 # Rules to configure and make the package.
27 compile_rules()
28 {
29 # http://www.linuxfromscratch.org/blfs/view/stable/basicnet/samba.html
31 cp -a $src $src-pam
32 ./configure \
33 --prefix=/usr \
34 --sysconfdir=/etc \
35 --localstatedir=/var \
36 --with-piddir=/run/samba \
37 --with-pammodulesdir=/lib/security \
38 --enable-fhs \
39 --without-pam \
40 --without-ad-dc \
41 --without-systemd \
42 --enable-selftest \
43 $CONFIGURE_ARGS &&
44 make && make install || return 1
46 cd $src-pam
47 ./configure \
48 --prefix=/usr \
49 --sysconfdir=/etc \
50 --localstatedir=/var \
51 --with-piddir=/run/samba \
52 --with-pammodulesdir=/lib/security \
53 --enable-fhs \
54 --with-pam \
55 --without-ad-dc \
56 --without-systemd \
57 --enable-selftest \
58 $CONFIGURE_ARGS &&
59 make && make DESTDIR=install-pam || return 1
61 for inst in $install $install-pam ; do
62 mkdir -p $inst/lib
63 mv $inst/usr/lib/libnss_wins.so* $inst/usr/lib/libnss_winbind.so* \
64 $inst/lib
65 ln -sf ../../lib/libnss_winbind.so.2 $inst/usr/lib/libnss_winbind.so
66 ln -sf ../../lib/libnss_wins.so.2 $inst/usr/lib/libnss_wins.so
68 install -m644 examples/smb.conf.default $inst/etc/samba
70 mkdir -pv $inst/etc/openldap/schema
71 cp examples/LDAP/README $inst/etc/openldap/schema/README.LDAP
72 cp examples/LDAP/samba* $inst/etc/openldap/schema
73 cp -r examples/LDAP/get* examples/LDAP/ol* $inst/etc/openldap/schema
75 cp -a $stuff/etc $inst
77 # Symlink smbspool to cups backend
78 mkdir -p $inst/usr/lib/cups/backend
79 ln -sf /usr/bin/smbspool $inst/usr/lib/cups/backend/smb
81 # for swat package
82 # icodir="$inst/usr/share/icons/hicolor/48x48/apps"
83 # mkdir -p $icodir
84 # cp $stuff/swat.png $icodir
86 chown -R root:root $inst
87 done
88 }
90 # Rules to gen a SliTaz package suitable for Tazpkg.
91 genpkg_rules()
92 {
93 # Note, packages samba-common, smbclient was removed due to circular dependencies:
94 # smbclient <--> samba <--> samba-common
95 case $PACKAGE in
96 # smbclient)
97 # copy smbclient smbspool smbget smbtree smbcacls smbcquotas smbtar \
98 # rpcclient net nmblookup libnetapi.so* libsmbclient.so* smb
99 # CAT="network|client"
100 # DEPENDS="samba libldap libtdb popt talloc"
101 # ;;
102 # swat)
103 # copy swat/ swat.desktop swat.png
104 # CAT="development|Samba Web Administration Tool"
105 # DEPENDS="samba"
106 # ;;
107 samba)
108 copy @std
109 # remove_already_packed
110 DEPENDS="acl attr dbus libcups libgnutls libldap libtdb ncurses \
111 ncurses-libform ncurses-libpanel perl popt python talloc \
112 talloc-python zlib"
113 PROVIDE="samba-common smbclient"
114 TAZPANEL_DAEMON="man|edit::/etc/samba/smb.conf|web::$WEB_SITE"
115 CONFIG_FILES="/etc/samba/smb.conf"
116 ;;
117 samba-dev)
118 install=$install-pam copy @std
119 # remove by hand already packed files...
120 DEPENDS="acl attr dbus libcups libgnutls libldap libtdb ncurses \
121 ncurses-libform ncurses-libpanel perl popt python talloc \
122 talloc-python zlib pam"
123 PROVIDE="samba:pam samba-common smbclient"
124 TAZPANEL_DAEMON="man::samba|edit::/etc/samba/smb.conf|web::$WEB_SITE"
125 CONFIG_FILES="/etc/samba/smb.conf"
126 ;;
127 *-dev)
128 copy @dev
129 DEPENDS="samba talloc-dev"
130 ;;
131 esac
132 }
134 # Pre and post install commands for Tazpkg.
135 post_install_samba() {
136 [ -n "$quiet" ] || cat <<EOT
138 .----------------------------------------------------.
139 | The main configuration file is /etc/samba/smb.conf |
140 |----------------------------------------------------|
141 | To start samba server you can run: |
142 | /etc/init.d/samba start |
143 | |
144 | Or add samba to RUN_DAEMONS in /etc/rcS.conf |
145 '----------------------------------------------------'
146 EOT
147 }
149 post_install_swat() {
150 [ -f "$1/etc/lighttpd/lighttpd.conf" ] || return
152 [ ! grep -q /usr/share/samba/swat/ "$1/etc/lighttpd/lighttpd.conf" ] || return
154 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/swat/" => "/usr/share/samba/swat/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
156 [ -z "$1" ] || return
157 # Start Web server.
158 /etc/init.d/lighttpd stop
159 /etc/init.d/lighttpd start
160 }