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)
23 export DEB_HOST_GNU_TYPE
24 export DEB_BUILD_GNU_TYPE
27 # Support the DEB_BUILD_OPTIONS variable
28 CFLAGS = -gstabs -Wall
31 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
37 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
42 DESTDIR=`pwd`/debian/tmp
47 if [ ! -f patch-stamp ]; then /bin/sh debian/scripts/patch-source; fi
52 if [ -f patch-stamp ]; then /bin/sh debian/scripts/unpatch-source; fi
55 configure: patch-stamp configure-stamp
59 if [ -f debian/config.cache ]; then \
60 cp -f debian/config.cache source/config.cache; \
63 [ -f source/Makefile ] || (cd source && CFLAGS="$(CFLAGS)" ./configure \
64 --host=$(DEB_HOST_GNU_TYPE) \
65 --build=$(DEB_BUILD_GNU_TYPE) \
66 --cache-file=./config.cache \
73 --with-privatedir=/etc/samba \
74 --with-piddir=/var/run/samba \
75 --localstatedir=/var \
90 --with-python=python2.3)
94 build: patch-stamp configure-stamp build-stamp
98 $(MAKE) -C source headers
99 $(MAKE) -C source all nsswitch/libnss_wins.so python_ext
106 rm -f build-stamp configure-stamp
108 # Clean first the Samba package
109 # -$(MAKE) -C source realclean
110 # -$(MAKE) -C source clean
111 -$(MAKE) -C source python_clean distclean
113 # Delete stuff left after a build that is not deleted by 'make clean'
114 rm -f source/bin/wbinfo source/bin/winbindd source/bin/debug2html \
115 source/bin/libsmbclient.a source/include/stamp-h
126 mkdir -p $(DESTDIR)/usr/share/man $(DESTDIR)/usr/lib \
127 $(DESTDIR)/lib/security $(DESTDIR)/sbin \
128 $(DESTDIR)/usr/lib/cups/backend $(DESTDIR)/usr/share/samba \
129 $(DESTDIR)/etc/pam.d $(DESTDIR)/etc/dhcp3/dhclient-enter-hooks.d \
130 $(DESTDIR)/usr/lib/python2.3/site-packages
132 # Add here commands to install the package into debian/tmp.
133 $(MAKE) -C source install DESTDIR=$(DESTDIR)
135 # libsmbclient files are not installed by the standard
136 # 'make install' - do it manually.
137 $(MAKE) -C source installclientlib DESTDIR=$(DESTDIR)
138 mv $(DESTDIR)/usr/lib/libsmbclient.so $(DESTDIR)/usr/lib/libsmbclient.so.0.1
139 ln -s libsmbclient.so.0.1 $(DESTDIR)/usr/lib/libsmbclient.so.0
140 ln -s libsmbclient.so.0.1 $(DESTDIR)/usr/lib/libsmbclient.so
142 # Install other stuff not installed by "make install"
143 install -m 0755 debian/mksmbpasswd.awk $(DESTDIR)/usr/sbin/mksmbpasswd
145 # Install winbind stuff not installed by 'make install'
146 install -m 0644 source/nsswitch/libnss_winbind.so \
147 $(DESTDIR)/lib/libnss_winbind.so.2
148 install -m 0644 source/nsswitch/pam_winbind.so \
149 $(DESTDIR)/lib/security/
151 # Install libnss_wins.so, which is not installed by 'make install' either.
152 install -m 0644 source/nsswitch/libnss_wins.so \
153 $(DESTDIR)/lib/libnss_wins.so.2
155 # pam_smbpass.so isn't being installed by 'make install'.
156 # We'll move it here to $(DESTDIR)/lib/security/ and then
157 # libpam-smbpass.files will make dh_movefiles move it to the
158 # right location in the libpam-smbpass package.
159 install -m 0644 source/bin/pam_smbpass.so $(DESTDIR)/lib/security/
161 # Create the symlinks that will allow us to do "mount -t smbfs ..."
162 # and "mount -t smb ...". Note that the source/script/installbin.sh
163 # tries to create the first symlink, but we have commented
164 # that code out and do everything here. We also create
165 # symlinks for the man pages.
166 ln -s /usr/bin/smbmount $(DESTDIR)/sbin/mount.smbfs
167 ln -s /usr/bin/smbmount $(DESTDIR)/sbin/mount.smb
168 ln -s smbmount.8 $(DESTDIR)/usr/share/man/man8/mount.smb.8
169 ln -s smbmount.8 $(DESTDIR)/usr/share/man/man8/mount.smbfs.8
171 # For CUPS to support printing to samba printers, it's necessary
172 # to make the following symlink (according to
173 # Erich Schubert <debian@vitavonni.de> in #109509):
174 ln -s ../../../bin/smbspool $(DESTDIR)/usr/lib/cups/backend/smb
176 # Install man pages for files without man pages in the upstream sources
177 install -m 0644 debian/mksmbpasswd.8 $(DESTDIR)/usr/share/man/man8/mksmbpasswd.8
179 # We don't provide the "Using Samba" book in the swat package.
180 # It's provided in the samba-doc package so in the swat package
181 # we just provide a symlink to the real book.
182 ln -s ../../doc/samba-doc/htmldocs/using_samba \
183 $(DESTDIR)/usr/share/samba/swat/using_samba
185 # Delete unwanted stuff leftover from "make install"
187 # The smbwrapper package is not being generated anymore, so we must
188 # delete the related man pages.
189 rm $(DESTDIR)/usr/share/man/man1/smbsh.1
191 # We're not providing findsmb (should we?) so let's remove the man
193 find debian/ -name 'findsmb*' -exec rm -f {} \;
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 cp debian/samba.pamd $(DESTDIR)/etc/pam.d/samba
201 install -m755 debian/samba-common.dhcp $(DESTDIR)/etc/dhcp3/dhclient-enter-hooks.d/samba
203 # Install the Python modules
205 # Hmmm... need to figure this out. We have lib.linux-i686-2.2
206 # and lib.linux-i686-2.3 directories. Using only the stuff from
207 # the 2.3 directory for now. peloy.-
208 #cp source/build/lib.*/samba/*.so $(DESTDIR)/usr/lib/python2.3/site-packages/
209 cp source/build/lib.linux-*-2.3/samba/*.so $(DESTDIR)/usr/lib/python2.3/site-packages/
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 # dh_installexamples is not available in Debian Potato...
222 [ -x /usr/bin/dh_installexamples ] && DH_OPTIONS= dh_installexamples -v -psamba-doc examples/*
236 # Get rid of those pesky .cvsignore files to make lintian happy
237 find debian/ -name .cvsignore -exec rm -f {} \;
245 # Build architecture-dependent files here.
246 # Pass -a to all debhelper commands in this target to reduce clutter.
247 binary-arch: DH_OPTIONS=-a
248 binary-arch: build install
252 dh_installdocs -A debian/README.build
253 # dh_installexamples is not available in Debian Potato...
254 [ -x /usr/bin/dh_installexamples ] && DH_OPTIONS= dh_installexamples -v -ppython2.3-samba source/python/examples/*
256 # dh_installlogrotate is not available in Debian Potato...
257 if [ -x /usr/bin/dh_installlogrotate ]; then \
258 dh_installlogrotate; \
260 mkdir -p debian/samba/etc/logrotate.d; \
261 cp debian/samba.logrotate debian/samba/etc/logrotate.d/samba; \
262 mkdir -p debian/winbind/etc/logrotate.d; \
263 cp debian/winbind.logrotate debian/winbind/etc/logrotate.d/winbind; \
267 DH_OPTIONS= dh_installinit -psamba -- "defaults 20 19"
268 DH_OPTIONS= dh_installinit -pwinbind
272 cp debian/winbind.lintian debian/winbind/usr/share/lintian/overrides/winbind
274 dh_installchangelogs -Nlibpam-smbpass
275 DH_OPTIONS= dh_installchangelogs -plibpam-smbpass source/pam_smbpass/CHANGELOG
281 # Why this is executable, I have NO idea...
282 chmod a-x debian/libsmbclient-dev/usr/include/libsmbclient.h
284 # You may want to make some executables suid here.
285 # The smbmnt and smbumount binaries should be setuid-root. This
286 # has security implications because these programs haven't had
287 # a thorough security audit. smbmount _does not_ have to have
288 # the setuid bit set. In fact, it is a security hole.
289 chmod u+s debian/smbfs/usr/bin/smbmnt
290 chmod u+s debian/smbfs/usr/bin/smbumount
292 # Set some reasonable default perms for the samba logdir.
293 chmod 0750 debian/samba/var/log/samba/
294 chown root.adm debian/samba/var/log/samba/
296 # Get rid of those pesky .cvsignore files to make lintian happy
297 # (maybe we only need the "find ... -exec rm -f {} ;" we have
298 # in the binary-indep target?) peloy.-
299 find debian/ -name .cvsignore -exec rm -f {} \;
309 binary: binary-indep binary-arch
310 .PHONY: build clean binary-indep binary-arch binary install configure