diff --git a/DEBIAN/changelog b/DEBIAN/changelog new file mode 100644 index 0000000000..b3baea62a3 --- /dev/null +++ b/DEBIAN/changelog @@ -0,0 +1,5 @@ +gcsfuse (1.0.0) stable; urgency=medium + + * Package created with dpkg-deb --build + + -- GCSFuse Team Thu, 13 Jul 2023 05:37:50 +0000 diff --git a/DEBIAN/control b/DEBIAN/control new file mode 100644 index 0000000000..3ea7eb258a --- /dev/null +++ b/DEBIAN/control @@ -0,0 +1,12 @@ +Version: 1.0.0 +Source: gcsfuse +Maintainer: GCSFuse Team +Homepage: https://github.com/GoogleCloudPlatform/gcsfuse +Package: gcsfuse +Architecture: amd64 +Depends: libc6 (>= 2.3.2), fuse +Description: User-space file system for Google Cloud Storage. + GCSFuse is a FUSE adapter that allows you to mount and access Cloud Storage + buckets as local file systems, so applications can read and write objects in + your bucket using standard file system semantics. Cloud Storage FUSE is an + open source product that's supported by Google. diff --git a/DEBIAN/copyright b/DEBIAN/copyright new file mode 100644 index 0000000000..201944d993 --- /dev/null +++ b/DEBIAN/copyright @@ -0,0 +1,23 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: gcsfuse +Upstream-Contact: gcs-fuse-maintainers@google.com + +Files: * +Copyright: Copyright 2020 Google Inc. +License: Apache-2.0 + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian systems, the complete text of the Apache version 2.0 license + can be found in "/usr/share/common-licenses/Apache-2.0". diff --git a/DEBIAN/gcsfuse-docs.docs b/DEBIAN/gcsfuse-docs.docs new file mode 100644 index 0000000000..a2511a80a8 --- /dev/null +++ b/DEBIAN/gcsfuse-docs.docs @@ -0,0 +1,3 @@ +https://cloud.google.com/storage/docs/gcs-fuse +https://github.com/GoogleCloudPlatform/gcsfuse#readme +https://github.com/GoogleCloudPlatform/gcsfuse/tree/master/docs diff --git a/tools/package_gcsfuse_docker/Dockerfile b/tools/package_gcsfuse_docker/Dockerfile index 2eef93278a..48abaaa077 100644 --- a/tools/package_gcsfuse_docker/Dockerfile +++ b/tools/package_gcsfuse_docker/Dockerfile @@ -31,6 +31,9 @@ ENV GCSFUSE_PATH "$GOPATH/src/$GCSFUSE_REPO" RUN go get -d ${GCSFUSE_REPO} WORKDIR ${GCSFUSE_PATH} +ARG DEBEMAIL="gcs-fuse-maintainers@google.com" +ARG DEBFULLNAME="GCSFuse Team" + # Build Arg for building through a particular branch/commit. By default, it uses # the tag corresponding to passed GCSFUSE VERSION ARG BRANCH_NAME="v${GCSFUSE_VERSION}" @@ -39,26 +42,35 @@ RUN git checkout "${BRANCH_NAME}" # Install fpm package using bundle RUN bundle install --gemfile=${GCSFUSE_PATH}/tools/gem_dependency/Gemfile -ARG GCSFUSE_BIN="/gcsfuse" +ARG GCSFUSE_BIN="/gcsfuse_${GCSFUSE_VERSION}_amd64" +ARG GCSFUSE_DOC="${GCSFUSE_BIN}/usr/share/doc/gcsfuse" WORKDIR ${GOPATH} RUN go install ${GCSFUSE_REPO}/tools/build_gcsfuse RUN mkdir -p ${GCSFUSE_BIN} RUN build_gcsfuse ${GCSFUSE_PATH} ${GCSFUSE_BIN} ${GCSFUSE_VERSION} RUN mkdir -p ${GCSFUSE_BIN}/usr && mv ${GCSFUSE_BIN}/bin ${GCSFUSE_BIN}/usr/bin +# Creating structure for debian package as we are using 'dpkg-deb --build' to create debian package +RUN mkdir -p ${GCSFUSE_BIN}/DEBIAN && cp $GOPATH/src/$GCSFUSE_REPO/DEBIAN/* ${GCSFUSE_BIN}/DEBIAN/ +RUN mkdir -p ${GCSFUSE_DOC} +RUN mv ${GCSFUSE_BIN}/DEBIAN/copyright ${GCSFUSE_DOC} && \ + mv ${GCSFUSE_BIN}/DEBIAN/changelog ${GCSFUSE_DOC} && \ + mv ${GCSFUSE_BIN}/DEBIAN/gcsfuse-docs.docs ${GCSFUSE_DOC} +# Update gcsfuse version in changelog and control file +RUN sed -i "1s/.*/gcsfuse (${GCSFUSE_VERSION}) stable; urgency=medium/" ${GCSFUSE_DOC}/changelog && \ + sed -i "1s/.*/Version: ${GCSFUSE_VERSION}/" ${GCSFUSE_BIN}/DEBIAN/control +# Compress changelog as required by lintian +RUN gzip -9 -n ${GCSFUSE_DOC}/changelog +# Strip unneeded from binaries as required by lintian +RUN strip --strip-unneeded ${GCSFUSE_BIN}/usr/bin/gcsfuse && \ + strip --strip-unneeded ${GCSFUSE_BIN}/sbin/mount.gcsfuse + ARG GCSFUSE_PKG="/packages" RUN mkdir -p ${GCSFUSE_PKG} WORKDIR ${GCSFUSE_PKG} -RUN fpm \ - -s dir \ - -t deb \ - -n gcsfuse \ - -C ${GCSFUSE_BIN} \ - -v ${GCSFUSE_VERSION} \ - -d fuse \ - --vendor "" \ - --url "https://$GCSFUSE_REPO" \ - --description "A user-space file system for Google Cloud Storage." +# Build the package +RUN dpkg-deb --build ${GCSFUSE_BIN} +RUN mv ${GCSFUSE_BIN}.deb . RUN fpm \ -s dir \ -t rpm \ @@ -67,6 +79,7 @@ RUN fpm \ -v ${GCSFUSE_VERSION} \ -d fuse \ --rpm-digest sha256 \ + --license Apache-2.0 \ --vendor "" \ --url "https://$GCSFUSE_REPO" \ --description "A user-space file system for Google Cloud Storage."