Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for fedora-28 builds #459

Merged
merged 1 commit into from
Nov 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ This is a fuse-based DAV client with extensions for performance.
This will run against any standard DAV implementation, i.e.
`pywebdav` (see tests).


Installation
------------

Expand All @@ -18,24 +17,29 @@ Installation
Usage
-----

Use the ```-v``` flag to see libraries.
Use the ```-V``` flag to see libraries.
```
$ src/fusedav -v
fusedav version 2.0.5e59b8c
LevelDB version 1.12
libcurl/7.29.0 NSS/3.15.2 zlib/1.2.7 libidn/1.26 libssh2/1.4.3
FUSE library version: 2.9.3
using FUSE kernel interface version 7.19
$ src/fusedav -V
fusedav version 2.0.42-bccf93b
LevelDB version 1.20
libcurl/7.59.0 OpenSSL/1.1.0i zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.4) libssh/0.8.5/openssl/zlib nghttp2/1.32.1
FUSE library version: 2.9.7
```


Debug/Develop
-----
Running this docker script in debug mode will build a fedora-22 container with the local source mounted inside it suitable to build fusedav.
```
BUILD_VERSIONS=22 BUILD_DEBUG=1 ./scripts/docker-outer.sh
```

libcurl and OpenSSL
-------------------

FuseDAV requires libcurl linked with OpenSSL. On Fedora versions before 27 the
provided libcurl is linked against NSS and you need to provide your own libcurl
linked against OpenSSL.

Contributing
------------

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ AC_CHECK_LIB([jemalloc], [malloc], [:], [AC_MSG_ERROR(jemalloc not found or func

AC_CHECK_HEADER(expat.h, [], [AC_MSG_ERROR(expat.h not found. Install Expat.)], [])

PKG_CHECK_MODULES(SYSTEMD, [ libsystemd-journal ] )
PKG_CHECK_MODULES(SYSTEMD, [ libsystemd ] )
PKG_CHECK_MODULES(LEVELDB, [ leveldb ])
PKG_CHECK_MODULES(CURL, [ libcurl >= 7.24.0 ])
PKG_CHECK_MODULES(FUSE, [ fuse >= 2.8 ])
Expand Down
8 changes: 4 additions & 4 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ The scripts herein are invoked by CircleCI via the circle.yml. They use docker c

## Environment Variables
* CIRCLE_BUILD_NUM - Used to determine the build iterator. Defaults to 0 if not present
* BUILD_VERSIONS - a shell array of fedora versions to build for. Defaults to (20 22)
* BUILD_VERSIONS - a shell array of fedora versions to build for.
* BUILD_DEBUG - If present triggers the build scripts to drop you into a shell for the docker container.

## Local building of dev packages
Building local is simple, first invoke the version.sh to generate the VERSION and CHANNEL files, and call docker-outter.sh. This assumes you have a working docker setup.
Building local is simple, first invoke the version.sh to generate the VERSION and CHANNEL files, and call docker-outer.sh. This assumes you have a working docker setup.

```
./scripts/version.sh
./scripts/docker-outer.sh
```

## Debuging Builds
To get a shell in a docker build container use `BUILD_DEBUG=1` `BUILD_VERSIONS` and invoke `docker-outter.sh`
To get a shell in a docker build container use `BUILD_DEBUG=1` `BUILD_VERSIONS` and invoke `docker-outer.sh`

```
BUILD_DEBUG=1 BUILD_VERSIONS=22 ./scripts/docker-outer.sh
Expand Down Expand Up @@ -49,7 +49,7 @@ If you want to get into a container for debugging you can export BUILD_DEBUG wit
...
Digest: sha256:b0f4562429925a8be579eb7b86fea8fe8e676b7a962bba8d6bf372fb68b396d7
Status: Image is up to date for quay.io/getpantheon/rpmbuild-fusedav:20
Running: docker run --rm -ti -e "build=0" -w /src -v /Users/jnelson/orgs/pantheon/fusedav/scripts/../:/src quay.io/getpantheon/rpmbuild-fusedav:20 /bin/bash
Running: docker run --rm -ti -e "build=0" -w /src -v /Users/jnelson/orgs/pantheon/fusedav/scripts/../:/src quay.io/getpantheon/rpmbuild-fusedav:20 /bin/bash
[root@d868541bc6ae src]#
```

Expand Down
26 changes: 15 additions & 11 deletions scripts/docker-inner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,21 @@ description='Fusedav: Pantheon fuse-based DAV client'
fusedav_name="fusedav-$fusedav_channel"
install_prefix="/opt/pantheon/$name"

# copy pre-compiled vanilla libcurl into $install_prefix/$name/libs
# the curl lib is part of the upstream container
curl_libdir=$install_prefix/libs
# If the "/curl-7.4.6.0" directory exists in the build container it means we are using a
# custom build of curl linked with openssl. This is because libcurl on fedora < 27 used NSS instead of openssl
# https://fedoraproject.org/wiki/Changes/libcurlBackToOpenSSL
if [[ -d "/curl-7.46.0" ]]; then
curl_libdir=$install_prefix/libs

if [ ! -d "$curl_libdir" ]; then
mkdir -p $curl_libdir
fi
cp -R /curl-7.46.0/lib/.libs/* $curl_libdir
# copy pre-compiled vanilla libcurl into $install_prefix/$name/libs if the curl lib is part of the upstream container
if [ ! -d "$curl_libdir" ]; then
mkdir -p $curl_libdir
fi
cp -R /curl-7.46.0/lib/.libs/* $curl_libdir

# use our custom curl, and compile fusedav
export CFLAGS="-Wl,-rpath,$curl_libdir,-rpath-link,$curl_libdir -L$curl_libdir -lcurl"
# use our custom curl, and compile fusedav
export CFLAGS="-Wl,-rpath,$curl_libdir,-rpath-link,$curl_libdir -L$curl_libdir -lcurl"
fi

./autogen.sh
CURL_LIBS="-lcurl" ./configure
Expand All @@ -52,6 +56,7 @@ fi

# test that fusedav at least runs
set +e
/usr/local/bin/fusedav -V
/usr/local/bin/fusedav --help
if [ "1" != "$?" ] ; then
echo "fusedav binary seems broken, failing to continue"
Expand All @@ -75,8 +80,7 @@ fpm -s dir -t rpm \
--depends fuse-libs \
--depends leveldb \
--log=debug \
$install_prefix/$name \
$install_prefix/libs \
$install_prefix \
/usr/sbin/mount.$name

if [ ! -d "$rpm_dir/$fedora_release/fusedav" ] ; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/docker-outer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
docker=$(which docker)

# which fedora distros to build this rpm for
BUILD_VERSIONS=${BUILD_VERSIONS:-22}
BUILD_VERSIONS=${BUILD_VERSIONS:-22 28}

echo "==> Running RPM builds for these Fedora version(s): $BUILD_VERSIONS"

Expand Down
2 changes: 1 addition & 1 deletion scripts/push_packagecloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [ -z "$1" ] ; then
exit 1
fi

BUILD_VERSIONS=${BUILD_VERSIONS:-22}
BUILD_VERSIONS=${BUILD_VERSIONS:-22 28}
for i in $BUILD_VERSIONS ; do
package_cloud push "pantheon/$1/fedora/$i" $bin/../pkg/$i/fusedav/*.rpm
done
4 changes: 2 additions & 2 deletions scripts/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ function gittag {
git push origin --tags
}

BUILD=$CIRCLE_BUILD_NUM
if [ -z "$CIRCLE_BUILD_NUM" ] ; then
BUILD=${CIRCLE_BUILD_NUM:-}
if [ -z "$BUILD" ] ; then
BUILD=0
fi

Expand Down