working commit

This commit is contained in:
2026-02-14 22:46:32 +02:00
parent 1e03fa349f
commit 73e2b804ff
31 changed files with 597 additions and 35 deletions
+152 -2
View File
@@ -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