3 # Important modifications (introduction of a saved config.cache to
4 # solve build problems) introduced in Samba 2.2.1a-5. These
5 # modification were made by Steve Langasek <vorlon@netexpress.net>.
9 # Uncomment this to turn on verbose mode.
12 # This is the debhelper compatability version to use.
15 # This has to be exported to make some magic below work.
18 # Set the host and build architectures for use with config.cache loading,
19 # cross-building, etc.
20 DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
21 DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
22 DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
24 export DEB_HOST_GNU_TYPE
25 export DEB_BUILD_GNU_TYPE
26 export DEB_HOST_ARCH_OS
30 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
36 ifneq (,$(findstring thumb,$(DEB_BUILD_OPTIONS)))
40 DESTDIR=`pwd`/debian/tmp
43 --cache-file=./config.cache \
51 --with-privatedir=/etc/samba \
52 --with-piddir=/var/run/samba \
53 --localstatedir=/var \
59 --without-pam_smbpass \
62 --with-shared-modules=idmap_rid,idmap_ad \
69 ifeq ($(DEB_HOST_ARCH_OS),linux)
77 conf_args += --without-quotas
82 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
83 conf_args += --build $(DEB_HOST_GNU_TYPE)
85 conf_args += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
88 configure: patch configure-stamp
92 if [ -f debian/config.cache ]; then \
93 cp -f debian/config.cache source/config.cache; \
96 [ -f source/Makefile ] || (cd source && CFLAGS="$(CFLAGS)" ./configure $(conf_args))
100 build: configure build-stamp
104 $(MAKE) -C source headers
105 $(MAKE) -C source all nsswitch/libnss_wins.so
106 ifeq ($(mount_cifs),yes)
107 $(MAKE) -C source client/mount.cifs client/umount.cifs
112 clean: clean-patched unpatch
117 rm -f build-stamp configure-stamp
119 # Clean first the Samba package
120 -$(MAKE) -C source distclean
122 # Delete stuff left after a build that is not deleted by 'make clean'
123 rm -f source/bin/wbinfo source/bin/debug2html \
124 source/bin/libsmbclient.a \
125 source/client/mount.cifs source/client/umount.cifs \
126 source/include/stamp-h
128 # No type-handling in ubuntu main
129 #sed -e "s/@libacl@/`type-handling any linux-gnu`/g" \
130 # < debian/control.in > debian/control
141 mkdir -p $(DESTDIR)/usr/share/man $(DESTDIR)/usr/lib/samba \
142 $(DESTDIR)/lib/security $(DESTDIR)/sbin \
143 $(DESTDIR)/usr/lib/cups/backend $(DESTDIR)/usr/share/samba \
144 $(DESTDIR)/etc/dhcp3/dhclient-enter-hooks.d
145 # $(DESTDIR)/usr/lib/python2.4/site-packages/samba
147 # Add here commands to install the package into debian/tmp.
148 $(MAKE) -C source install DESTDIR=$(DESTDIR)
150 # libsmbclient files are not installed by the standard
151 # 'make install' - do it manually.
152 $(MAKE) -C source installclientlib DESTDIR=$(DESTDIR)
153 mv $(DESTDIR)/usr/lib/samba/libsmbclient.so $(DESTDIR)/usr/lib/samba/libsmbclient.so.0.1
154 ln -s libsmbclient.so.0.1 $(DESTDIR)/usr/lib/samba/libsmbclient.so.0
155 ln -s libsmbclient.so.0.1 $(DESTDIR)/usr/lib/samba/libsmbclient.so
157 # Starting with Samba 3.0.6 libsmbclient.so is installed in
158 # /usr/lib/samba. We don't want it there since it is not in the
159 # default library path. Here we move it to /usr/lib/.
160 mv $(DESTDIR)/usr/lib/samba/libsmbclient* \
163 # Install other stuff not installed by "make install"
164 install -m 0755 debian/mksmbpasswd.awk $(DESTDIR)/usr/sbin/mksmbpasswd
166 # Install libnss_wins.so, which is not installed by 'make install' either.
167 install -m 0644 source/nsswitch/libnss_wins.so \
168 $(DESTDIR)/lib/libnss_wins.so.2
171 # Create the symlinks that will allow us to do "mount -t smbfs ..."
172 # and "mount -t smb ...". Note that the source/script/installbin.sh
173 # tries to create the first symlink, but we have commented
174 # that code out and do everything here. We also create
175 # symlinks for the man pages.
176 ln -sf /usr/bin/smbmount $(DESTDIR)/sbin/mount.smbfs
177 ln -sf /usr/bin/smbmount $(DESTDIR)/sbin/mount.smb
178 ln -sf smbmount.8 $(DESTDIR)/usr/share/man/man8/mount.smb.8
179 ln -sf smbmount.8 $(DESTDIR)/usr/share/man/man8/mount.smbfs.8
182 ifeq ($(mount_cifs),yes)
183 install -m 0755 source/client/mount.cifs $(DESTDIR)/sbin/
184 install -m 0755 source/client/umount.cifs $(DESTDIR)/sbin/
187 # For CUPS to support printing to samba printers, it's necessary
188 # to make the following symlink (according to
189 # Erich Schubert <debian@vitavonni.de> in #109509):
190 ln -s ../../../bin/smbspool $(DESTDIR)/usr/lib/cups/backend/smb
192 # Install man pages for files without man pages in the upstream sources
193 install -m 0644 debian/mksmbpasswd.8 $(DESTDIR)/usr/share/man/man8/mksmbpasswd.8
195 # Install samba-common's conffiles - they'll get moved later to their
196 # correct place by dh_movefiles.
197 cp debian/smb.conf $(DESTDIR)/usr/share/samba/
198 install -m755 debian/panic-action $(DESTDIR)/usr/share/samba/
199 cp debian/gdbcommands $(DESTDIR)/etc/samba/
200 install -m755 debian/samba-common.dhcp $(DESTDIR)/etc/dhcp3/dhclient-enter-hooks.d/samba
202 # Install the Python modules
204 # Hmmm... need to figure this out. We have lib.linux-i686-2.2
205 # and lib.linux-i686-2.4 directories. Using only the stuff from
206 # the 2.4 directory for now. peloy.-
207 #cp source/build/lib.*/samba/*.so $(DESTDIR)/usr/lib/python2.4/site-packages/
208 # cp source/build/lib.*-*-2.4/samba/*.so $(DESTDIR)/usr/lib/python2.4/site-packages/samba/
209 # cp source/python/samba/* $(DESTDIR)/usr/lib/python2.4/site-packages/samba/
213 # Build architecture-independent files here.
214 # Pass -i to all debhelper commands in this target to reduce clutter.
215 binary-indep: DH_OPTIONS=-i
216 binary-indep: build install
220 dh_installdocs -A debian/README.build
221 # Ignore COPYING. Otherwise, an extra copy of the GPL licence
222 # in smbldap-tools example is included in samba-doc
223 dh_installexamples -Xsmbldap-tools-*
242 # Build architecture-dependent files here.
243 # Pass -a to all debhelper commands in this target to reduce clutter.
248 binary-arch: DH_OPTIONS=-a $(DH_EXTRAS)
249 binary-arch: build install
253 dh_installdocs -A debian/README.build
259 DH_OPTIONS= dh_installinit -psamba -- "defaults 20 19"
263 for pkg in samba smbfs; do \
264 install -m 0644 -D debian/$$pkg.lintian debian/$$pkg/usr/share/lintian/overrides/$$pkg || exit; \
267 dh_installchangelogs -Nlibpam-smbpass
268 dh_strip --dbg-package=samba --dbg-package=smbclient
269 cp -a debian/smbclient-dbg/* debian/samba-dbg
270 rm -rf debian/smbclient-dbg
275 # Upstream makefile installs this using "install" without -m, so
276 # it becomes executable
277 chmod a-x debian/libsmbclient-dev/usr/include/libsmbclient.h
279 # You may want to make some executables suid here.
281 # The smbmnt and smbumount binaries should be setuid-root. This
282 # has security implications because these programs haven't had
283 # a thorough security audit. smbmount _does not_ have to have
284 # the setuid bit set. In fact, it is a security hole.
285 #chmod u+s debian/smbfs/usr/bin/smbmnt
286 #chmod ug+s debian/smbfs/usr/bin/smbumount
288 ifeq ($(mount_cifs),yes)
289 #chmod u+s debian/smbfs/sbin/mount.cifs
290 #chmod u+s debian/smbfs/sbin/umount.cifs
293 # Set some reasonable default perms for the samba logdir.
294 chmod 0750 debian/samba/var/log/samba/
295 chown root.adm debian/samba/var/log/samba/
305 binary: binary-indep binary-arch
306 .PHONY: build clean binary-indep binary-arch binary install configure patch unpatch