Skip to content

Commit

Permalink
Final changes to comply with Fedora guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
juliogonzalez committed Sep 24, 2018
1 parent e48a600 commit ef0ec63
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 38 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ s3fs:
* libcurl-devel
* libxml2-devel
* openssl-devel
* pkgconfig
* epel-rpm-macros (only for CentOS/RHEL6, from the EPEL6 repository)


Building fresh RPMs
Expand All @@ -64,7 +66,7 @@ Rebuild:

And install

rpm -Uvh RPMS/$HOSTTYPE/fuse-2.8.5-99.vitki.03.*.$HOSTTYPE.rpm RPMS/$HOSTTYPE/fuse-devel-2.8.5-99.vitki.03.*.$HOSTTYPE.rpm RPMS/$HOSTTYPE/fuse-libs-2.8.5-99.vitki.03.*.$HOSTTYPE.rpm
rpm -Uvh RPMS/$HOSTTYPE/fuse-devel-2.8.5-99.vitki.03.*.$HOSTTYPE.rpm RPMS/$HOSTTYPE/fuse-libs-2.8.5-99.vitki.03.*.$HOSTTYPE.rpm


Build the s3fs-fuse RPMs
Expand Down
55 changes: 27 additions & 28 deletions SPECS/s3fs-fuse.spec
Original file line number Diff line number Diff line change
@@ -1,66 +1,65 @@
%global _hardened_build 1
%global _release_simple 2
%{!?make_build: %global make_build %{__make} %{?_smp_mflags}}

Name: s3fs-fuse
Version: 1.84

Release: %{_release_simple}%{?dist}
Release: 2%{?dist}
Summary: FUSE-based file system backed by Amazon S3

License: GPLv2
License: GPLv2+
URL: https://github.com/s3fs-fuse/s3fs-fuse
Source0: https://github.com/s3fs-fuse/s3fs-fuse/archive/v%{version}.tar.gz
Source1: https://github.com/juliogonzalez/s3fs-fuse-rpm/blob/%{version}-%{_release_simple}/SOURCES/passwd-s3fs
Source0: https://github.com/s3fs-fuse/s3fs-fuse/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: passwd-s3fs

Requires: fuse >= 2.8.4

This comment has been minimized.

Copy link
@chrisbarnett1

chrisbarnett1 Oct 8, 2018

I think fuse should be required. Did the Fedora guidelines require this to be removed?

This comment has been minimized.

Copy link
@juliogonzalez

juliogonzalez Oct 8, 2018

Author Owner

Yes, it was discussed at https://bugzilla.redhat.com/show_bug.cgi?id=1631988#c2, https://bugzilla.redhat.com/show_bug.cgi?id=1631988#c4 and at s3fs-fuse/s3fs-fuse#826 (accepted by upstream).

The runtime requirement, at least on SUSE, openSUSE, Fedora, and EPEL7 (centOS 7) is fuse-libs (fuse-devel is also required to compile and build the package, expressed here as pkgconfig(fuse)), and it worked (I could list stuff inside buckets and get a file on Fedora and CentOS, and verified that the SUSE spec does not require fuse neither)

Do you have any specific distribution or use case in mind where fuse itself can be required?

This comment has been minimized.

Copy link
@chrisbarnett1

chrisbarnett1 via email Oct 9, 2018

This comment has been minimized.

Copy link
@juliogonzalez

juliogonzalez Oct 9, 2018

Author Owner

It seems we have a bug then, maybe at Fedora and openSUSE families.

I will give it a try with a couple of VMs and if that's the case will open bug for both distributions and will fix them.

Thanks for reporting it!

This comment has been minimized.

Copy link
@juliogonzalez

juliogonzalez Oct 9, 2018

Author Owner

Only now I noticed that I had issues disable at the repository.

I just enabled them and created one for this: #9

# s3fs-fuse requires at least fuse 2.8.4, which is not available for
# CentOS/RHEL6
# See https://github.com/s3fs-fuse/s3fs-fuse/issues/42
Requires: fuse-libs >= 2.8.4
Requires: curl >= 7.0
Requires: libxml2 >= 2.6
Requires: openssl >= 0.9

BuildRequires: curl-devel, fuse-devel, libxml2-devel, openssl-devel
BuildRequires: automake, gcc-c++, make
BuildRequires: automake
BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: pkgconfig
BuildRequires: pkgconfig(fuse) >= 2.8.4
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(openssl)
# fuse-s3fs has a binary s3fs too
Conflicts: fuse-s3fs
Obsoletes: s3fs

%description
s3fs is a FUSE file system that allows you to mount an Amazon S3 bucket as a
local file system. It stores files natively and transparently in S3 (i.e.,
you can use other programs to access the same files). Maximum file size=64GB
(limited by s3fs, not Amazon).
.

s3fs is stable and is being used in number of production environments, e.g.,
rsync backup to s3.

%global debug_package %{nil}

%prep
%setup -q

%autosetup
cp -p %{SOURCE1} passwd-s3fs

%build
./autogen.sh
%configure
make %{?_smp_mflags}

%make_build

%install
make install DESTDIR=%{buildroot}
cp -p %{SOURCE1} passwd-s3fs

%make_install

%files
%{_bindir}/s3fs
%{_mandir}/man1/s3fs.1*
%doc AUTHORS README.md ChangeLog COPYING passwd-s3fs

%doc AUTHORS README.md ChangeLog passwd-s3fs
%{!?_licensedir:%global license %doc}
%license COPYING

%changelog
* Sat Sep 22 2018 Julio Gonzalez Gil <git@juliogonzalez.es> - 1.84-2
- Build with PIE enabled, as it is required by Fedora
- Remove Group tag, as required by Fedora
- General cleanup to adapt to Fedora guidelines
- Build with PIE enabled (required by Fedora)
- Remove unneeded build requirement for mailcap
- Fix URLs for s3fs-fuse sources

* Sun Jul 8 2018 Julio Gonzalez Gil <git@juliogonzalez.es> - 1.84-1
- Initial build of 1.84 from https://github.com/s3fs-fuse/s3fs-fuse
Expand Down
11 changes: 8 additions & 3 deletions ci
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,12 @@ docker container run -i ${TTY} --name "${CONTAINER_NAME}" -v ${PWD}:/tmp/s3fs-fu
print_info "Cleaning up"
docker_run "${CONTAINER_NAME}" "./clean"
print_info "Installing required dependencies..."
docker_run "${CONTAINER_NAME}" "/usr/bin/yum -q -y install automake make git rpm-build" # Common dependencies
docker_run "${CONTAINER_NAME}" "/usr/bin/yum -q -y install automake make git rpm-build pkgconfig" # Common dependencies
docker_run "${CONTAINER_NAME}" "/usr/bin/yum -q -y install gcc-c++ libcurl-devel libxml2-devel openssl-devel" # s3fs dependencies
if [ "${DISTRO}" == "centos6" ]; then
docker_run "${CONTAINER_NAME}" "/usr/bin/yum -q -y install epel-release" # Install EPEL repository
docker_run "${CONTAINER_NAME}" "/usr/bin/yum -q -y install epel-rpm-macros" # Install epel-rpm-macros, required for macros not available by default
fi
docker_run "${CONTAINER_NAME}" "/usr/bin/yum -q -y install initscripts kernel mailcap openssl" # Other dependencies only needed at docker
print_info "Configuring user ci..."
docker_run "${CONTAINER_NAME}" "/usr/sbin/groupadd -g $(id -g) ci"
Expand All @@ -131,14 +135,15 @@ if [ ! -z ${BUILD_FUSE} ]; then
print_info "Building fuse (required by ${DISTRO})..."
docker_run "${CONTAINER_NAME}" "./fuse-rpm" "ci"
print_info "Installing fuse..."
docker_run "${CONTAINER_NAME}" "/bin/rpm -i RPMS/$HOSTTYPE/fuse-2.8.5-99.vitki.03.*.$HOSTTYPE.rpm RPMS/$HOSTTYPE/fuse-devel-2.8.5-99.vitki.03.*.$HOSTTYPE.rpm RPMS/$HOSTTYPE/fuse-libs-2.8.5-99.vitki.03.*.$HOSTTYPE.rpm"
docker_run "${CONTAINER_NAME}" "/bin/rpm -i RPMS/$HOSTTYPE/fuse-devel-2.8.5-99.vitki.03.*.$HOSTTYPE.rpm RPMS/$HOSTTYPE/fuse-libs-2.8.5-99.vitki.03.*.$HOSTTYPE.rpm"
else
print_info "Installing fuse..."
docker_run "${CONTAINER_NAME}" "/usr/bin/yum -q -y install fuse fuse-devel" # fuse
docker_run "${CONTAINER_NAME}" "/usr/bin/yum -q -y install fuse-libs fuse-devel" # fuse
fi
print_info "Building s3fs-fuse package..."
docker_run "${CONTAINER_NAME}" "./s3fs-build-rpm" "ci"
print_info "Installing s3fs-fuse package..."
docker_run "${CONTAINER_NAME}" "/bin/rpm -e fuse-devel"
docker_run "${CONTAINER_NAME}" "/bin/rpm -i RPMS/$HOSTTYPE/s3fs-fuse-*.*.$HOSTTYPE.rpm"
print_info "Removing container..."
remove_container ${CONTAINER_NAME}
Expand Down
9 changes: 3 additions & 6 deletions s3fs-build-rpm
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
#!/bin/bash
VERSION='1.84'
SOURCE_URL=

SPEC='SPECS/s3fs-fuse.spec'
VERSION=$(sed -rn 's/Version:\s*(.*)/\1/p' ${SPEC})
SOURCE_URL=$(sed -rn 's/Source0:\s*(.*)/\1/p' ${SPEC}|sed -e "s/%{version}/${VERSION}/")
NAME=$(sed -rn 's/Name:\s*(.*)/\1/p' ${SPEC})
SOURCE_URL=$(sed -rn 's/Source0:\s*(.*)/\1/p' ${SPEC}|sed -e "s/%{name}/${NAME}/g"|sed -e "s/%{version}/${VERSION}/g")
TARBALL="./SOURCES/$(basename ${SOURCE_URL})"

if [ ! -f "${TARBALL}" ]; then
echo "### Downloading s3fs-fuse sources..."
curl -L "${SOURCE_URL}" -o "${TARBALL}"
if [ $? -ne 0 ]; then
echo "Could not download fuse-${VERSION}.tar.gz! Check log!"
echo "Could not download ${TARBALL}! Check log!"
exit 1
fi
fi
Expand Down

0 comments on commit ef0ec63

Please sign in to comment.