Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
cjsmeele committed Mar 26, 2018
2 parents 9b988e4 + a66fe67 commit 401b654
Show file tree
Hide file tree
Showing 37 changed files with 1,312 additions and 158 deletions.
11 changes: 1 addition & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
# Output files
*.slo
*.la
*.lo
*.o
*.so
/.libs
/doc

# Local files
/build
/dist
*~*
*.swp
*.swo
.clang_complete
GPATH
GRTAGS
Expand Down
125 changes: 94 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ cmake_minimum_required(VERSION 2.8.12)

project(davrods C)

set(IRODS_VERSION "4.2.1" CACHE STRING "iRODS client library version")
set(IRODSRT_VERSION "4.2.2" CACHE STRING "iRODS client library version")

set(DAVRODS_VERSION "${IRODS_VERSION}_1.3.0")
set(DAVRODS_FEATURE "1.4.0")
set(DAVRODS_VERSION "${IRODSRT_VERSION}_${DAVRODS_FEATURE}")
set(DAVRODS_VERSION_DEB "${IRODSRT_VERSION}-${DAVRODS_FEATURE}")

find_program(APXS apxs DOC "Apache/HTTPD extension tool location")
if(NOT APXS)
Expand All @@ -28,11 +30,21 @@ set(IRODS_INCLUDE_DIR "/usr/include/irods" CACHE STRING "iRODS include directory

if(IS_DIRECTORY /etc/httpd/conf.modules.d)
# This looks like CentOS7's httpd, we know where to put our files on install.
set(INSTALLABLE_ON_THIS_SYSTEM TRUE)
set(SYSTEM_LOOKS_LIKE "CentOS7")
elseif(IS_DIRECTORY /etc/apache2/mods-available)
# This looks like Debian/Ubuntu, we know where to put our files on install.
# Thanks to @holtgrewe for the initial porting work.
set(SYSTEM_LOOKS_LIKE "Debian")

# Debian notes, postinstall:
#
# a2enmod davrods
# a2enmod dav
# apache2ctl restart
else()
set(INSTALLABLE_ON_THIS_SYSTEM FALSE)
set(SYSTEM_LOOKS_LIKE "--Unknown--")
message(WARNING "
Davrods' build system currently only supports the cmake 'install' target on CentOS7-like systems.
Davrods' build system currently only supports the cmake 'install' target on CentOS7 and Debian-like systems.
If you are running CentOS or similar, make sure httpd is installed before running cmake: This build system requires certain HTTPD directories to be in place.
If you are running a different Linux distribution or if your HTTPD configuration layout differs otherwise, you can install Davrods manually after building. See the instructions in README.md.")
endif()
Expand Down Expand Up @@ -65,78 +77,105 @@ add_compile_options(-Wall
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro,-z,now")

set(SOURCES
mod_davrods.c
auth.c
common.c
config.c
prop.c
propdb.c
repo.c
lock_local.c)
src/mod_davrods.c
src/auth.c
src/common.c
src/config.c
src/prop.c
src/propdb.c
src/repo.c
src/lock_local.c
src/byterange.c)

add_library(mod_davrods SHARED ${SOURCES})

# Remove "lib" prefix from module SO file.
set_property(TARGET mod_davrods PROPERTY PREFIX "")

if(INSTALLABLE_ON_THIS_SYSTEM)
# Enable OS-dependent installation targets
if(SYSTEM_LOOKS_LIKE STREQUAL "CentOS7")
install(TARGETS mod_davrods
DESTINATION ${HTTPD_BUILDSYS_MODULE_DIR})

install(FILES davrods.conf
install(FILES aux/rpm/davrods.conf
DESTINATION /etc/httpd/conf.modules.d
RENAME 10-davrods.conf)

install(FILES davrods-vhost.conf
davrods-anonymous-vhost.conf
install(FILES aux/rpm/davrods-vhost.conf
aux/rpm/davrods-anonymous-vhost.conf
DESTINATION /etc/httpd/conf.d/)

install(FILES irods_environment.json
install(FILES aux/common/irods_environment.json
DESTINATION /etc/httpd/irods/)

install(FILES aux/listing/head.html
aux/listing/header.html
aux/listing/footer.html
aux/listing/README.md
install(FILES aux/common/listing/head.html
aux/common/listing/header.html
aux/common/listing/footer.html
aux/common/listing/README.md
DESTINATION /etc/httpd/irods/)

install(FILES README.md COPYING COPYING.LESSER
install(FILES README.md COPYING COPYING.LESSER changelog.txt
DESTINATION /usr/share/doc/davrods-${DAVRODS_VERSION}/)

install(DIRECTORY
DESTINATION /var/lib/davrods)

elseif(SYSTEM_LOOKS_LIKE STREQUAL "Debian")
install(TARGETS mod_davrods
DESTINATION ${HTTPD_BUILDSYS_MODULE_DIR})

install(FILES aux/deb/davrods.conf
DESTINATION /etc/apache2/mods-available
RENAME davrods.load)

install(FILES aux/deb/davrods-vhost.conf
aux/deb/davrods-anonymous-vhost.conf
DESTINATION /etc/apache2/sites-available/)

install(FILES aux/common/irods_environment.json
DESTINATION /etc/apache2/irods/)

install(FILES aux/common/listing/head.html
aux/common/listing/header.html
aux/common/listing/footer.html
aux/common/listing/README.md
DESTINATION /etc/apache2/irods/)

install(FILES README.md COPYING COPYING.LESSER changelog.txt
DESTINATION /usr/share/doc/davrods-${DAVRODS_VERSION}/)

install(DIRECTORY
DESTINATION /var/lib/davrods)
endif()

if(INSTALLABLE_ON_THIS_SYSTEM)
if(SYSTEM_LOOKS_LIKE STREQUAL "CentOS7")
set(CPACK_MONOLITHIC_INSTALL 1)
set(CPACK_CMAKE_GENERATOR "Unix Makefiles")
set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_NAME "davrods")
set(CPACK_PACKAGE_VENDOR "Utrecht University <[email protected]>")
set(CPACK_PACKAGE_CONTACT "Utrecht University <[email protected]>")
set(CPACK_PACKAGE_VERSION "${DAVRODS_VERSION}")
#set(CPACK_PACKAGE_VERSION_MAJOR "4")
#set(CPACK_PACKAGE_VERSION_MINOR "2")
#set(CPACK_PACKAGE_VERSION_PATCH "1")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/package/description.txt")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/aux/common/description.txt")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A DAV level 2 compliant Apache interface to iRODS")

set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.LESSER")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")

set(CPACK_RPM_PACKAGE_RELEASE "1")
set(CPACK_RPM_PACKAGE_LICENSE "LGPLv3+")
set(CPACK_RPM_PACKAGE_REQUIRES "httpd >= 2.4, irods-runtime = ${IRODS_VERSION}")
set(CPACK_RPM_PACKAGE_REQUIRES "httpd >= 2.4, irods-runtime = ${IRODSRT_VERSION}")
set(CPACK_RPM_PACKAGE_URL "https://github.com/UtrechtUniversity/davrods")
set(CPACK_RPM_CHANGELOG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/package/changelog.txt")
set(CPACK_RPM_CHANGELOG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/changelog.txt")
set(CPACK_RPM_PACKAGE_AUTOREQ 0)
set(CPACK_RPM_PACKAGE_AUTOPROV 0)
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/package/postinst.sh")
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/aux/rpm/postinst.sh")

set(CPACK_RPM_USER_FILELIST
"%doc /usr/share/doc/davrods-${DAVRODS_VERSION}/README.md"
"%doc /usr/share/doc/davrods-${DAVRODS_VERSION}/COPYING"
"%doc /usr/share/doc/davrods-${DAVRODS_VERSION}/COPYING.LESSER"
"%doc /usr/share/doc/davrods-${DAVRODS_VERSION}/changelog.txt"
"%config(noreplace) /etc/httpd/conf.modules.d/10-davrods.conf"
"%config(noreplace) /etc/httpd/conf.d/davrods-vhost.conf"
"%config(noreplace) /etc/httpd/conf.d/davrods-anonymous-vhost.conf"
Expand All @@ -149,4 +188,28 @@ if(INSTALLABLE_ON_THIS_SYSTEM)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}")

include(CPack)

elseif(SYSTEM_LOOKS_LIKE STREQUAL "Debian")
set(CPACK_MONOLITHIC_INSTALL 1)
set(CPACK_CMAKE_GENERATOR "Unix Makefiles")
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_NAME "davrods")
set(CPACK_PACKAGE_VENDOR "Utrecht University <[email protected]>")
set(CPACK_PACKAGE_CONTACT "Utrecht University <[email protected]>")
set(CPACK_PACKAGE_VERSION "${DAVRODS_VERSION_DEB}")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/aux/common/description.txt")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A DAV level 2 compliant Apache interface to iRODS")

set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.LESSER")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")

set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "apache2 (>= 2.4), irods-runtime (= ${IRODSRT_VERSION})")
set(CPACK_DEBIAN_PACKAGE_SECTION "httpd")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/aux/deb/postinst")

set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")

include(CPack)

endif()
98 changes: 64 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,39 @@ Themeable listings and anonymous access were inspired by Simon Tyrrell's

## Download ##

There are currently two supported Davrods versions:

- [`davrods-4.1_1.3.0`](https://github.com/UtrechtUniversity/davrods/releases/tag/4.1_1.3.0), branch `irods-4.1-libs`
- [`davrods-4.2.1_1.3.0`](https://github.com/UtrechtUniversity/davrods/releases/tag/4.2.1_1.3.0), branch `master`

The left side of the version number indicates the version of the iRODS
client libraries that Davrods uses.

When installing Davrods on the same machine as an iRODS server, the
version of Davrods must match the iRODS version. Otherwise, both Davrods
versions listed above will work with either iRODS server version.
Please choose the right version for your platform:

1. If you run Davrods on the same server as your iRODS service, you need a
Davrods version built against the same version iRODS *runtime*.
2. If you run Davrods separately, on its own server, then the iRODS runtime
version does not matter - just pick the newest Davrods you can get.
All Davrods packages below should be compatible with any iRODS 4.x
server version.

| Davrods ver. | iRODS runtime ver. | Packages |
| ------------ | ------------------ | --------------------------------------------------------------------------------- |
| 1.4.0 | 4.2.2 | [RPM, DEB](https://github.com/UtrechtUniversity/davrods/releases/tag/4.2.2_1.4.0) |
| 1.3.0 | 4.2.1 | [RPM](https://github.com/UtrechtUniversity/davrods/releases/tag/4.2.1_1.3.0) |
| 1.3.0 | 4.1.x | [RPM](https://github.com/UtrechtUniversity/davrods/releases/tag/4.1_1.3.0) |
| 1.2.0 | 4.2.1 | [RPM](https://github.com/UtrechtUniversity/davrods/releases/tag/4.2.1_1.2.0) |
| 1.2.0 | 4.1.x | [RPM](https://github.com/UtrechtUniversity/davrods/releases/tag/4.1_1.2.0) |
| 1.1.1 | 4.2.1 | [RPM](https://github.com/UtrechtUniversity/davrods/releases/tag/4.2.1_1.1.1) |
| 1.1.1 | 4.1.x | [RPM](https://github.com/UtrechtUniversity/davrods/releases/tag/4.1_1.1.1) |

If you require a certain Davrods/iRODS runtime version combination that
is not listed above, you can most likely still build it yourself (see
"Building from source").

A log describing which features were added and which bugs were fixed in
each version can be found in [changelog.txt](changelog.txt).

We currently distribute RPM packages for CentOS 7 & RHEL systems and
DEB packages for Debian & Ubuntu systems.
We test our packages on CentOS 7 and (as of Davrods 1.4.0) Ubuntu 16.04.

## Installation ##

This section describes the installation steps for `davrods-4.2.1_1.3.0`.
This section describes the installation steps for `davrods-4.2.1_1.4.0`.

To view instructions for `davrods-4.1_1.3.0`, switch to the
[`irods-4.1-libs`](https://github.com/UtrechtUniversity/davrods/tree/irods-4.1-libs)
Expand All @@ -50,19 +68,19 @@ distributed at https://packages.irods.org/

After following the instructions for adding the iRODS repository to your
package manager at the link above, Davrods can be installed as a binary
package using the RPM on the [releases page](https://github.com/UtrechtUniversity/davrods/releases/tag/4.2.1_1.3.0).
package using the RPM or DEB file from the
[releases page](https://github.com/UtrechtUniversity/davrods/releases)
(use the table near the top of this README to select the right version).

Download the Davrods package for your platform and install it using your
package manager, for example:

yum install davrods-4.2.1_1.3.0-1.rpm
yum install davrods-4.2.2_1.4.0-1.rpm
--or--
dpkg -i davrods-4.2.2_1.4.0.deb

We currently distribute RPM packages for CentOS 7 only.
If you require packaging for a different platform, please contact us
by creating an issue.

See the __Configuration__ section for instructions on how to configure
Davrods once it has been installed.
Now see the __Configuration__ section for instructions on how to
configure Davrods once it has been installed.

### Davrods and SELinux ##

Expand Down Expand Up @@ -168,18 +186,18 @@ cmake ..
make
```

Now you can either build an RPM or install the project without a package
manager. Packaging for Linux distributions other than CentOS-likes is
not yet supported.
Now you can either build an RPM/DEB or install the project without a
package manager. Packaging for Linux distributions other than
CentOS-likes is not yet supported.

**To create a package:**

```
make package
```

That's it, you should now have an RPM in your build directory which you
can install using yum.
That's it, you should now have an RPM or DEB in your build directory
which you can install using yum or apt.

**To install without a package manager on CentOS:**

Expand All @@ -191,11 +209,23 @@ chown apache:apache /var/lib/davrods
chmod 700 /var/lib/davrods
```

**To install without a package manager on Debian:**

Run the following as user root:

```
make install
chown www-data:www-data /var/lib/davrods
chmod 700 /var/lib/davrods
```

**To install without a package manager on other distros:**

Distributions other than CentOS (e.g. Ubuntu) have different HTTPD
configuration layouts, which are not yet supported by the build system.
For this reason you will need to install the files manually:
Linux distributions other than RHEL, Debian and their derivatives may
have different HTTPD configuration and directory layouts, which are not
currently supported by the build system.
For this reason you will need to install the files manually on such
Linux distributions:

- Copy `mod_davrods.so` to your Apache module directory.
- Copy `davrods.conf` to your Apache module configuration/load directory.
Expand All @@ -205,7 +235,7 @@ For this reason you will need to install the files manually:
access.
- Copy `irods_environment.json` to the `irods` directory.
- Create directory `/var/lib/davrods`, and give apache exclusive access
to it: `chown apache:apache /var/lib/davrods; chmod 700 /var/lib/davrods`
to it.

## Bugs and ToDos ##

Expand All @@ -225,12 +255,12 @@ page.

## License ##

Copyright (c) 2016, 2017, Utrecht University.
Copyright (c) 2016 - 2018, Utrecht University.

Davrods is licensed under the GNU Lesser General Public License version
3 or higher (LGPLv3+). See the COPYING.LESSER file for details.

The `lock_local.c` file was adapted from the source of `mod_dav_lock`,
a component of Apache HTTPD, and is used with permission granted by
the Apache License. See the copyright and license notices in this file
for details.
The `lock_local.c` and `byterange.c` files were adapted from components
of Apache HTTPD, and are used with permission granted by the Apache
License. See the copyright and license notices in these files for
details.
7 changes: 7 additions & 0 deletions aux/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Auxiliary files

This directory contains Davrods' auxiliary files, e.g. Apache
configuration files and RPM/DEB metadata.

Files in `common/` are platform-independent. Other files are
platform-specific.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 401b654

Please sign in to comment.