#!/usr/bin/make -f # This has to be exported to make some magic below work. export DH_OPTIONS # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # Set the host and build architectures for use with config.cache loading, # cross-building, etc. DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) export DEB_HOST_GNU_TYPE export DEB_BUILD_GNU_TYPE export DEB_HOST_ARCH_OS pyversion := $(shell pyversions -vd) ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif include /usr/share/quilt/quilt.make PKGNAME=likewise-open DESTDIR=`pwd`/debian/tmp PREFIX=/usr LIBEXECDIR=$(PREFIX)/lib/$(PKGNAME) LOCALSTATEDIR=/var/lib/$(PKGNAME) SYSCONFDIR=/etc/$(PKGNAME) UPSTREAM=`pwd`/upstream-root RSYNC=rsync -a --exclude-from=debian/install-excludes ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) conf_args += --build $(DEB_BUILD_GNU_TYPE) else conf_args += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) endif configure: configure-stamp configure-stamp: $(QUILT_STAMPFN) dh_testdir ## Everything is done during the build phase touch configure-stamp build: build-stamp build-stamp: configure-stamp dh_testdir for comp in libunistr lwbase lwmapsecurity lwmsg centutils libtdb \ lwreg pstore lwadvapi netlogon lwio lwsm libkeytab \ libgss dcerpc lwrpcrt librpc eventlog lsass lwdns \ domainjoin srvsvc lwupgrade; do \ env BUILD_LOCALSTATEDIR=$(LOCALSTATEDIR) \ BUILD_SYSCONFDIR=$(SYSCONFDIR) \ BUILD_LIBDIR="lib/$(PKGNAME)" \ BUILD_PREFIXDIR=$(PREFIX) \ BUILD_LIBEXECDIR=$(LIBEXECDIR) \ BUILD_MAKE_FLAGS="SCRIPTDIR=$(LIBEXECDIR)" \ BUILD_STAGE_INSTALL_DIR=$(UPSTREAM) \ build/mkcomp $$comp || exit 1;\ done ## Generate VERSION #mkdir -v -p $(UPSTREAM)$(PREFIX)/share/$(PKGNAME) #rm -f $(UPSTREAM)$(PREFIX)/share/$(PKGNAME)/VERSION #packaging/scripts/mkversion.sh > $(UPSTREAM)$(PREFIX)/share/$(PKGNAME)/VERSION touch build-stamp clean: clean-patched unpatch clean-patched: dh_testdir dh_testroot rm -f build-stamp configure-stamp dh_clean install: build dh_testdir dh_testroot dh_prep dh_installdirs mkdir -p $(DESTDIR) mkdir -p $(DESTDIR)/etc/init.d $(RSYNC) $(UPSTREAM)/etc/init.d/ $(DESTDIR)/etc/init.d mkdir -p $(DESTDIR)$(SYSCONFDIR) $(RSYNC) $(UPSTREAM)$(SYSCONFDIR)/ $(DESTDIR)$(SYSCONFDIR) mkdir -p $(DESTDIR)/lib $(RSYNC) $(UPSTREAM)/lib/$(PKGNAME)/ $(DESTDIR)/lib mkdir -p $(DESTDIR)$(PREFIX)/bin $(RSYNC) $(UPSTREAM)$(PREFIX)/bin/ $(DESTDIR)$(PREFIX)/bin mkdir -p $(DESTDIR)$(PREFIX)/lib $(RSYNC) $(UPSTREAM)$(PREFIX)/lib/ $(DESTDIR)$(PREFIX)/lib mkdir -p $(DESTDIR)$(PREFIX)/sbin $(RSYNC) $(UPSTREAM)$(PREFIX)/sbin/ $(DESTDIR)$(PREFIX)/sbin mkdir -p $(DESTDIR)$(PREFIX)/share/dcerpc $(RSYNC) $(UPSTREAM)$(PREFIX)/share/dcerpc/ $(DESTDIR)$(PREFIX)/share/dcerpc mkdir -p $(DESTDIR)$(PREFIX)/share/$(PKGNAME) $(RSYNC) $(UPSTREAM)$(PREFIX)/data/VERSION $(DESTDIR)/usr/share/$(PKGNAME) cp -a $(UPSTREAM)$(PREFIX)/share/likewise/*.png $(DESTDIR)/usr/share/$(PKGNAME) cp -a $(UPSTREAM)$(PREFIX)/share/likewise/*.glade $(DESTDIR)/usr/share/$(PKGNAME) mkdir -p $(DESTDIR)/var $(RSYNC) $(UPSTREAM)/var/ $(DESTDIR)/var for file in ConfigureLogin gpcron; do \ /bin/cp $(UPSTREAM)$(PREFIX)/bin/$$file $(DESTDIR)$(LIBEXECDIR)/$$file; \ chmod 755 $(DESTDIR)/$(LIBEXECDIR)/$$file; \ done for file in dcerpcd eventlogd lsassd lwiod lwregd lwsmd netlogond srvsvcd; do \ cat config/$$file |\ sed 's#EXECDIR#$(LIBEXECDIR)#g' |\ sed 's#PREFIX_DIR#$(PREFIX)#g' > $$file.new; \ /bin/mv $$file.new $(DESTDIR)/etc/init.d/$$file; \ chmod 755 $(DESTDIR)/etc/init.d/$$file; \ done install -m755 config/init-base.sh $(DESTDIR)$(LIBEXECDIR)/ install -m755 config/init-lwsm.sh $(DESTDIR)$(LIBEXECDIR)/ mkdir -p $(DESTDIR)/usr/share/applications install -D -m 644 debian/likewise-open-gui.desktop $(DESTDIR)/usr/share/applications mkdir -p $(DESTDIR)/usr/share/icons install -D -m 644 debian/likewise-gui.xpm $(DESTDIR)/usr/share/icons/ install -D -m 644 debian/$(PKGNAME).pam-auth-update $(DESTDIR)/usr/share/pam-configs/$(PKGNAME) # Fix configuration files install -m644 config/likewise-krb5-ad.conf $(DESTDIR)$(SYSCONFDIR)/ # AppArmor HOMEDIRS tunable mkdir -p $(DESTDIR)/etc/apparmor.d/tunables/home.d cp debian/apparmor.homedirs $(DESTDIR)/etc/apparmor.d/tunables/home.d/likewise-open dh_install --sourcedir=$(DESTDIR) --list-missing # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installexamples # dh_install dh_installinit dh_installman dh_link dh_strip dh_compress dh_fixperms dh_makeshlibs -p$(PKGNAME) -P`pwd`/debian/$(PKGNAME)$(PREFIX)/lib/$(PKGNAME) dh_installdeb dh_shlibdeps -l`pwd`/debian/$(PKGNAME)$(PREFIX)/lib/$(PKGNAME) dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure