diff --git a/Makefile.am b/Makefile.am index 0d6fd2f..57505cd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,10 +15,10 @@ mstorectl_SOURCES = \ mstored_SOURCES = \ cmd/mstored/main.go -mstorectl$(EXEEXT): $(mstorectl_SOURCES) +mstorectl$(EXEEXT): $(mstorectl_SOURCES) $(EXTRA_mstored_SOURCES) env CGO_ENABLED=0 $(GO) build $(GOFLAGS) -o mstorectl$(EXEEXT) $(mstorectl_SOURCES) -mstored$(EXEEXT): $(mstored_SOURCES) +mstored$(EXEEXT): $(mstored_SOURCES) $(EXTRA_mstored_SOURCES) env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o mstored$(EXEEXT) $(mstored_SOURCES) run: $(mstored_SOURCES) @@ -26,6 +26,139 @@ run: $(mstored_SOURCES) CWD=$(shell pwd) +EXTRA_mstored_SOURCES = \ + app/config/config.go \ + app/config/variant.go \ + app/descr/account.go \ + app/descr/blob.go \ + app/descr/file.go \ + app/descr/grant.go \ + app/descr/manifest.go \ + app/descr/response.go \ + app/descr/server.go \ + app/handler/aaafunc.go \ + app/handler/account.go \ + app/handler/blob.go \ + app/handler/file.go \ + app/handler/grant.go \ + app/handler/handler.go \ + app/handler/manifest.go \ + app/handler/notfound.go \ + app/handler/response.go \ + app/handler/service.go \ + app/handler/version.go \ + app/logger/logger.go \ + app/maindb/account.go \ + app/maindb/blob.go \ + app/maindb/file.go \ + app/maindb/grant.go \ + app/maindb/init.go \ + app/maindb/maindb.go \ + app/maindb/manifest.go \ + app/maindb/scheme.go \ + app/operator/account.go \ + app/operator/blob.go \ + app/operator/file.go \ + app/operator/grant.go \ + app/operator/imgaux.go \ + app/operator/manifest.go \ + app/operator/ociaux.go \ + app/operator/operator.go \ + app/operator/service.go \ + app/operator/version.go \ + app/router/bindobj.go \ + app/router/context.go \ + app/router/corsmw.go \ + app/router/loggingmw.go \ + app/router/pathc.go \ + app/router/recovermw.go \ + app/router/router.go \ + app/server/server.go \ + app/service/service.go \ + app/storage/storage.go \ + pkg/auxhttp/basic.go \ + pkg/auxhttp/crange.go \ + pkg/auxoci/ociaux.go \ + pkg/auxpwd/passwd.go \ + pkg/auxtool/cleandir.go \ + pkg/auxtool/fileex.go \ + pkg/auxtool/randstr.go \ + pkg/auxtool/tmpfile.go \ + pkg/auxtool/unixnow.go \ + pkg/auxutar/utar.go \ + pkg/auxuuid/uuid.go \ + pkg/auxx509/x509cert.go \ + pkg/client/account.go \ + pkg/client/client.go \ + pkg/client/fileaux.go \ + pkg/client/file.go \ + pkg/client/grant.go \ + pkg/client/httpcall.go \ + pkg/client/imageaux.go \ + pkg/client/imagedelete.go \ + pkg/client/imageinfo.go \ + pkg/client/imagepull.go \ + pkg/client/imagepush.go \ + pkg/client/service.go + +EXTRA_DIST = \ + Containerfile \ + go.mod \ + go.sum \ + LICENSE.txt \ + README.md \ + app/logger/logger_test.go \ + app/maindb/file_test.go \ + app/maindb/grant_test.go \ + app/router/pathc_test.go \ + app/router/router_test.go \ + pkg/auxpwd/passwd_test.go \ + pkg/auxx509/x509cert_test.go \ + attic/account_test.go \ + attic/file_test.go \ + chart/Chart.yaml.in \ + chart/.gitignore \ + chart/.helmignore \ + chart/templates/configmap.yaml \ + chart/templates/deployment.yaml \ + chart/templates/_imagepath.tpl \ + chart/templates/_serviceport.tmpl \ + chart/templates/service.yaml \ + chart/templates/_storageclass.tpl \ + chart/templates/_storagesize.tpl \ + chart/templates/_userpass.tpl \ + chart/templates/volumeclaim.yaml \ + chart/values.yaml.in \ + debian/changelog.in \ + debian/compat \ + debian/control.in \ + debian/debhelper-build-stamp \ + debian/files \ + debian/.gitignore \ + debian/mstore-control.install \ + debian/mstore-control.postinst \ + debian/mstore-control.postrm \ + debian/mstore-control.preinst \ + debian/mstore-control.prerm \ + debian/mstore-service.install \ + debian/mstore-service.postinst \ + debian/mstore-service.postrm \ + debian/mstore-service.preinst \ + debian/mstore-service.prerm \ + debian/patches/series \ + debian/README.Debian \ + debian/rules \ + debian/source/format \ + debian/source/include-binaries \ + debian/watch \ + initrc/.gitignore \ + initrc/mstored.in \ + initrc/mstored.service.in \ + test/account_test.go \ + test/file_test.go \ + test/image_test.go \ + test/test-oci.img + format: @dirs=$$($(FIND) $(CWD) -name '*.go' | $(XARGS) -n1 dirname | $(SORT) | $(UNIQ)); \ for dir in $$dirs;do \ @@ -38,12 +171,15 @@ test: DIST_DIR= $(shell pwd)/DIST +BUILD_DIR= $(shell pwd)/BUILD IMAGE_REPO = localhost IMAGE_NAME = $(PACKAGE_NAME):$(PACKAGE_VERSION) IMAGE_TARNAME = $(PACKAGE_NAME)-$(PACKAGE_VERSION).img IMAGE_CONTAINERFILE = Containerfile + + image:: build-image build-image: clean $(GO) mod vendor @@ -63,6 +199,20 @@ build-chart: mkdir -p $(DIST_DIR) $(HELM) package --destination $(DIST_DIR) chart/ +$(DIST_ARCHIVES): dist + +package:: debian-package +debian-package: $(DIST_ARCHIVES) + mkdir -p $(BUILD_DIR) + mv $(DIST_ARCHIVES) $(BUILD_DIR) + cd $(BUILD_DIR) && $(AMTAR) -xf $(DIST_ARCHIVES) + cd $(BUILD_DIR)/$(distdir) && ./configure --prefix=/usr + cd $(BUILD_DIR)/$(distdir) && $(MAKE) clean + cd $(BUILD_DIR)/$(distdir) && $(DPKGSOURCE) -i --before-build . + cd $(BUILD_DIR)/$(distdir) && $(DBUILDPACKAGE) -nc -us -uc -ui -i -b + mkdir -p $(DIST_DIR) + $(CP) $(BUILD_DIR)/*.deb $(DIST_DIR) + rm -rf $(BUILD_DIR) FREEBSD_LOCALBASE = /usr/local FREEBSD_RCDIR = $(FREEBSD_LOCALBASE)/etc/rc.d diff --git a/Makefile.in b/Makefile.in index 5f722a3..420c027 100644 --- a/Makefile.in +++ b/Makefile.in @@ -101,7 +101,8 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = app/config/variant.go initrc/mstored.service \ - initrc/mstored chart/Chart.yaml chart/values.yaml + initrc/mstored chart/Chart.yaml chart/values.yaml \ + debian/control debian/changelog CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) @@ -138,8 +139,10 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(mstorectl_SOURCES) $(mstored_SOURCES) -DIST_SOURCES = $(mstorectl_SOURCES) $(mstored_SOURCES) +SOURCES = $(mstorectl_SOURCES) $(mstored_SOURCES) \ + $(EXTRA_mstored_SOURCES) +DIST_SOURCES = $(mstorectl_SOURCES) $(mstored_SOURCES) \ + $(EXTRA_mstored_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -167,6 +170,8 @@ am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/app/config/variant.go.in \ $(top_srcdir)/chart/Chart.yaml.in \ $(top_srcdir)/chart/values.yaml.in \ + $(top_srcdir)/debian/changelog.in \ + $(top_srcdir)/debian/control.in \ $(top_srcdir)/initrc/mstored.in \ $(top_srcdir)/initrc/mstored.service.in README.md config.guess \ config.sub install-sh missing @@ -202,7 +207,9 @@ CPIO = @CPIO@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ +DBUILDPACKAGE = @DBUILDPACKAGE@ DEFS = @DEFS@ +DPKGSOURCE = @DPKGSOURCE@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ @@ -229,6 +236,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PODMAN = @PODMAN@ ROOT_GROUP = @ROOT_GROUP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -306,7 +314,141 @@ mstored_SOURCES = \ cmd/mstored/main.go CWD = $(shell pwd) +EXTRA_mstored_SOURCES = \ + app/config/config.go \ + app/config/variant.go \ + app/descr/account.go \ + app/descr/blob.go \ + app/descr/file.go \ + app/descr/grant.go \ + app/descr/manifest.go \ + app/descr/response.go \ + app/descr/server.go \ + app/handler/aaafunc.go \ + app/handler/account.go \ + app/handler/blob.go \ + app/handler/file.go \ + app/handler/grant.go \ + app/handler/handler.go \ + app/handler/manifest.go \ + app/handler/notfound.go \ + app/handler/response.go \ + app/handler/service.go \ + app/handler/version.go \ + app/logger/logger.go \ + app/maindb/account.go \ + app/maindb/blob.go \ + app/maindb/file.go \ + app/maindb/grant.go \ + app/maindb/init.go \ + app/maindb/maindb.go \ + app/maindb/manifest.go \ + app/maindb/scheme.go \ + app/operator/account.go \ + app/operator/blob.go \ + app/operator/file.go \ + app/operator/grant.go \ + app/operator/imgaux.go \ + app/operator/manifest.go \ + app/operator/ociaux.go \ + app/operator/operator.go \ + app/operator/service.go \ + app/operator/version.go \ + app/router/bindobj.go \ + app/router/context.go \ + app/router/corsmw.go \ + app/router/loggingmw.go \ + app/router/pathc.go \ + app/router/recovermw.go \ + app/router/router.go \ + app/server/server.go \ + app/service/service.go \ + app/storage/storage.go \ + pkg/auxhttp/basic.go \ + pkg/auxhttp/crange.go \ + pkg/auxoci/ociaux.go \ + pkg/auxpwd/passwd.go \ + pkg/auxtool/cleandir.go \ + pkg/auxtool/fileex.go \ + pkg/auxtool/randstr.go \ + pkg/auxtool/tmpfile.go \ + pkg/auxtool/unixnow.go \ + pkg/auxutar/utar.go \ + pkg/auxuuid/uuid.go \ + pkg/auxx509/x509cert.go \ + pkg/client/account.go \ + pkg/client/client.go \ + pkg/client/fileaux.go \ + pkg/client/file.go \ + pkg/client/grant.go \ + pkg/client/httpcall.go \ + pkg/client/imageaux.go \ + pkg/client/imagedelete.go \ + pkg/client/imageinfo.go \ + pkg/client/imagepull.go \ + pkg/client/imagepush.go \ + pkg/client/service.go + +EXTRA_DIST = \ + Containerfile \ + go.mod \ + go.sum \ + LICENSE.txt \ + README.md \ + app/logger/logger_test.go \ + app/maindb/file_test.go \ + app/maindb/grant_test.go \ + app/router/pathc_test.go \ + app/router/router_test.go \ + pkg/auxpwd/passwd_test.go \ + pkg/auxx509/x509cert_test.go \ + attic/account_test.go \ + attic/file_test.go \ + chart/Chart.yaml.in \ + chart/.gitignore \ + chart/.helmignore \ + chart/templates/configmap.yaml \ + chart/templates/deployment.yaml \ + chart/templates/_imagepath.tpl \ + chart/templates/_serviceport.tmpl \ + chart/templates/service.yaml \ + chart/templates/_storageclass.tpl \ + chart/templates/_storagesize.tpl \ + chart/templates/_userpass.tpl \ + chart/templates/volumeclaim.yaml \ + chart/values.yaml.in \ + debian/changelog.in \ + debian/compat \ + debian/control.in \ + debian/debhelper-build-stamp \ + debian/files \ + debian/.gitignore \ + debian/mstore-control.install \ + debian/mstore-control.postinst \ + debian/mstore-control.postrm \ + debian/mstore-control.preinst \ + debian/mstore-control.prerm \ + debian/mstore-service.install \ + debian/mstore-service.postinst \ + debian/mstore-service.postrm \ + debian/mstore-service.preinst \ + debian/mstore-service.prerm \ + debian/patches/series \ + debian/README.Debian \ + debian/rules \ + debian/source/format \ + debian/source/include-binaries \ + debian/watch \ + initrc/.gitignore \ + initrc/mstored.in \ + initrc/mstored.service.in \ + test/account_test.go \ + test/file_test.go \ + test/image_test.go \ + test/test-oci.img + DIST_DIR = $(shell pwd)/DIST +BUILD_DIR = $(shell pwd)/BUILD IMAGE_REPO = localhost IMAGE_NAME = $(PACKAGE_NAME):$(PACKAGE_VERSION) IMAGE_TARNAME = $(PACKAGE_NAME)-$(PACKAGE_VERSION).img @@ -361,6 +503,10 @@ chart/Chart.yaml: $(top_builddir)/config.status $(top_srcdir)/chart/Chart.yaml.i cd $(top_builddir) && $(SHELL) ./config.status $@ chart/values.yaml: $(top_builddir)/config.status $(top_srcdir)/chart/values.yaml.in cd $(top_builddir) && $(SHELL) ./config.status $@ +debian/control: $(top_builddir)/config.status $(top_srcdir)/debian/control.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +debian/changelog: $(top_builddir)/config.status $(top_srcdir)/debian/changelog.in + cd $(top_builddir) && $(SHELL) ./config.status $@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -813,10 +959,10 @@ uninstall-am: uninstall-binPROGRAMS uninstall-sbinPROGRAMS .PRECIOUS: Makefile -mstorectl$(EXEEXT): $(mstorectl_SOURCES) +mstorectl$(EXEEXT): $(mstorectl_SOURCES) $(EXTRA_mstored_SOURCES) env CGO_ENABLED=0 $(GO) build $(GOFLAGS) -o mstorectl$(EXEEXT) $(mstorectl_SOURCES) -mstored$(EXEEXT): $(mstored_SOURCES) +mstored$(EXEEXT): $(mstored_SOURCES) $(EXTRA_mstored_SOURCES) env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o mstored$(EXEEXT) $(mstored_SOURCES) run: $(mstored_SOURCES) @@ -849,6 +995,21 @@ build-chart: mkdir -p $(DIST_DIR) $(HELM) package --destination $(DIST_DIR) chart/ +$(DIST_ARCHIVES): dist + +package:: debian-package +debian-package: $(DIST_ARCHIVES) + mkdir -p $(BUILD_DIR) + mv $(DIST_ARCHIVES) $(BUILD_DIR) + cd $(BUILD_DIR) && $(AMTAR) -xf $(DIST_ARCHIVES) + cd $(BUILD_DIR)/$(distdir) && ./configure --prefix=/usr + cd $(BUILD_DIR)/$(distdir) && $(MAKE) clean + cd $(BUILD_DIR)/$(distdir) && $(DPKGSOURCE) -i --before-build . + cd $(BUILD_DIR)/$(distdir) && $(DBUILDPACKAGE) -nc -us -uc -ui -i -b + mkdir -p $(DIST_DIR) + $(CP) $(BUILD_DIR)/*.deb $(DIST_DIR) + rm -rf $(BUILD_DIR) + install-data-local: test -z $(DESTDIR)$(srv_confdir) || $(MKDIR_P) $(DESTDIR)$(srv_confdir) test -z $(DESTDIR)$(srv_logdir) || $(MKDIR_P) $(DESTDIR)$(srv_logdir) diff --git a/app/config/variant.go b/app/config/variant.go deleted file mode 100644 index 9bba10e..0000000 --- a/app/config/variant.go +++ /dev/null @@ -1,10 +0,0 @@ -package config - -const ( - confdir = "/home/ziggi/Projects/mstore/etc/mstore" - rundir = "/home/ziggi/Projects/mstore/tmp/run" - logdir = "/home/ziggi/Projects/mstore/tmp/log" - datadir = "/home/ziggi/Projects/mstore/tmp/data" - version = "0.1.0" - srvname = "mstored" -) diff --git a/configure b/configure index 1eb7e64..6eeee3d 100755 --- a/configure +++ b/configure @@ -638,7 +638,10 @@ build_vendor build_cpu build CP +DPKGSOURCE +DBUILDPACKAGE HELM +PODMAN BASENAME CPIO SUDO @@ -3043,6 +3046,56 @@ fi done +for ac_prog in podman true +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PODMAN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PODMAN in + [\\/]* | ?:[\\/]*) + ac_cv_path_PODMAN="$PODMAN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PODMAN="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PODMAN=$ac_cv_path_PODMAN +if test -n "$PODMAN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PODMAN" >&5 +printf "%s\n" "$PODMAN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$PODMAN" && break +done + for ac_prog in helm true do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -3093,7 +3146,105 @@ fi test -n "$HELM" && break done +for ac_prog in dpkg-buildpackage true +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DBUILDPACKAGE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DBUILDPACKAGE in + [\\/]* | ?:[\\/]*) + ac_cv_path_DBUILDPACKAGE="$DBUILDPACKAGE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DBUILDPACKAGE="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +DBUILDPACKAGE=$ac_cv_path_DBUILDPACKAGE +if test -n "$DBUILDPACKAGE"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DBUILDPACKAGE" >&5 +printf "%s\n" "$DBUILDPACKAGE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$DBUILDPACKAGE" && break +done + +for ac_prog in dpkg-source true +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DPKGSOURCE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DPKGSOURCE in + [\\/]* | ?:[\\/]*) + ac_cv_path_DPKGSOURCE="$DPKGSOURCE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DPKGSOURCE="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DPKGSOURCE=$ac_cv_path_DPKGSOURCE +if test -n "$DPKGSOURCE"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DPKGSOURCE" >&5 +printf "%s\n" "$DPKGSOURCE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$DPKGSOURCE" && break +done for ac_prog in gcp cp @@ -3550,7 +3701,7 @@ printf "%s\n" "$as_me: srv_datadir set as ${SRV_DATADIR}" >&6;} -ac_config_files="$ac_config_files Makefile app/config/variant.go initrc/mstored.service initrc/mstored chart/Chart.yaml chart/values.yaml" +ac_config_files="$ac_config_files Makefile app/config/variant.go initrc/mstored.service initrc/mstored chart/Chart.yaml chart/values.yaml debian/control debian/changelog" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -4294,6 +4445,8 @@ do "initrc/mstored") CONFIG_FILES="$CONFIG_FILES initrc/mstored" ;; "chart/Chart.yaml") CONFIG_FILES="$CONFIG_FILES chart/Chart.yaml" ;; "chart/values.yaml") CONFIG_FILES="$CONFIG_FILES chart/values.yaml" ;; + "debian/control") CONFIG_FILES="$CONFIG_FILES debian/control" ;; + "debian/changelog") CONFIG_FILES="$CONFIG_FILES debian/changelog" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/configure.ac b/configure.ac index 51ab8d7..4158d85 100644 --- a/configure.ac +++ b/configure.ac @@ -18,9 +18,10 @@ AC_PATH_PROGS([SUDO],[sudo false]) AC_PATH_PROGS([CPIO],[cpio false]) AC_PATH_PROGS([BASENAME],[basename]) +AC_PATH_PROGS([PODMAN],[podman true]) AC_PATH_PROGS([HELM],[helm true]) - - +AC_PATH_PROGS([DBUILDPACKAGE],[dpkg-buildpackage true]) +AC_PATH_PROGS([DPKGSOURCE],[dpkg-source true]) AC_PATH_PROGS([CP],[gcp cp]) if test -z "$CP"; then @@ -246,5 +247,7 @@ initrc/mstored.service initrc/mstored chart/Chart.yaml chart/values.yaml +debian/control +debian/changelog ]) AC_OUTPUT diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 0000000..fc13f7b --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,2 @@ +changelog +control diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..443850b --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1 @@ +mstore for Debian diff --git a/debian/changelog.in b/debian/changelog.in new file mode 100644 index 0000000..a0e52fb --- /dev/null +++ b/debian/changelog.in @@ -0,0 +1,5 @@ +mstore (@PACKAGE_VERSION@-1) unstable; urgency=low + + * Release. + + -- Oleg Borodin Sun, 29 Oct 2017 18:57:56 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +10 diff --git a/debian/control.in b/debian/control.in new file mode 100644 index 0000000..217bf10 --- /dev/null +++ b/debian/control.in @@ -0,0 +1,15 @@ +Source: mstore +Section: utils +Priority: extra +Maintainer: borodin@unix7.org +Build-Depends: debhelper (>=8) +Standards-Version: @PACKAGE_VERSION@ +Homepage: http://wiki.unix7.org + +Package: mstore-control +Description: mstore +Architecture: amd64 + +Package: mstore-service +Description: mstore +Architecture: amd64 diff --git a/debian/debhelper-build-stamp b/debian/debhelper-build-stamp new file mode 100644 index 0000000..97d445c --- /dev/null +++ b/debian/debhelper-build-stamp @@ -0,0 +1,2 @@ +mstore-control +mstore-service diff --git a/debian/files b/debian/files new file mode 100644 index 0000000..451059e --- /dev/null +++ b/debian/files @@ -0,0 +1,5 @@ +mstore-control-dbgsym_2.11.0-1_amd64.deb debug optional automatic=yes +mstore-control_2.11.0-1_amd64.deb utils extra +mstore-service-dbgsym_2.11.0-1_amd64.deb debug optional automatic=yes +mstore-service_2.11.0-1_amd64.deb utils extra +mstore_2.11.0-1_amd64.buildinfo utils extra diff --git a/debian/mstore-control.install b/debian/mstore-control.install new file mode 100644 index 0000000..7acd345 --- /dev/null +++ b/debian/mstore-control.install @@ -0,0 +1,2 @@ +usr/bin/mstorectl + diff --git a/debian/mstore-control.postinst b/debian/mstore-control.postinst new file mode 100755 index 0000000..f6eb068 --- /dev/null +++ b/debian/mstore-control.postinst @@ -0,0 +1,2 @@ +#!/bin/sh -e + diff --git a/debian/mstore-control.postrm b/debian/mstore-control.postrm new file mode 100755 index 0000000..f6eb068 --- /dev/null +++ b/debian/mstore-control.postrm @@ -0,0 +1,2 @@ +#!/bin/sh -e + diff --git a/debian/mstore-control.preinst b/debian/mstore-control.preinst new file mode 100755 index 0000000..1057534 --- /dev/null +++ b/debian/mstore-control.preinst @@ -0,0 +1,20 @@ +#!/bin/sh +set -e + +case "$1" in + install|upgrade) + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + + +#DEBHELPER# + +exit 0 diff --git a/debian/mstore-control.prerm b/debian/mstore-control.prerm new file mode 100755 index 0000000..f6eb068 --- /dev/null +++ b/debian/mstore-control.prerm @@ -0,0 +1,2 @@ +#!/bin/sh -e + diff --git a/debian/mstore-service.install b/debian/mstore-service.install new file mode 100644 index 0000000..4cce349 --- /dev/null +++ b/debian/mstore-service.install @@ -0,0 +1,6 @@ +usr/sbin/mstored +lib/systemd/system/mstored.service +var/run/mstore +var/log/mstore +etc/mstore + diff --git a/debian/mstore-service.postinst b/debian/mstore-service.postinst new file mode 100755 index 0000000..55b29c7 --- /dev/null +++ b/debian/mstore-service.postinst @@ -0,0 +1,6 @@ +#!/bin/sh -e + +if [ "$1" = "configure" ] ; then + # Initial installation + systemctl preset mstored.service >/dev/null 2>&1 || : +fi diff --git a/debian/mstore-service.postrm b/debian/mstore-service.postrm new file mode 100755 index 0000000..c3c7ae1 --- /dev/null +++ b/debian/mstore-service.postrm @@ -0,0 +1,3 @@ +#!/bin/sh -e + +systemctl daemon-reload >/dev/null 2>&1 || : diff --git a/debian/mstore-service.preinst b/debian/mstore-service.preinst new file mode 100755 index 0000000..1057534 --- /dev/null +++ b/debian/mstore-service.preinst @@ -0,0 +1,20 @@ +#!/bin/sh +set -e + +case "$1" in + install|upgrade) + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + + +#DEBHELPER# + +exit 0 diff --git a/debian/mstore-service.prerm b/debian/mstore-service.prerm new file mode 100755 index 0000000..f69fc81 --- /dev/null +++ b/debian/mstore-service.prerm @@ -0,0 +1,7 @@ +#!/bin/sh -e + +if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then + # Package removal, not upgrade + systemctl --no-reload disable mstored.service > /dev/null 2>&1 || : + systemctl stop mstored.service > /dev/null 2>&1 || : +fi diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..4a97dfa --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +# You must remove unused comment lines for the released package. diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..b64dc0d --- /dev/null +++ b/debian/rules @@ -0,0 +1,11 @@ +#!/usr/bin/make -f + +export GO111MODULE=on + +%: + dh $@ + +override_dh_auto_configure: + ./configure --prefix=/usr + +#EOF diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..46ebe02 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) \ No newline at end of file diff --git a/debian/source/include-binaries b/debian/source/include-binaries new file mode 100644 index 0000000..e69de29 diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..9e7c0da --- /dev/null +++ b/debian/watch @@ -0,0 +1 @@ +version=3 diff --git a/initrc/mstored.service b/initrc/mstored.service deleted file mode 100644 index 2b9bee9..0000000 --- a/initrc/mstored.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=mstored - -[Service] -Type=forking -PIDFile=/home/ziggi/Projects/mstore/tmp/run/mstored.pid -ExecStart=/usr/local/sbin/mstored -daemon=true -ExecReload=/bin/kill -HUP $MAINPID - -[Install] -WantedBy=multi-user.target - diff --git a/test/account_test.go b/test/account_test.go index a8d9588..273f581 100644 --- a/test/account_test.go +++ b/test/account_test.go @@ -34,7 +34,7 @@ func TestAccountLife(t *testing.T) { { err = srv.Configure() require.NoError(t, err) - useTmp := false + useTmp := true if useTmp { srv.SetDatadir(srvdir) srv.SetLogdir(srvdir) diff --git a/test/file_test.go b/test/file_test.go index 42434c7..2c6218a 100644 --- a/test/file_test.go +++ b/test/file_test.go @@ -36,7 +36,7 @@ func xxxTestFileLife(t *testing.T) { err = srv.Configure() require.NoError(t, err) - useTmpDir := false + useTmpDir := true if useTmpDir { srv.SetDatadir(srvdir) srv.SetLogdir(srvdir) diff --git a/test/image_test.go b/test/image_test.go index c32fa29..e003046 100644 --- a/test/image_test.go +++ b/test/image_test.go @@ -33,7 +33,9 @@ func xxxTestImageLife(t *testing.T) { { err = srv.Configure() require.NoError(t, err) - if false { + + useTmp := true + if useTmp { srv.SetDatadir(srvdir) srv.SetLogdir(srvdir) srv.SetRundir(srvdir)