[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [lvm-devel] [PATCH 01/11] debian: fix library search path in example.conf



On Fri, 2009-10-09 at 00:27 +0100, Alasdair G Kergon wrote:
> On Thu, Oct 08, 2009 at 01:54:54PM +0200, Fabio M. Di Nitto wrote:
> > this patch is debian specific and sets the library search path
> > to /lib/lvm2 to avoid cluttering /lib
>  
> Add configure parm for this and generate example.conf from template?
> 
> In fact, it would be useful to know the current 'configure' line that
> Debian uses.

I think this patch is bogus even in Debian.

After some investigation "/lib/lvm2/" used to be the default for Debian
up to version 2.00.32-1 and then it was reverted to upstream default to
fix bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=287042

Other than the example config file there are no traces of /lib/lvm2
anywhere in the package.

I attached debian/rules anyway as it could be helpful for other patches.

Fabio
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode. 
#export DH_VERBOSE=1

DEB_HOST_ARCH       ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

SOURCE := $(shell dpkg-parsechangelog | sed -ne 's,^Source: *\(.*\)$$,\1,p')
VERSION_COMPLETE := $(shell dpkg-parsechangelog | sed -ne 's,^Version: *\(.*\)$$,\1,p')
VERSION_UPSTREAM := $(shell echo "$(VERSION_COMPLETE)" | sed -e 's,^[0-9]*:,,' -e 's,-[^-]*$$,,')
VERSION_DEBIAN := $(shell echo "$(VERSION_COMPLETE)" | sed -e 's,^[^-]*-,,')

DEVMAPPER_ABINAME = 1.02.1
DEVMAPPER_VERSION_PLAIN = $(shell awk '{print $$1}' VERSION_DM)
DEVMAPPER_VERSION = 2:$(DEVMAPPER_VERSION_PLAIN)
DEVMAPPER_VERSION_DEBIAN = $(DEVMAPPER_VERSION)-$(VERSION_DEBIAN)
DEVMAPPER_VERSION_FILE = $(DEVMAPPER_VERSION_PLAIN)-$(VERSION_DEBIAN)

BUILD_DIR = debian/build
STAMPS_DIR = debian/stamps

CFLAGS_UDEB := $(CFLAGS)
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS_UDEB = -g -Os
endif

CONFIGURE_FLAGS = --build $(DEB_BUILD_GNU_TYPE)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CONFIGURE_FLAGS += --host $(DEB_HOST_GNU_TYPE)
endif

CONFIGURE_FLAGS += \
	--prefix=/usr \
	--exec-prefix= \
	--mandir=\$${prefix}/share/man \
	--infodir=\$${prefix}/share/info \
	--with-confdir=\$${exec_prefix}/etc

ifneq (,$(findstring $(DEB_HOST_ARCH), arm armeb hppa mips mipsel))
CONFIGURE_FLAGS += --disable-o_direct
endif

source: $(STAMPS_DIR)/source

$(STAMPS_DIR)/source: DIR = $(BUILD_DIR)/source
$(STAMPS_DIR)/source:
	@mkdir -p $(STAMPS_DIR)
	rm -rf $(DIR)
	mkdir -p $(DIR)
	cp -al $(filter-out debian .svk .svn, $(wildcard .[^.]* *)) $(DIR)
	cp --remove-destination /usr/share/misc/config.sub /usr/share/misc/config.guess $(DIR)/autoconf
	cd $(DIR); QUILT_PATCHES=$(CURDIR)/debian/patches quilt --quiltrc /dev/null push -a || test $$? = 2
	cd $(DIR); autoreconf
	touch $@

setup: $(STAMPS_DIR)/setup-deb $(STAMPS_DIR)/setup-udeb

$(STAMPS_DIR)/setup-deb: SOURCE_DIR = $(BUILD_DIR)/source
$(STAMPS_DIR)/setup-deb: DIR = $(BUILD_DIR)/build-deb
$(STAMPS_DIR)/setup-deb: $(STAMPS_DIR)/source
	rm -rf $(DIR)
	cp -al $(SOURCE_DIR) $(DIR)
	cd $(DIR); \
	./configure CFLAGS="$(CFLAGS)" \
		$(CONFIGURE_FLAGS) \
		--with-optimisation="" \
		--with-clvmd=cman \
		--with-device-uid=0 \
		--with-device-gid=6 \
		--with-device-mode=0660 \
		--enable-pkgconfig \
		--enable-readline
	touch $@

$(STAMPS_DIR)/setup-udeb: SOURCE_DIR = $(BUILD_DIR)/source
$(STAMPS_DIR)/setup-udeb: DIR = $(BUILD_DIR)/build-udeb
$(STAMPS_DIR)/setup-udeb: $(STAMPS_DIR)/source
	rm -rf $(DIR)
	cp -al $(SOURCE_DIR) $(DIR)
	cd $(DIR); \
	./configure CFLAGS="$(CFLAGS_UDEB)" \
		$(CONFIGURE_FLAGS) \
		--with-optimisation="" \
		--with-cluster=none \
		--with-lvm1=none \
		--with-pool=none \
		--disable-readline \
		--disable-selinux
	touch $@

build: $(STAMPS_DIR)/build-deb $(STAMPS_DIR)/build-udeb

build-deb: $(STAMPS_DIR)/build-deb
.NOTPARALLEL: $(STAMPS_DIR)/build-deb
$(STAMPS_DIR)/build-deb: DIR = $(BUILD_DIR)/build-deb
$(STAMPS_DIR)/build-deb: $(STAMPS_DIR)/setup-deb
	dh_testdir
	$(MAKE) -C $(DIR) LIB_VERSION_DM=$(DEVMAPPER_ABINAME)
	touch $@

build-udeb: $(STAMPS_DIR)/build-udeb
.NOTPARALLEL: $(STAMPS_DIR)/build-udeb
$(STAMPS_DIR)/build-udeb: DIR = $(BUILD_DIR)/build-udeb
$(STAMPS_DIR)/build-udeb: $(STAMPS_DIR)/setup-udeb
	dh_testdir
	$(MAKE) -C $(DIR) LIB_VERSION_DM=$(DEVMAPPER_ABINAME)
	touch $@

$(BUILD_DIR) $(STAMPS_DIR):
	@[ -d $@ ] || mkdir $@

maintainerclean:
	rm -rf $(filter-out .svn .svk debian, $(wildcard * .[^.]*))

clean:
	dh_testdir
	rm -rf $(BUILD_DIR) $(STAMPS_DIR)
	dh_clean

$(STAMPS_DIR)/install-deb-%: DIR = $(BUILD_DIR)/install-deb-$*
$(STAMPS_DIR)/install-deb-%: $(STAMPS_DIR)/build-deb
	dh_testdir
	dh_testroot
	rm -rf $(DIR)
	$(MAKE) -C $(BUILD_DIR)/build-deb install_$* DESTDIR=$(CURDIR)/$(DIR) LIB_VERSION_DM=$(DEVMAPPER_ABINAME)
	touch $@

$(STAMPS_DIR)/install-udeb-%: DIR = $(BUILD_DIR)/install-udeb-$*
$(STAMPS_DIR)/install-udeb-%: $(STAMPS_DIR)/build-udeb
	dh_testdir
	dh_testroot
	rm -rf $(DIR)
	$(MAKE) -C $(BUILD_DIR)/build-udeb install_$* DESTDIR=$(CURDIR)/$(DIR) LIB_VERSION_DM=$(DEVMAPPER_ABINAME)
	touch $@

install: $(addprefix install-,libdevmapper libdevmapper-udeb dmsetup dmsetup-udeb lvm2 lvm2-udeb clvm)

install-base:
	dh_installdocs
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol -- $(GENCONTROL_ARGS)
	dh_md5sums
	dh_builddeb

install-clvm: export DH_OPTIONS = -pclvm
install-clvm: DIR = $(BUILD_DIR)/install-deb-cluster
install-clvm: $(STAMPS_DIR)/install-deb-cluster
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_install --sourcedir=$(DIR)
	dh_installchangelogs WHATS_NEW
	dh_installexamples
	dh_installinit --no-start -- start 63 S . start 51 0 6 .
	$(MAKE) -f debian/rules install-base

install-dmsetup: export DH_OPTIONS = -pdmsetup
install-dmsetup: DIR = $(BUILD_DIR)/install-deb-device-mapper
install-dmsetup: $(STAMPS_DIR)/install-deb-device-mapper
	dh_testdir
	dh_testroot
	dh_clean -k
	cp -a debian/tree/dmsetup debian/dmsetup
	dh_install --sourcedir=$(DIR)
	dh_installchangelogs WHATS_NEW_DM
	dh_installdebconf
	dh_installexamples
	$(MAKE) -f debian/rules install-base GENCONTROL_ARGS="-v$(DEVMAPPER_VERSION_DEBIAN)"

install-dmsetup-udeb: PACKAGE_NAME = dmsetup-udeb
install-dmsetup-udeb: export DH_OPTIONS = -p$(PACKAGE_NAME)
install-dmsetup-udeb: PACKAGE_FILE = $(PACKAGE_NAME)_$(DEVMAPPER_VERSION_FILE)_$(DEB_HOST_ARCH).udeb
install-dmsetup-udeb: DIR = $(BUILD_DIR)/install-udeb-device-mapper
install-dmsetup-udeb: $(STAMPS_DIR)/install-udeb-device-mapper
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installchangelogs WHATS_NEW_DM
	dh_install --sourcedir=$(DIR)

	dh_installdocs
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dpkg-gencontrol \
		-p$(PACKAGE_NAME) -ldebian/changelog -n$(PACKAGE_FILE) \
		-Tdebian/$(PACKAGE_NAME).substvars -Pdebian/$(PACKAGE_NAME) \
		-v$(DEVMAPPER_VERSION_DEBIAN)
	dh_md5sums
	dpkg-deb --build debian/$(PACKAGE_NAME) ../$(PACKAGE_FILE)


install-libdevmapper: export DH_OPTIONS = -plibdevmapper-dev -plibdevmapper$(DEVMAPPER_ABINAME)
install-libdevmapper: DIR = $(BUILD_DIR)/install-deb-device-mapper
install-libdevmapper: $(STAMPS_DIR)/install-deb-device-mapper
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_install --sourcedir=$(DIR)
	dh_installchangelogs WHATS_NEW_DM
	dh_installexamples
	dh_link -p libdevmapper-dev lib/libdevmapper.so.$(DEVMAPPER_ABINAME) usr/lib/libdevmapper.so
	dh_makeshlibs -p 'libdevmapper$(DEVMAPPER_ABINAME)' \
		--add-udeb 'libdevmapper$(DEVMAPPER_ABINAME)-udeb' \
	       	"-Vlibdevmapper$(DEVMAPPER_ABINAME) (>= $(DEVMAPPER_VERSION))" \
		-- "-v$(DEVMAPPER_VERSION_DEBIAN)"
	$(MAKE) -f debian/rules install-base GENCONTROL_ARGS="-v$(DEVMAPPER_VERSION_DEBIAN)"

install-libdevmapper-udeb: PACKAGE_NAME = libdevmapper$(DEVMAPPER_ABINAME)-udeb
install-libdevmapper-udeb: export DH_OPTIONS = -p$(PACKAGE_NAME)
install-libdevmapper-udeb: PACKAGE_FILE = $(PACKAGE_NAME)_$(DEVMAPPER_VERSION_FILE)_$(DEB_HOST_ARCH).udeb
install-libdevmapper-udeb: DIR = $(BUILD_DIR)/install-udeb-device-mapper
install-libdevmapper-udeb: $(STAMPS_DIR)/install-udeb-device-mapper
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_install --sourcedir=$(DIR)
	dh_installchangelogs WHATS_NEW_DM
	dh_installexamples

	dh_installdocs
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dpkg-gencontrol \
		-p$(PACKAGE_NAME) -ldebian/changelog -n$(PACKAGE_FILE) \
		-Tdebian/$(PACKAGE_NAME).substvars -Pdebian/$(PACKAGE_NAME) \
		-v$(DEVMAPPER_VERSION_DEBIAN)
	dh_md5sums
	dpkg-deb --build debian/$(PACKAGE_NAME) ../$(PACKAGE_FILE)

install-lvm2: export DH_OPTIONS = -plvm2
install-lvm2: DIR = $(BUILD_DIR)/install-deb-lvm2
install-lvm2: $(STAMPS_DIR)/install-deb-lvm2
	dh_testdir
	dh_testroot
	dh_clean -k
	cp -a debian/tree/lvm2 debian/lvm2
	dh_install --sourcedir=$(DIR)
	chmod +x -R debian/lvm2/usr/share/initramfs-tools
	dh_installchangelogs WHATS_NEW
	dh_installdebconf
	dh_installexamples
	dh_installinit --no-start -- start 26 S . start 50 0 6 .
	$(MAKE) -f debian/rules install-base

install-lvm2-udeb: export DH_OPTIONS = -plvm2-udeb
install-lvm2-udeb: DIR = $(BUILD_DIR)/install-udeb-lvm2
install-lvm2-udeb: $(STAMPS_DIR)/install-udeb-lvm2
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installchangelogs WHATS_NEW
	dh_install --sourcedir=$(DIR)
	$(MAKE) -f debian/rules install-base

binary-indep:
binary-arch: install

binary: binary-indep binary-arch

DIR_ORIG = ../orig/$(SOURCE)-$(VERSION_UPSTREAM)
TAR_ORIG_NAME = $(SOURCE)_$(VERSION_UPSTREAM).orig.tar.gz
TAR_ORIG = $(firstword $(wildcard ../$(TAR_ORIG_NAME)) $(wildcard ../orig/$(TAR_ORIG_NAME)))

orig: $(DIR_ORIG)
	rsync --delete --exclude debian --exclude .svk --exclude .svn --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ .

$(DIR_ORIG):
ifeq ($(TAR_ORIG),)
	$(error Cannot find orig tarball $(TAR_ORIG_NAME))
else
	mkdir -p ../orig
	tar -C ../orig -xzf $(TAR_ORIG)
endif

.PHONY: build clean binary-indep binary-arch binary install configure

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]