aboutsummaryrefslogtreecommitdiff
path: root/network_daemons/samba/samba.build
blob: 5ac1677547fe5d1ea7fe4ba1ec09482e2fc4ce16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
#!/bin/bash

source /usr/src/ports/Build/build.sh

PACKAGER="Witukind <witukind@nsbm.kicks-ass.org>"
ARCH=i586
BUILD=1

# Sources
SRCNAME[0]=samba
SRCVER[0]=3.0.26a
SRCREP[0]=http://www.samba.org/samba/ftp
SRCPKG[0]=${SRCNAME[0]}-${SRCVER[0]}.tar.gz
SRCROOT[0]=${SRCNAME[0]}-${SRCVER[0]}

# Packages
PKGNAME[0]=${SRCNAME[0]}_server
PKGVER[0]=${SRCVER[0]}
PKGARCH[0]=${ARCH}
PKGOPTS[0]="nodocdir"

PKGNAME[1]=${SRCNAME[0]}_client
PKGVER[1]=${SRCVER[0]}
PKGARCH[1]=${ARCH}
PKGOPTS[1]="nodocdir"

PKGNAME[2]=${SRCNAME[0]}_lib
PKGVER[2]=${SRCVER[0]}
PKGARCH[2]=${ARCH}
PKGOPTS[2]="nodocdir"

PKGNAME[3]=${SRCNAME[0]}_dev
PKGVER[3]=${SRCVER[0]}
PKGARCH[3]=${ARCH}
PKGOPTS[3]="nodocdir"

PKGNAME[4]=swat
PKGVER[4]=${SRCVER[0]}
PKGARCH[4]=${ARCH}
PKGOPTS[4]="nodocdir"

begin

(
  cd ${SRC[0]}/source
  CFLAGS=${DISTFLAGS} CXXFLAGS=${DISTFLAGS} \
   ./configure \
   --enable-static=no \
   --enable-shared=yes \
   --prefix=/usr \
   --mandir=/usr/man \
   --sysconfdir=/etc \
   --localstatedir=/var \
   --libdir=/usr/lib \
   --libexecdir=/usr/libexec \
   --bindir=/usr/bin \
   --sbindir=/usr/sbin \
   --with-lockdir=/var/cache/samba \
   --with-configdir=/etc/samba \
   --with-privatedir=/etc/samba/private \
   --with-swatdir=/srv/www/swat \
   --enable-cups \
   --with-fhs \
   --with-acl-support=yes \
   --with-automount \
   --with-smbmount \
   --with-quotas \
   --with-syslog \
   --with-utmp \
   --with-libsmbclient \
   --with-winbind \
   --with-ldap \
   $ARCH-pc-linux-gnu
  make
  make install DESTDIR=${PKG[0]}

  cd ..

  mv \
   ${PKG[0]}/usr/share/man \
   ${PKG[0]}/usr

  mkdir -p \
   ${PKG[4]}/usr/{sbin,man/man8} \
   ${PKG[3]}/usr/include \
   ${PKG[2]}/{lib,usr/lib,usr/man/man7} \
   ${PKG[1]}/usr/{bin,sbin,man/{man1,man5,man8}} \
   ${PKG[0]}/etc/{rc.d,samba/private} \
   ${PKG[0]}/{lib,var/{spool/samba,cache/samba,log/samba}}

  # samba_server
  install -m0640 ${SRC[0]}/heimdal/smb.conf.default \
   ${PKG[0]}/etc/samba
  install -m0644 ${SRC[0]}/heimdal/rc.samba \
   ${PKG[0]}/etc/rc.d

  rm -f \
   ${PKG[0]}/usr/man/man7/pam_winbind.7

  rmdir \
   ${PKG[0]}/usr/share \
   ${PKG[0]}/lib \
   ${PKG[0]}/var/run \

  # samba_client
  mv \
   ${PKG[0]}/usr/sbin/umount.cifs \
   ${PKG[0]}/usr/sbin/mount.cifs \
   ${PKG[1]}/usr/sbin

  mv \
   ${PKG[0]}/usr/man/man8/umount.cifs.8 \
   ${PKG[0]}/usr/man/man8/mount.cifs.8 \
   ${PKG[1]}/usr/man/man8

  mv \
   ${PKG[0]}/usr/bin/smbmount \
   ${PKG[0]}/usr/bin/smbumount \
   ${PKG[0]}/usr/bin/smbmnt \
   ${PKG[0]}/usr/bin/rpcclient \
   ${PKG[1]}/usr/sbin

  mv \
   ${PKG[0]}/usr/man/man8/smbmount.8 \
   ${PKG[0]}/usr/man/man8/smbumount.8 \
   ${PKG[0]}/usr/man/man8/smbmnt.8 \
   ${PKG[0]}/usr/man/man8/rpcclient.8 \
   ${PKG[1]}/usr/man/man8

  mv \
   ${PKG[0]}/usr/bin/smbtree \
   ${PKG[0]}/usr/bin/smbtar \
   ${PKG[0]}/usr/bin/smbget \
   ${PKG[0]}/usr/bin/smbspool \
   ${PKG[0]}/usr/bin/smbcacls \
   ${PKG[0]}/usr/bin/smbcquotas \
   ${PKG[0]}/usr/bin/smbclient \
   ${PKG[0]}/usr/bin/findsmb \
   ${PKG[1]}/usr/bin

  mv \
   ${PKG[0]}/usr/man/man1/smbtree.1 \
   ${PKG[0]}/usr/man/man1/smbtar.1 \
   ${PKG[0]}/usr/man/man1/smbget.1 \
   ${PKG[0]}/usr/man/man1/smbcacls.1 \
   ${PKG[0]}/usr/man/man1/smbcquotas.1 \
   ${PKG[0]}/usr/man/man1/smbclient.1 \
   ${PKG[0]}/usr/man/man1/findsmb.1 \
   ${PKG[1]}/usr/man/man1

  mv \
   ${PKG[0]}/usr/man/man8/smbspool.8 \
   ${PKG[1]}/usr/man/man1/smbspool.1

  mv \
   ${PKG[0]}/usr/man/man5/smbgetrc.5 \
   ${PKG[1]}/usr/man/man5

  # samba_lib

  mv \
   ${PKG[0]}/usr/libexec/samba/libsmbclient.so \
   ${PKG[2]}/usr/lib/libsmbclient.so.0.0

  (
    cd ${PKG[2]}/usr/lib/samba
    rm -f libsmbclient.a
    ln -sf /usr/lib/libsmbclient.so.0.0 libsmbclient.so
    cd ${PKG[2]}/usr/lib
    rm -f libsmbclient.so.0 libsmbclient.so libsmbclient.a
    ln -sf libsmbclient.so.0.0 libsmbclient.so.0
    ln -sf libsmbclient.so.0.0 libsmbclient.so
  )

  cp -a \
   ${SRC[0]}/source/nsswitch/libnss_winbind.so \
   ${PKG[2]}/lib/libnss_winbind.so.2
  cp -a \
   ${SRC[0]}/source/nsswitch/libnss_wins.so \
   ${PKG[2]}/lib/libnss_wins.so.2

  (
    cd ${PKG[2]}/lib
    ln -sf libnss_winbind.so.2 libnss_winbind.so
    ln -sf libnss_wins.so.2 libnss_wins.so
  )

  mv \
   ${PKG[0]}/usr/man/man7/libsmbclient.7 \
   ${PKG[0]}/usr/man/man7/samba.7 \
   ${PKG[2]}/usr/man/man7

  # samba_dev
  install -m0644 ${PKG[0]}/usr/include/*.h ${PKG[3]}/usr/include

  # swat
  mv ${PKG[0]}/srv ${PKG[4]}
  mv ${PKG[0]}/usr/sbin/swat ${PKG[4]}/usr/sbin
  mv ${PKG[0]}/usr/man/man8/swat.8 ${PKG[4]}/usr/man/man8

  rm -rf ${PKG[0]}/usr/include
)

end