Whamcloud - gitweb
EX-3803 build: build lipe-lpcc on ubuntu 20.04 client
authorMinh Diep <mdiep@whamcloud.com>
Wed, 29 Sep 2021 19:08:15 +0000 (12:08 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 1 Oct 2021 00:12:52 +0000 (00:12 +0000)
* only support client. need to use ./configure --disable-server

Test-Parameters: trivial

Change-Id: I83c7a712cc0c58dcadd5df59bb49e3fc3d85f9b1
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/45095
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Feng, Lei <flei@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lipe/Makefile.am
lipe/configure.ac
lipe/debian/changelog [new file with mode: 0644]
lipe/debian/compat [new file with mode: 0644]
lipe/debian/control [new file with mode: 0644]
lipe/debian/control.main [new file with mode: 0644]
lipe/debian/lipe-lpcc.install [new file with mode: 0644]
lipe/debian/lipe-lpcc.manpages [new file with mode: 0644]
lipe/debian/rules [new file with mode: 0755]
lipe/debian/source/format [new file with mode: 0644]
lipe/detect-distro.sh

index 7fa191b..e5bfddf 100644 (file)
@@ -132,6 +132,22 @@ rpms: lipe.spec dist
                        --define="_prefix $(prefix)" -tb $(distdir).tar.gz \
                && echo "RPMs successfully generated in $(build_dir)/RPMS"
 
+debs:
+       pkgversion=$$(echo @PACKAGE_VERSION@ | tr '_' '-'); \
+       liperelease=$$(echo @LIPE_RELEASE@ | tr '_' '-'); \
+       cversion=$$(sed -ne '1s/^lipe-lpcc (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog); \
+       if [ "$$pkgversion-$$liperelease" != "$$cversion" ]; then \
+               echo -e "1i\nlipe-lpcc ($$pkgversion-$$liperelease) unstable; urgency=low\n\n  * Automated changelog entry update\n\n -- Minh Diep <mdiep@whamcloud.com>  $$(date -R)\n\n.\nwq" | ed debian/changelog; \
+       fi; \
+       rm -rf debs; \
+       dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp
+       VER=$$(sed -ne '1s/^lipe-lpcc (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
+       mkdir -p debs && \
+       mv ../lipe-lpcc_$${VER}_*.deb \
+          ../lipe-lpcc_$${VER}_*.changes \
+          ../lipe-lpcc_$${VER}.dsc \
+       debs/
+
 lipe-$(PACKAGE_VERSION).x86_64.iso: rpms
        @if test -z "$(CACHED_ISO_PATH)"; then \
                echo -e "Error: Can not build ISO without the cached ISO path," \
index 3acca65..3e74216 100644 (file)
@@ -178,7 +178,7 @@ AM_CONDITIONAL(BUILD_LAUDIT, test "$BUILD_LAUDIT" = "yes")
 AC_MSG_CHECKING([for distro version])
 DISTRO=$(sh detect-distro.sh)
 DISTRO_NAME=$(echo $DISTRO | awk -F '-' '{print $1}')
-if [[[ "$DISTRO_NAME" != "rhel" && "$DISTRO_NAME" != "fc" ]]]; then
+if [[[ "$DISTRO_NAME" != "rhel" && "$DISTRO_NAME" != "fc" && "$DISTRO_NAME" != "ubuntu" ]]]; then
         AC_MSG_ERROR([$DISTRO_NAME is not a supported distro.])
 fi
 DISTRO_RELEASE=$(echo $DISTRO | awk -F 'rhel-' '{print $2}' | awk -F '.' '{print $1}')
diff --git a/lipe/debian/changelog b/lipe/debian/changelog
new file mode 100644 (file)
index 0000000..7564c89
--- /dev/null
@@ -0,0 +1,5 @@
+lipe-lpcc (1.19-1) unstable; urgency=low
+
+  * Initial release
+
+ -- Minh Diep <mdiep@whamcloud.com>  Tue, 28 Sep 2021 10:21:04 +0000
diff --git a/lipe/debian/compat b/lipe/debian/compat
new file mode 100644 (file)
index 0000000..7f8f011
--- /dev/null
@@ -0,0 +1 @@
+7
diff --git a/lipe/debian/control b/lipe/debian/control
new file mode 100644 (file)
index 0000000..dd32c26
--- /dev/null
@@ -0,0 +1,16 @@
+Source: lipe-lpcc
+Section: admin
+Priority: optional
+Maintainer: Minh Diep <mdiep@whamcloud.com>
+Uploaders: Minh Diep <mdiep@whamcloud.com>
+Standards-Version: 3.8.3
+Build-Depends: module-assistant, libreadline-dev, debhelper (>=9.0.0), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, pkg-config, libtool
+Homepage: https://wiki.whamcloud.com/
+Vcs-Git: git://git.whamcloud.com/fs/lustre-release.git
+
+Package: lipe-lpcc
+Section: utils
+Architecture: all
+Priority: optional
+Depends: ${shlibs:Depends}, ${misc:Depends}, e2fsprogs (>= 1.42.13.wc6)
+Description: Tools for LPCC (Lustre Persisted Client Cache)
diff --git a/lipe/debian/control.main b/lipe/debian/control.main
new file mode 100644 (file)
index 0000000..dd32c26
--- /dev/null
@@ -0,0 +1,16 @@
+Source: lipe-lpcc
+Section: admin
+Priority: optional
+Maintainer: Minh Diep <mdiep@whamcloud.com>
+Uploaders: Minh Diep <mdiep@whamcloud.com>
+Standards-Version: 3.8.3
+Build-Depends: module-assistant, libreadline-dev, debhelper (>=9.0.0), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, pkg-config, libtool
+Homepage: https://wiki.whamcloud.com/
+Vcs-Git: git://git.whamcloud.com/fs/lustre-release.git
+
+Package: lipe-lpcc
+Section: utils
+Architecture: all
+Priority: optional
+Depends: ${shlibs:Depends}, ${misc:Depends}, e2fsprogs (>= 1.42.13.wc6)
+Description: Tools for LPCC (Lustre Persisted Client Cache)
diff --git a/lipe/debian/lipe-lpcc.install b/lipe/debian/lipe-lpcc.install
new file mode 100644 (file)
index 0000000..7c87c84
--- /dev/null
@@ -0,0 +1,4 @@
+lpcc /usr/bin
+src/lpcc_purge /usr/bin
+lpcc.conf /etc
+systemd/lpcc.service /usr/lib/systemd/system
diff --git a/lipe/debian/lipe-lpcc.manpages b/lipe/debian/lipe-lpcc.manpages
new file mode 100644 (file)
index 0000000..7f0e0c2
--- /dev/null
@@ -0,0 +1 @@
+debian/tmp/usr/share/man/*/*
diff --git a/lipe/debian/rules b/lipe/debian/rules
new file mode 100755 (executable)
index 0000000..d707661
--- /dev/null
@@ -0,0 +1,94 @@
+#!/usr/bin/make -f
+#
+# Created 2021 by Minh Diep based on lustre debian
+#
+# Uncomment this to turn on verbose mode.
+# export DH_VERBOSE=1
+
+DEB_BUILD_GNU_SYSTEM = $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
+DEB_BUILD_GNU_CPU = $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
+
+
+CFLAGS = -Wall -g
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+        CFLAGS += -O0
+else
+        CFLAGS += -O2
+endif
+
+# This is the debhelper compatibility version to use.
+export DH_COMPAT=9
+
+ARCH=$(shell dpkg --print-architecture)
+TOP_DIR:=$(shell pwd)
+
+# Packages provided for both client and server builds
+LPCC_PKG=lipe-lpcc
+
+BUILDDIR=.
+SRCDIR=.
+
+AVAIL_CPUS := $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
+ifneq ($(AVAIL_CPUS),1)
+      PMAKEARGS := -j $(AVAIL_CPUS)
+endif
+
+configure: configure-stamp
+configure-stamp: debian/control.main
+       dh_testdir
+       # touch files to same date, to avoid auto*
+       # Build only client
+       export EXTRAFLAGS="--disable-server"; \
+       echo "Final value of EXTRAFLAGS: $${EXTRAFLAGS}"; \
+       ( cd $(BUILDDIR) && \
+               $(SRCDIR)/configure $${EXTRAFLAGS} \
+                       $(EXTRA_OPTIONS) \
+       ); \
+       touch $@
+
+build: build-stamp
+build-stamp: configure-stamp
+       dh_testdir
+       $(MAKE) -C $(BUILDDIR) $(PMAKEARGS)
+       $(MAKE) -C $(BUILDDIR) DESTDIR=$(TOP_DIR)/debian/tmp install
+       cp $(BUILDDIR)/lpcc $(TOP_DIR)/debian/tmp/usr/bin
+       mkdir -p $(TOP_DIR)/debian/tmp/etc
+       cp $(BUILDDIR)/lpcc.conf $(TOP_DIR)/debian/tmp/etc
+       mkdir -p $(TOP_DIR)/debian/tmp/usr/lib/systemd/system
+       cp $(BUILDDIR)/systemd/lpcc.service $(TOP_DIR)/debian/tmp/usr/lib/systemd/system
+       mkdir -p $(TOP_DIR)/debian/tmp/usr/share/man/man5
+       mkdir -p $(TOP_DIR)/debian/tmp/usr/share/man/man8
+       cp $(BUILDDIR)/man/*.5 $(TOP_DIR)/debian/tmp/usr/share/man/man5
+       cp $(BUILDDIR)/man/*.8 $(TOP_DIR)/debian/tmp/usr/share/man/man8
+       touch $@
+
+binary-arch: binary-$(LPCC_PKG)
+
+binary: binary-arch
+
+binary-$(LPCC_PKG): build-stamp
+       dh_testdir
+       dh_testroot
+       dh_installdirs -p $(LPCC_PKG)
+       dh_install -p $(LPCC_PKG)
+       dh_installman -p $(LPCC_PKG)
+       dh_makeshlibs -p $(LPCC_PKG)
+       dh_compress -p $(LPCC_PKG)
+       dh_strip -p $(LPCC_PKG)
+       dh_installdeb -p $(LPCC_PKG)
+       dh_fixperms -p $(LPCC_PKG)
+       dh_gencontrol -p $(LPCC_PKG)
+       dh_md5sums -p $(LPCC_PKG)
+       dh_builddeb -p $(LPCC_PKG)
+
+clean:
+       dh_testdir
+       dh_testroot
+       -$(MAKE) distclean
+       rm -rf debian/substvars debian/*.bak debian/*~ *~  *-stamp
+       dh_clean
+       # make sure we have at least a basic control in place (see build-stamp)
+       rm -f debian/control
+       cp debian/control.main debian/control
+
+.PHONY: binary-arch clean source diff  binary binary-arch install configure
diff --git a/lipe/debian/source/format b/lipe/debian/source/format
new file mode 100644 (file)
index 0000000..d3827e7
--- /dev/null
@@ -0,0 +1 @@
+1.0
index fa8d8fd..154c0d2 100755 (executable)
@@ -30,6 +30,9 @@ if which lsb_release >/dev/null 2>&1; then
                "Fedora")
                        name="fc"
                        ;;
+               "Ubuntu")
+                       name="ubuntu"
+                       ;;
                *)
                        fatal 1 "I don't know what distro name $name and version $version is.\nEither update autodetect_distro() or use the --distro argument."
                        ;;