diff -Nru gerbera-1.6.0/.builds/freebsd.yml gerbera-1.8.2/.builds/freebsd.yml --- gerbera-1.6.0/.builds/freebsd.yml 1970-01-01 00:00:00.000000000 +0000 +++ gerbera-1.8.2/.builds/freebsd.yml 2021-05-31 22:04:08.000000000 +0000 @@ -0,0 +1,33 @@ +image: freebsd/12.x +packages: + - cmake + - sudo + - curl + - wget + - pugixml + - upnp + - duktape-lib + - spdlog + - magic + - taglib + - ffmpeg + - ffmpegthumbnailer + - libexif + - libmatroska + - libiconv + - sqlite3 +sources: + - https://github.com/gerbera/gerbera +tasks: + - install-deps: | + sudo bash ./gerbera/scripts/install-googletest.sh + - build: | + mkdir build + cd build + CXXFLAGS="-DLIBICONV_PLUG" cmake ../gerbera \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ + -DWITH_INOTIFY=0 -DWITH_MAGIC=1 -DWITH_MYSQL=0 -DWITH_CURL=1 -DWITH_JS=1 \ + -DWITH_TAGLIB=1 -DWITH_AVCODEC=1 -DWITH_FFMPEGTHUMBNAILER=1 \ + -DWITH_EXIF=1 -DWITH_LASTFM=0 -DWITH_SYSTEMD=0 -DWITH_DEBUG=1 -DWITH_TESTS=1 + make -j2 + make test diff -Nru gerbera-1.6.0/ChangeLog.md gerbera-1.8.2/ChangeLog.md --- gerbera-1.6.0/ChangeLog.md 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/ChangeLog.md 2021-05-31 22:04:08.000000000 +0000 @@ -1,8 +1,275 @@ ## Gerbera - UPnP AV Mediaserver. -### v1.1.0 +### v1.8.2 + +- Disable transactions by default +- Refactor sort parsing to make it testable +- Support configuration of structured layout +- Factor out handling of config definitions into separate class +- Display default config values on Web UI +- initialize several unique_ptrs +- move resize option to constructor +- string_view to string conversions +- pass SearchLexer by value +- return std::nullopt for std::optional +- remove pointless const_cast +- Improve handling of default config values +- several clang-tidy and manual cleanups +- Fix parseSortStatement +- mostly pass by value changes +- Revert last_write_time to seconds since 1970 +- Encoding of web editor arguments +- clang-analyzer and misc +- Search query sign from beginning +- use C++ cast +- manual destructor changes +- Fix double truncation of playlist name +- clang: add missing moves +- clang: remove CTAD in some places +- Generate correct statement for metadata table +- clang fixes +- Make transactions for SQLite thread safe +- CI: Bump Clang version +- random stuff +- add support for Cygwin +- Enable tests for non-git-builds + +### v1.8.1 +- Mysql transactions +- Support creation_time on FFmpeg handler. +- Bump lodash from 4.17.19 to 4.17.21 in /gerbera-web +- Synchronize threads properly +- add missing optional header for GCC11 +- Misc improvements +- remove several implicit fs::path conversions +- Concatenate multivalue field with entrySeparator +- Revert "replace find() end() comparisons with count()" +- remove push_back branch +- change some size_t to bool +- remove some pointless lambdas +- remove std::distance where empty is sufficient +- Implement SAMSUNG X_GetFeatureList +- More chrono optimizations +- CI: FreeBSD: Add Sqlite3 package +- algorithm cleanups +- Added documentation how to build the docker container +- Determine container art image from files +- massive std::chrono conversion +- string_view conversions +- Add support for Windows Media Player +- Conan: Tidy up CMake conan integration +- Implement UPnP SortCriteria +- Avoid needless process elevation requirement on illumos +- cmake: Remove unused vars +- Only use music tracks as container art source +- Work around undefined syscalls on solaroid systems +- Documentation for exiv2 meta data usage +- Clean compilation and errno fix +- Enable ContainerArt for PC Directory +- auto&& conversions +- Docker.md: add docker-compose instructions +- fs::path conversions +- Fix debian buster compilation +- Cleanup path handling +- add -d, -u and -P commandline options to docs +- Fixed required versions of libupnp and libnpupnp. +- fix UPNP_USING_CHUNKED breaks npupnp compatibility +- clang-tidy: replace typedef with using +- Add cmdline options -u, -d and -P +- Fix transcoded media ends before file is complete +- Documentation still points to bintray.com +- Bump master post release + +### v1.8.0 +- Significant improvement in import speeds with large collections +- Handle Samsung X_SetBookmark action, for saving position of viewed media, when enabled by flag +- New search support for containers, i.e. Albums, Artists and Genres +- Extract metadata information from mp3 files with ID3v1 tags, not just v2 +- Added a retry when binding to interfaces, should make Gerbera much more reliable to start with slow network startup. +- Hack around broken libstdc++ large file support on Debian 10 with 32-bit OS (mostly older ARM devices) +- Fix build with GCC11 +- Fix Debian/Ubuntu packages to work out of the box +- Beautify titles which are generated from file names + +### v1.7.0 + +- You can now use libnupnp instead of libupnp as the underlying UPnP library +- Multiple disk albums are now sorted correctly and are disks distinguished by part number field +- Container images are now possible on containers without files +- Subtitle resources should now work on Samsung clients +- Thumbnails, album art and container images now shown in the Web UI Database view +- Set additional import options per directory on filesystem page +- You can now edit configuration (most of it) in the Web UI! +- Charset can be specific to import library (section: import/library options), e g. if your pictures use different encoding than your music +- Resource configuration can be used for container images (section: import/resources): define image name filters and strategy for container hierarchy +- Additional metadata stored from import scan +- Modification time for autoscan directories now reflects sub directories and reduces startup footprint +- Container images are stored as resources so browsing can return them directly +- All scripting functions have been moved to common js +- A custom script file can be set in `config xml`. It may contain additional functions or override the existing. +- A new builtin script function `addContainerTree` can be used to set container properties +- Most entries from configuration can be accessed via new global variable `config`. +- The script file import structured js has been dropped. The layout can now be selected with the configuration attribute audio layout in virtual layout element. +- Depending on your previous changes script changes adjustments are recommended - although no breaking changes have been made. +- Internal refactoring and code improvements +- Many bug fixes + +In order to benefit from all these improvements it is recommended to clear your database and rescan your media library. + +### v1.6.4 +- Fix regression introduced in 1.6.2 in SQL generation + +### v1.6.3 +- Fix a regression introduced in 1.6.2 when adding resources + +### v1.6.2 +- Fixed a regression where some files could be removed from the library on a restart due to a race +- Fixed a crash in ffmpeg hander where metadata date field was non-numeric +- Add Samsung X_SetBookmark stub +- Bump jimp (fixes vuln jpeg-js) +- UI: Dont update mimetype to empty +- Fix tests with npupnp +- fix compilation with libcxx +- libevix2 fixes +- npupnp changes +- doc: add OpenWrt section +- clang-tidy fixes +- cxxopts: update to 2.2.1 +- Update README badges + + +### v1.6.1 +- fixed mime type retrieval for symlinks with libmagic +- Drop travis +- Actions: Run docker build on tags too +- Bump js stuff to fix security warnings +- Color folders with children instead of badges saying true +- Improve Resource Handling +- Add subtitle as resource and update entries with resources attached, improve ContentHandler +- Bump elliptic from 6.5.2 to 6.5.3 in /gerbera-web +- fix upnp header include +- Build fixes +- std::algorithm conversions +### v1.6.0 +- Allow configuration of separator for multi-valued tags +- Show duk script error message on load +- Show all object details on UI +- Updated config.xml XSD +- Added support for Conan package manager +- Add friendly messages when finding spdlog as library +- Refactored caching of ffmpeg thumbnails. +- lots more! + +### v1.5.0 +- Client Auto detection and DLNA quirks always enabled. +- C++ Standardisation +- UI Enhancements +- Transcoding Enhancements +- Expat has been replaced with pugixml +- Spdlog is now used for logging +- libfmt is now used for string formatting +- The latest 1.12.1 version of libupnp is now required. + +### v1.4.0 +- Metadata MKV support via libmatroska +- SQLite: Add migration to v5 schema +- Update web modules +- Dockerfile: Add MKV support +- README update, minor doc tidy +- Docs: Scripting - tidy +- install-pupnp: Bump to 1.8.6, fix #534 +- remove not used variables +- Docs: Scripting: remove docs for removed code, fix Note formatting +- Minor UI improvements + +### v1.3.4/5 +- Fix the build with LibUPnP 1.10 +- Build against libupnp 1.8.5 +- Fedora installation. +- UI e2e: Bump chromedriver + +### v1.3.3 +- Remove Storage Cache +- my_bool is not defined with mysql-connector-c 8.0 +- Update config.xml +- Support inotify kernel driver on illumos/OmniOS +- Fix up docs and start script now that -P/--pidfile is removed +- Set language to support xenial & latest chrome +- Correct add file docs +- Update Web Development Dependencies +- Dockerfile created +- SQLite: Turn on foreign key support at runtime +- Fix error in sqlite schema +- Add DeviceDescriptionHandler +- Update lodash +- Rename handlers to util +- Convert Gerbera UI to ES6 + +### v1.3.2 +- Allow to set the manufacturer and the modelURL via config file +- Fix find_program taglib-config when cross-compiling +- Update config-import.rst +- Add Gerbera version to UI +- cmake/FindFFMPEG: do not quieten messages when using pkg-config +- Fixture upgrade +- Update js cookie +- Add virtualUrl to AlbumArt resource for consistent resource URIs +- Use exiv2 header that include all headers +- Update vendor dependencies +- Docs: Bump version +- feat: provide a way to toggle DLNA-seeking with a config +- main: bugfix `interface` CLI option +- Generate config.xml with XML Declaration + + +### v1.3.1 +- Build system improvements +- Fixes for DLNA Headers handling +- Add support for TXXX AuxData extraction from MP3 +- Fix External URL resource generation +- Latest NPM Updates + +### v1.3.0 +- C++17 is now required to build (clang, gcc-7, gcc-8) +- Improved Samsung DTV Support (Still not entirely complete, but some more models may work) +- Added FLAC, Wavpack, DSD to default configuration +- Fixed Transcoding bugs with HTTP Protocol +- Properly handle upnp:date for Album sorting on UPNP devices +- Exposed resource options to import scripts (audio channels etc) +- Added support for Classical music tags: Composer, Conductor, Orchestra +- Fix UI update bug for macOS +- Add online-content examples +- Improve scripted installation +- Add configurable title for UI Home +- Fix SQL bugs +- Create Gerbera Homebrew Tap (for macOS High Sierra & Mojave) +- Various bug fixes and ongoing refactoring +- Add CentOS install instructions + +### v1.2.0 +- Amazing new web ui +- UPnP Search implemented +- Improved Docs: docs.gerbera.io, kindly hosted by Read the Docs. +- Broken Youtube support removed +- Fixed AUXDATA truncation with UTF-8 characters. +- Improved message when libupnp fails to bind correctly. +- Allow use of FFMpeg to extract AUXDATA +- Duktape JS scripting errors are now visible in log file +- Fixed a crash in EXIV2 image handler. +- Fixed "root path" sometimes missing for scripted layouts. + +### v1.1.0 +- Modern UI Preview +- Raspberry Pi / 32bit fixes +- Video thumbnail support +- Protocol Extensions +- BSD Fixes +- Album Artist support +- The --pidfile option has been removed, as we removed the --daemon option in the previous release retaining --pidfile option did not make sense +- This release supports <=libupnp 1.8.2 due to breaking changes in libupnp master branch, 1.2 will most likely require >=1.8.3. + ### v1.0.0 - Rebranded as Gerbera, new Logo! - Ported to CMake diff -Nru gerbera-1.6.0/.clang-format gerbera-1.8.2/.clang-format --- gerbera-1.6.0/.clang-format 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/.clang-format 2021-05-31 22:04:08.000000000 +0000 @@ -1 +1,3 @@ BasedOnStyle: Webkit +DeriveLineEnding: false +UseCRLF: false diff -Nru gerbera-1.6.0/cmake/FindEBML.cmake gerbera-1.8.2/cmake/FindEBML.cmake --- gerbera-1.6.0/cmake/FindEBML.cmake 1970-01-01 00:00:00.000000000 +0000 +++ gerbera-1.8.2/cmake/FindEBML.cmake 2021-05-31 22:04:08.000000000 +0000 @@ -0,0 +1,30 @@ +# - Try to find libebml +# Once done this will define +# +# EBML_FOUND - system has libebml +# EBML_INCLUDE_DIRS - the libebml include directory +# EBML_LIBRARIES - Link these to use EBML +# + +INCLUDE(FindPackageHandleStandardArgs) + +find_package(PkgConfig QUIET) + +# EBML +pkg_search_module(PC_EBML QUIET libebml) +find_path(EBML_INCLUDE_DIR EbmlVersion.h + HINTS ${PC_EBML_INCLUDEDIR} + PATH_SUFFIXES ebml) +FIND_LIBRARY(EBML_LIBRARY ebml + HINTS ${PC_EBML_LIBDIR}) + +find_package_handle_standard_args(EBML DEFAULT_MSG + EBML_LIBRARY EBML_INCLUDE_DIR) +if (EBML_FOUND) + set(EBML_LIBRARIES ${EBML_LIBRARY}) + set(EBML_INCLUDE_DIRS ${EBML_INCLUDE_DIR}) +endif () +MARK_AS_ADVANCED( + EBML_INCLUDE_DIR + EBML_LIBRARY +) \ No newline at end of file diff -Nru gerbera-1.6.0/cmake/FindFFMpegThumbnailer.cmake gerbera-1.8.2/cmake/FindFFMpegThumbnailer.cmake --- gerbera-1.6.0/cmake/FindFFMpegThumbnailer.cmake 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/cmake/FindFFMpegThumbnailer.cmake 2021-05-31 22:04:08.000000000 +0000 @@ -13,6 +13,10 @@ HINTS ${PC_FFTHUMB_INCLUDEDIR} ${PC_FFTHUMB_INCLUDE_DIRS} PATH_SUFFIXES ffmpegthumbnailer libffmpegthumbnailer) +find_path(FFMPEGTHUMBNAILER_ROOT_DIR + NAMES "include/libffmpegthumbnailer/videothumbnailerc.h" + PATHS ENV FFMPEGTHUMBNAILER_ROOT_DIR) + FIND_LIBRARY(FFMPEGTHUMBNAILER_LIBRARIES NAMES libffmpegthumbnailer ffmpegthumbnailer HINTS ${PC_FFTHUMB_LIBDIR} ${PC_FFTHUMB_LIBRARY_DIRS}) @@ -21,6 +25,22 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFMpegThumbnailer REQUIRED_VARS FFMPEGTHUMBNAILER_LIBRARIES FFMPEGTHUMBNAILER_INCLUDE_DIRS) +find_file(_ffmpegthumbnailer_pkg_config_file + NAMES "libffmpegthumbnailer.pc" + HINTS ${FFMPEGTHUMBNAILER_ROOT_DIR} + PATHS ENV FFMPEGTHUMBNAILER_ROOT_DIR + PATH_SUFFIXES "lib64/pkgconfig" "lib/pkgconfig" "pkgconfig") + +if(EXISTS ${_ffmpegthumbnailer_pkg_config_file}) + file(STRINGS "${_ffmpegthumbnailer_pkg_config_file}" _ffmpegthumbnailer_version REGEX "^Version: .*$") + string(REGEX REPLACE "^.*Version: ([0-9]+).*$" "\\1" FFMPEGTHUMBNAILER_VERSION_MAJOR "${_ffmpegthumbnailer_version}") + string(REGEX REPLACE "^.*Version: [0-9]+\\.([0-9]+).*$" "\\1" FFMPEGTHUMBNAILER_VERSION_MINOR "${_ffmpegthumbnailer_version}") + string(REGEX REPLACE "^.*Version: [0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" FFMPEGTHUMBNAILER_VERSION_PATCH "${_ffmpegthumbnailer_version}") + set(FFMPEGTHUMBNAILER_VERSION_STRING "${FFMPEGTHUMBNAILER_VERSION_MAJOR}.${FFMPEGTHUMBNAILER_VERSION_MINOR}.${FFMPEGTHUMBNAILER_VERSION_PATCH}") +else(EXISTS ${_ffmpegthumbnailer_pkg_config_file}) + set(FFMPEGTHUMBNAILER_VERSION_STRING "") +endif(EXISTS ${_ffmpegthumbnailer_pkg_config_file}) + MARK_AS_ADVANCED( FFMPEGTHUMBNAILER_INCLUDE_DIR FFMPEGTHUMBNAILER_LIBRARY diff -Nru gerbera-1.6.0/cmake/FindLibMagic.cmake gerbera-1.8.2/cmake/FindLibMagic.cmake --- gerbera-1.6.0/cmake/FindLibMagic.cmake 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/cmake/FindLibMagic.cmake 2021-05-31 22:04:08.000000000 +0000 @@ -1,22 +1,23 @@ -INCLUDE (FindPackageHandleStandardArgs) +include(FindPackageHandleStandardArgs) find_package(PkgConfig QUIET) -pkg_check_modules(PC_MAGIC QUIET libmagic) +pkg_search_module(PC_MAGIC QUIET libmagic) -FIND_PATH(MAGIC_INCLUDE_DIR magic.h +find_path(MAGIC_INCLUDE_DIR magic.h HINTS ${PC_MAGIC_INCLUDEDIR} ${PC_MAGIC_INCLUDE_DIRS}) -FIND_LIBRARY(MAGIC_LIBRARIES NAMES magic +find_library(MAGIC_LIBRARY NAMES magic HINTS ${PC_MAGIC_LIBDIR} ${PC_MAGIC_LIBRARY_DIRS}) # handle the QUIETLY and REQUIRED arguments and set MAGIC_FOUND to TRUE -find_package_handle_standard_args(MAGIC DEFAULT_MSG MAGIC_LIBRARIES) +find_package_handle_standard_args(LibMagic DEFAULT_MSG MAGIC_LIBRARY MAGIC_LIBRARY) -if (MAGIC_FOUND) - set (MAGIC_LIBRARIES ${MAGIC_LIBRARY} ${PC_MAGIC_LIBRARIES}) - set (MAGIC_INCLUDE_DIRS ${MAGIC_INCLUDE_DIR} ) -endif () +if (LibMagic_FOUND) + set(LibMagic_LIBRARIES ${MAGIC_LIBRARY}) + set(LibMagic_INCLUDE_DIRS ${MAGIC_INCLUDE_DIR}) +endif() MARK_AS_ADVANCED( - MAGIC_LIBRARIES - MAGIC_INCLUDE_DIRS ) + LibMagic_LIBRARIES + LibMagic_INCLUDE_DIRS +) diff -Nru gerbera-1.6.0/cmake/Findlibuuid.cmake gerbera-1.8.2/cmake/Findlibuuid.cmake --- gerbera-1.6.0/cmake/Findlibuuid.cmake 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/cmake/Findlibuuid.cmake 2021-05-31 22:04:08.000000000 +0000 @@ -1,4 +1,4 @@ -# Find a UUID Implementaion +# Find a UUID Implementation # # Supports e2fsprogs libuuid or BSD native UUID # @@ -9,7 +9,6 @@ # FOUND_LIBUUID e2fsprogs UUID found # -INCLUDE(FindPkgConfig) INCLUDE(CheckCXXSourceRuns) INCLUDE(FindPackageHandleStandardArgs) @@ -31,8 +30,9 @@ if(NOT libuuid_FOUND) message(STATUS "Looking for libuuid") - pkg_search_module(_UUID libuuid QUIET) - if(NOT _UUID_FOUND) + find_package(PkgConfig QUIET) + pkg_search_module(PC_UUID libuuid QUIET) + if(NOT PC_UUID_FOUND) FIND_PATH(libuuid_INCLUDE_DIRS uuid/uuid.h) FIND_LIBRARY(libuuid_LIBRARIES uuid) diff -Nru gerbera-1.6.0/cmake/FindMatroska.cmake gerbera-1.8.2/cmake/FindMatroska.cmake --- gerbera-1.6.0/cmake/FindMatroska.cmake 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/cmake/FindMatroska.cmake 2021-05-31 22:04:08.000000000 +0000 @@ -1,51 +1,31 @@ -# - Try to find libebml and libmatroska +# - Try to find libMatroska # Once done this will define # -# EBML_FOUND - system has libebml -# EBML_INCLUDE_DIRS - the libebml include directory -# EBML_LIBRARIES - Link these to use EBML -# MATROSKA_FOUND - system has libmatroska -# MATROSKA_INCLUDE_DIRS - the libmatroska include directory -# MATROSKA_LIBRARIES - Link these to use MATROSKA +# Matroska_FOUND - system has libMatroska +# Matroska_INCLUDE_DIRS - the libMatroska include directory +# Matroska_LIBRARIES - Link these to use Matroska # INCLUDE(FindPackageHandleStandardArgs) find_package(PkgConfig QUIET) -# EBML -pkg_check_modules(PC_EBM QUIET libebml) -find_path(EBML_INCLUDE_DIR StdIOCallback.h - HINTS ${PC_EBM_INCLUDEDIR} ${PC_EBM_INCLUDE_DIRS} - PATH_SUFFIXES ebml) -FIND_LIBRARY(EBML_LIBRARY ebml - HINTS ${PC_EBM_LIBDIR} ${PC_EBM_LIBRARY_DIRS}) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(EBML - REQUIRED_VARS EBML_LIBRARY EBML_INCLUDE_DIR) -if (EBML_FOUND) - set (EBML_LIBRARIES ${EBML_LIBRARY} ${PC_EBM_LIBRARIES}) - set (EBML_INCLUDE_DIRS ${EBML_INCLUDE_DIR} ) -endif () -MARK_AS_ADVANCED( - EBML_INCLUDE_DIR - EBML_LIBRARY -) +# Matroska +pkg_search_module(PC_MAT QUIET libmatroska) +find_path(Matroska_INCLUDE_DIR KaxVersion.h + HINTS ${PC_MAT_INCLUDEDIR} + PATH_SUFFIXES matroska) +find_library(Matroska_LIBRARY matroska + HINTS ${PC_MAT_LIBDIR}) -# MATROSKA -pkg_check_modules(PC_MAT QUIET libmatroska) -find_path(MATROSKA_INCLUDE_DIR KaxVersion.h - HINTS ${PC_MAT_INCLUDEDIR} ${PC_MAT_INCLUDE_DIRS} - PATH_SUFFIXES matroska) -find_library(MATROSKA_LIBRARY matroska - HINTS ${PC_MAT_LIBDIR} ${PC_MAT_LIBRARY_DIRS}) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(MATROSKA - REQUIRED_VARS MATROSKA_LIBRARY MATROSKA_INCLUDE_DIR) -if (MATROSKA_FOUND) - set (MATROSKA_LIBRARIES ${MATROSKA_LIBRARY} ${PC_MAT_LIBRARIES}) - set (MATROSKA_INCLUDE_DIRS ${MATROSKA_INCLUDE_DIR} ) +find_package_handle_standard_args(Matroska DEFAULT_MSG + Matroska_LIBRARY Matroska_INCLUDE_DIR) +if (Matroska_FOUND) + set(Matroska_LIBRARIES ${Matroska_LIBRARY}) + set(Matroska_INCLUDE_DIRS ${Matroska_INCLUDE_DIR}) endif () MARK_AS_ADVANCED( - MATROSKA_INCLUDE_DIR - MATROSKA_LIBRARY + Matroska_INCLUDE_DIR + Matroska_LIBRARY ) diff -Nru gerbera-1.6.0/cmake/Findpugixml.cmake gerbera-1.8.2/cmake/Findpugixml.cmake --- gerbera-1.6.0/cmake/Findpugixml.cmake 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/cmake/Findpugixml.cmake 2021-05-31 22:04:08.000000000 +0000 @@ -10,7 +10,7 @@ find_package(PkgConfig QUIET) -pkg_check_modules(PC_EBM QUIET libpugixml) +pkg_check_modules(PC_PUGIXML QUIET libpugixml) find_path(PUGIXML_INCLUDE_DIR pugixml.hpp HINTS ${PC_PUGIXML_INCLUDEDIR} ${PC_PUGIXML_INCLUDE_DIRS}) FIND_LIBRARY(PUGIXML_LIBRARY pugixml diff -Nru gerbera-1.6.0/cmake/Findpupnp.cmake gerbera-1.8.2/cmake/Findpupnp.cmake --- gerbera-1.6.0/cmake/Findpupnp.cmake 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/cmake/Findpupnp.cmake 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -# - Try to find LibUPnP (pupnp) 1.12 -# Once done this will define -# UPNP_FOUND - System has LibUPnP -# UPNP_INCLUDE_DIRS - The LibUPnP include directories -# UPNP_LIBRARIES - The libraries needed to use LibUPnP -# UPNP_VERSION_STRING - The version of LinUPnP found -# UPNP_HAS_IPV6 - If LinUPnP was built with IPv6 support -# UPNP_HAS_REUSEADDR - If LinUPnP was built with SO_REUSEADDR support -find_package(PkgConfig QUIET) -pkg_search_module (PC_UPNP QUIET libupnp) - -find_path(UPNP_INCLUDE_DIR upnp.h - HINTS ${PC_UPNP_INCLUDEDIR} ${PC_UPNP_INCLUDE_DIRS} - PATH_SUFFIXES upnp) - -find_library(UPNP_UPNP_LIBRARY - NAMES libupnp upnp - HINTS ${PC_UPNP_LIBDIR} ${PC_UPNP_LIBRARY_DIRS}) - -find_library(UPNP_IXML_LIBRARY - NAMES libixml ixml - HINTS ${PC_UPNP_LIBDIR} ${PC_UPNP_LIBRARY_DIRS}) - -if(EXISTS ${UPNP_INCLUDE_DIR}/upnpconfig.h) - file (STRINGS ${UPNP_INCLUDE_DIR}/upnpconfig.h _UPNP_DEFS REGEX "^[ \t]*#define[ \t]+UPNP_VERSION_(MAJOR|MINOR|PATCH)") - string (REGEX REPLACE ".*UPNP_VERSION_MAJOR ([0-9]+).*" "\\1" UPNP_MAJOR_VERSION "${_UPNP_DEFS}") - string (REGEX REPLACE ".*UPNP_VERSION_MINOR ([0-9]+).*" "\\1" UPNP_MINOR_VERSION "${_UPNP_DEFS}") - string (REGEX REPLACE ".*UPNP_VERSION_PATCH ([0-9]+).*" "\\1" UPNP_PATCH_VERSION "${_UPNP_DEFS}") - set (pupnp_VERSION "${UPNP_MAJOR_VERSION}.${UPNP_MINOR_VERSION}.${UPNP_PATCH_VERSION}") -endif() - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(pupnp - REQUIRED_VARS UPNP_UPNP_LIBRARY UPNP_INCLUDE_DIR - VERSION_VAR pupnp_VERSION) - -if (pupnp_FOUND) - set (UPNP_LIBRARIES ${UPNP_UPNP_LIBRARY} ${UPNP_IXML_LIBRARY} ${PC_UPNP_LIBRARIES}) - set (UPNP_INCLUDE_DIRS ${UPNP_INCLUDE_DIR} ) - - if(NOT TARGET pupnp::pupnp) - add_library(pupnp::pupnp INTERFACE IMPORTED) - set_target_properties(pupnp::pupnp PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${UPNP_INCLUDE_DIRS}") - set_property(TARGET pupnp::pupnp PROPERTY INTERFACE_LINK_LIBRARIES "${UPNP_LIBRARIES}") - endif() -endif () - -MARK_AS_ADVANCED( - UPNP_INCLUDE_DIR - UPNP_IXML_LIBRARY - UPNP_UPNP_LIBRARY -) diff -Nru gerbera-1.6.0/cmake/FindSQLite3.cmake gerbera-1.8.2/cmake/FindSQLite3.cmake --- gerbera-1.6.0/cmake/FindSQLite3.cmake 1970-01-01 00:00:00.000000000 +0000 +++ gerbera-1.8.2/cmake/FindSQLite3.cmake 2021-05-31 22:04:08.000000000 +0000 @@ -0,0 +1,70 @@ +# Taken from Cmake 3.14 https://github.com/Kitware/CMake/blob/master/Modules/FindSQLite3.cmake + +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +FindSQLite3 +----------- + +.. versionadded:: 3.14 + +Find the SQLite libraries, v3 + +IMPORTED targets +^^^^^^^^^^^^^^^^ + +This module defines the following :prop_tgt:`IMPORTED` target: + +``SQLite::SQLite3`` + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables if found: + +``SQLite3_INCLUDE_DIRS`` + where to find sqlite3.h, etc. +``SQLite3_LIBRARIES`` + the libraries to link against to use SQLite3. +``SQLite3_VERSION`` + version of the SQLite3 library found +``SQLite3_FOUND`` + TRUE if found + +#]=======================================================================] + +# Look for the necessary header +find_path(SQLite3_INCLUDE_DIR NAMES sqlite3.h) +mark_as_advanced(SQLite3_INCLUDE_DIR) + +# Look for the necessary library +find_library(SQLite3_LIBRARY NAMES sqlite3 sqlite) +mark_as_advanced(SQLite3_LIBRARY) + +# Extract version information from the header file +if(SQLite3_INCLUDE_DIR) + file(STRINGS ${SQLite3_INCLUDE_DIR}/sqlite3.h _ver_line + REGEX "^#define SQLITE_VERSION *\"[0-9]+\\.[0-9]+\\.[0-9]+\"" + LIMIT_COUNT 1) + string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" + SQLite3_VERSION "${_ver_line}") + unset(_ver_line) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SQLite3 + REQUIRED_VARS SQLite3_INCLUDE_DIR SQLite3_LIBRARY + VERSION_VAR SQLite3_VERSION) + +# Create the imported target +if(SQLite3_FOUND) + set(SQLite3_INCLUDE_DIRS ${SQLite3_INCLUDE_DIR}) + set(SQLite3_LIBRARIES ${SQLite3_LIBRARY}) + if(NOT TARGET SQLite::SQLite3) + add_library(SQLite::SQLite3 UNKNOWN IMPORTED) + set_target_properties(SQLite::SQLite3 PROPERTIES + IMPORTED_LOCATION "${SQLite3_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${SQLite3_INCLUDE_DIR}") + endif() +endif() diff -Nru gerbera-1.6.0/cmake/FindSystemd.cmake gerbera-1.8.2/cmake/FindSystemd.cmake --- gerbera-1.6.0/cmake/FindSystemd.cmake 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/cmake/FindSystemd.cmake 2021-05-31 22:04:08.000000000 +0000 @@ -6,8 +6,8 @@ # SYSTEMD_UNIT_DIR: path to install system unit files include(FindPackageHandleStandardArgs) -include(FindPkgConfig) +find_package(PkgConfig QUIET) pkg_check_modules(SYSTEMD systemd QUIET) if (SYSTEMD_FOUND) diff -Nru gerbera-1.6.0/cmake/FindUPNP.cmake gerbera-1.8.2/cmake/FindUPNP.cmake --- gerbera-1.6.0/cmake/FindUPNP.cmake 1970-01-01 00:00:00.000000000 +0000 +++ gerbera-1.8.2/cmake/FindUPNP.cmake 2021-05-31 22:04:08.000000000 +0000 @@ -0,0 +1,61 @@ +# - Try to find LibUPnP (pupnp) 1.12 +# Once done this will define +# UPNP_FOUND - System has LibUPnP +# UPNP_INCLUDE_DIRS - The LibUPnP include directories +# UPNP_LIBRARIES - The libraries needed to use LibUPnP +# UPNP_VERSION_STRING - The version of LinUPnP found +# UPNP_HAS_IPV6 - If LinUPnP was built with IPv6 support +# UPNP_HAS_REUSEADDR - If LinUPnP was built with SO_REUSEADDR support +find_package(PkgConfig QUIET) +pkg_search_module (PC_UPNP QUIET libupnp) + +find_path(UPNP_INCLUDE_DIR upnp.h + HINTS ${PC_UPNP_INCLUDEDIR} ${PC_UPNP_INCLUDE_DIRS} + PATH_SUFFIXES upnp) + +if (STATIC_LIBUPNP) + set(OLD_SUFFIX ${CMAKE_FIND_LIBRARY_SUFFIXES}) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) +endif() + +find_library(UPNP_UPNP_LIBRARY + NAMES libupnp upnp + HINTS ${PC_UPNP_LIBDIR} ${PC_UPNP_LIBRARY_DIRS}) + +find_library(UPNP_IXML_LIBRARY + NAMES libixml ixml + HINTS ${PC_UPNP_LIBDIR} ${PC_UPNP_LIBRARY_DIRS}) + +# Restore +if (STATIC_LIBUPNP) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_SUFFIX}) +endif() + +if(EXISTS ${UPNP_INCLUDE_DIR}/upnpconfig.h) + file (STRINGS ${UPNP_INCLUDE_DIR}/upnpconfig.h upnp_ver_str REGEX "^#define[ \t]+UPNP_VERSION_STRING[ \t]+\".+\"") + string(REGEX REPLACE "^#define[ \t]+UPNP_VERSION_STRING[ \t]+\"([^\"]+)\".*" "\\1" UPNP_VERSION "${upnp_ver_str}") +endif() + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(UPNP + REQUIRED_VARS UPNP_UPNP_LIBRARY UPNP_INCLUDE_DIR + VERSION_VAR UPNP_VERSION) + +if (UPNP_FOUND) + if(NOT TARGET UPNP::UPNP) + add_library(UPNP::UPNP SHARED IMPORTED) + set_target_properties(UPNP::UPNP PROPERTIES + IMPORTED_LOCATION ${UPNP_UPNP_LIBRARY} + INTERFACE_INCLUDE_DIRECTORIES ${UPNP_INCLUDE_DIR} + INTERFACE_LINK_LIBRARIES ${UPNP_IXML_LIBRARY} + VERSION ${UPNP_VERSION} + ) + + endif() +endif () + +MARK_AS_ADVANCED( + UPNP_INCLUDE_DIR + UPNP_IXML_LIBRARY + UPNP_UPNP_LIBRARY +) diff -Nru gerbera-1.6.0/cmake/GenCompileInfo.cmake gerbera-1.8.2/cmake/GenCompileInfo.cmake --- gerbera-1.6.0/cmake/GenCompileInfo.cmake 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/cmake/GenCompileInfo.cmake 2021-05-31 22:04:08.000000000 +0000 @@ -17,7 +17,6 @@ "WITH_FFMPEGTHUMBNAILER=${WITH_FFMPEGTHUMBNAILER}" "WITH_EXIF=${WITH_EXIF}" "WITH_EXIV2=${WITH_EXIV2}" - "WITH_PROTOCOL_EXTENSIONS=${WITH_PROTOCOL_EXTENSIONS}" "WITH_SYSTEMD=${WITH_SYSTEMD}" "WITH_LASTFM=${WITH_LASTFM}" "WITH_DEBUG=${WITH_DEBUG}" @@ -26,9 +25,8 @@ string (REPLACE ";" "\\n" COMPILE_INFO_STR "${COMPILE_INFO_LIST}") set(COMPILE_INFO "${COMPILE_INFO_STR}" PARENT_SCOPE) - + # Git Info set(GIT_DIR "${CMAKE_SOURCE_DIR}/.git") - if(EXISTS "${GIT_DIR}") # Get the current working branch execute_process( @@ -38,6 +36,14 @@ OUTPUT_STRIP_TRAILING_WHITESPACE ) + # Get the tag + execute_process( + COMMAND git describe --tags + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_TAG + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + # Get the latest commit hash execute_process( COMMAND git rev-parse HEAD @@ -52,5 +58,6 @@ set(GIT_BRANCH ${GIT_BRANCH} PARENT_SCOPE) set(GIT_COMMIT_HASH ${GIT_COMMIT_HASH} PARENT_SCOPE) + set(GIT_TAG ${GIT_TAG} PARENT_SCOPE) endfunction() \ No newline at end of file diff -Nru gerbera-1.6.0/cmake/packaging.cmake gerbera-1.8.2/cmake/packaging.cmake --- gerbera-1.6.0/cmake/packaging.cmake 1970-01-01 00:00:00.000000000 +0000 +++ gerbera-1.8.2/cmake/packaging.cmake 2021-05-31 22:04:08.000000000 +0000 @@ -0,0 +1,16 @@ +set(CPACK_PACKAGE_VENDOR Gerbera) +set(CPACK_PACKAGE_NAME gerbera) +set(CPACK_PACKAGE_CONTACT "Team Gerbera") +set(CPACK_PACKAGE_VERSION ${GERBERA_VERSION}) +set(CPACK_STRIP_FILES YES) + +# Debian Specifics +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") +set(CPACK_DEBIAN_PACKAGE_SECTION "net") +set(CPACK_DEBIAN_COMPRESSION_TYPE "xz") +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) # Discover Deps +set(CPACK_DEBIAN_PACKAGE_DEBUG ON) +set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/scripts/debian/postinst") +set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION ON) + +include(CPack) diff -Nru gerbera-1.6.0/CMakeLists.txt gerbera-1.8.2/CMakeLists.txt --- gerbera-1.6.0/CMakeLists.txt 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/CMakeLists.txt 2021-05-31 22:04:08.000000000 +0000 @@ -1,81 +1,60 @@ -cmake_minimum_required(VERSION 3.14 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13 FATAL_ERROR) +cmake_policy(VERSION 3.13) -set(GERBERA_MAJOR_VERSION 1) -set(GERBERA_MINOR_VERSION 6) -set(GERBERA_PATCH_VERSION 0) -set(GERBERA_RELEASE "") -set(GERBERA_VERSION "${GERBERA_MAJOR_VERSION}.${GERBERA_MINOR_VERSION}.${GERBERA_PATCH_VERSION}${GERBERA_RELEASE}") +# Only set for release tags +# You should only see version "git" when built from a git snapshot tarball +set(GERBERA_VERSION "1.8.2") project(Gerbera - VERSION "${GERBERA_MAJOR_VERSION}.${GERBERA_MINOR_VERSION}.${GERBERA_PATCH_VERSION}") + DESCRIPTION "UPnP Media Server" + HOMEPAGE_URL "https://gerbera.io" + LANGUAGES CXX C) -# Leverage a modern C++ -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) - -set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") -set(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR} ${CMAKE_PREFIX_PATH}) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") +# If Conan stuff is present, load it include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake OPTIONAL) +if(COMMAND conan_basic_setup) + # Prefer the conan FindModules + list(PREPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}) + conan_basic_setup(TARGETS) +endif() + +set(WITH_NPUPNP NO CACHE BOOL "Use npupnp instead of libupnp") +set(WITH_MAGIC YES CACHE BOOL "Use libmagic to identify file mime types") +set(WITH_MYSQL NO CACHE BOOL "Store media information in MySQL DB") +set(WITH_CURL YES CACHE BOOL "CURL required for online services") +set(WITH_INOTIFY YES CACHE BOOL "Enable Inotify file monitoring support") +set(WITH_JS YES CACHE BOOL "Enable JavaScript for scripting") +set(WITH_TAGLIB YES CACHE BOOL "Use TagLib to extract audio file metadata") +set(WITH_AVCODEC NO CACHE BOOL "Use ffmpeg/libav to extract file metadata") +set(WITH_FFMPEGTHUMBNAILER NO CACHE BOOL "Enable Thumbnail generation") +set(WITH_EXIF YES CACHE BOOL "Use libexif to extract image metadata") +set(WITH_EXIV2 NO CACHE BOOL "Use libexiv2 to extract image metadata") +set(WITH_MATROSKA YES CACHE BOOL "Use libmatroska to extract video/mkv metadata") +set(WITH_SYSTEMD YES CACHE BOOL "Install Systemd unit file") +set(WITH_LASTFM NO CACHE BOOL "Enable scrobbling to LastFM") +set(WITH_DEBUG YES CACHE BOOL "Enables debug logging") +set(WITH_TESTS NO CACHE BOOL "Build unit tests") -include(CheckCXXSymbolExists) - -if (CONAN_EXPORTED) - conan_message(STATUS "Conan: called by CMake conan helper") - # Propagate variables set by the helper - # Normally conan_basic_setup should be called, but we rely - # on cmake_find_package generator. - # Do only some checks and setup here. - conan_set_std() - conan_set_fpic() - conan_check_compiler() - conan_set_libcxx() - conan_set_vs_runtime() -endif() - -set(CMAKE_VERBOSE_MAKEFILE off CACHE BOOL "Show verbose build commands") -set(WITH_MAGIC 1 CACHE BOOL "Use libmagic to identify file mime types") -set(WITH_MYSQL 0 CACHE BOOL "Store media information in MySQL DB") -set(WITH_CURL 1 CACHE BOOL "CURL required for online services") -set(WITH_INOTIFY 1 CACHE BOOL "Enable Inotify file monitoring support") -set(WITH_JS 1 CACHE BOOL "Enable JavaScript for custom import script") -set(WITH_TAGLIB 1 CACHE BOOL "Use TagLib to extract audio file metadata") -set(WITH_AVCODEC 0 CACHE BOOL "Enable ffmpeg/libav") -set(WITH_FFMPEGTHUMBNAILER 0 CACHE BOOL "Enable Thumbnail generation") -set(WITH_EXIF 1 CACHE BOOL "Use libexif to extract image metadata") -set(WITH_EXIV2 0 CACHE BOOL "Use libexiv2 to extract image metadata") -set(WITH_MATROSKA 1 CACHE BOOL "Use libmatroska to extract video/mkv metadata") -set(WITH_SYSTEMD 1 CACHE BOOL "Install Systemd unit file") -set(WITH_LASTFM 0 CACHE BOOL "Enable LastFM") -set(WITH_DEBUG 1 CACHE BOOL "Enables debug logging") -set(WITH_TESTS 0 CACHE BOOL "Enables Unit Tests") - -# Warnings are nice -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") - -# Add the automatically determined parts of the RPATH which point to -# directories outside the build tree to the install RPATH -set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - -# System specific stuff -if (${CMAKE_SYSTEM_NAME} MATCHES ".*(SunOS|Solaris).*") - add_definitions(-DSOLARIS) -elseif (${CMAKE_SYSTEM_NAME} MATCHES ".*BSD.*") - add_definitions(-DBSD) -endif() +# For building packages without depending on the old system libupnp +set(STATIC_LIBUPNP 0 CACHE BOOL "Link to libupnp statically") -add_definitions(-DPACKAGE_NAME="${PROJECT_NAME}") -add_definitions(-DVERSION="${GERBERA_VERSION}") -add_definitions(-DPACKAGE_DATADIR="${CMAKE_INSTALL_PREFIX}/share/gerbera") +# Leverage a modern C++ +# Set defaults here before we create targets +set(CMAKE_CXX_STANDARD 17) +# Cygwin requires extensions for a lot of the networking stuff. +if(CYGWIN) + set(CMAKE_CXX_STANDARD_REQUIRED NO) + set(CMAKE_CXX_EXTENSIONS YES) +else(CYGWIN) + set(CMAKE_CXX_STANDARD_REQUIRED YES) + set(CMAKE_CXX_EXTENSIONS NO) +endif(CYGWIN) -add_library(libgerbera STATIC +add_library(libgerbera STATIC src/action_request.cc src/action_request.h - src/autoscan.cc - src/autoscan.h - src/autoscan_inotify.cc - src/autoscan_inotify.h src/cds_objects.cc src/cds_objects.h src/cds_resource.cc @@ -83,13 +62,65 @@ src/common.h src/config/client_config.h src/config/client_config.cc + src/config/config_definition.h + src/config/config_definition.cc src/config/config_generator.h src/config/config_generator.cc src/config/config_manager.cc src/config/config_manager.h + src/config/config_options.cc src/config/config_options.h - src/content_manager.cc - src/content_manager.h + src/config/config_setup.cc + src/config/config_setup.h + src/config/directory_tweak.h + src/config/directory_tweak.cc + src/content/autoscan.cc + src/content/autoscan.h + src/content/autoscan_list.cc + src/content/autoscan_list.h + src/content/autoscan_inotify.cc + src/content/autoscan_inotify.h + src/content/content_manager.cc + src/content/content_manager.h + src/content/layout/builtin_layout.cc + src/content/layout/builtin_layout.h + src/content/layout/js_layout.cc + src/content/layout/js_layout.h + src/content/layout/layout.cc + src/content/layout/layout.h + src/content/onlineservice/atrailers_content_handler.cc + src/content/onlineservice/atrailers_content_handler.h + src/content/onlineservice/atrailers_service.cc + src/content/onlineservice/atrailers_service.h + src/content/onlineservice/curl_online_service.cc + src/content/onlineservice/curl_online_service.h + src/content/onlineservice/lastfm_scrobbler.cc + src/content/onlineservice/lastfm_scrobbler.h + src/content/onlineservice/online_service.cc + src/content/onlineservice/online_service.h + src/content/onlineservice/online_service_helper.cc + src/content/onlineservice/online_service_helper.h + src/content/onlineservice/sopcast_content_handler.cc + src/content/onlineservice/sopcast_content_handler.h + src/content/onlineservice/sopcast_service.cc + src/content/onlineservice/sopcast_service.h + src/content/onlineservice/task_processor.cc + src/content/onlineservice/task_processor.h + src/content/scripting/import_script.cc + src/content/scripting/import_script.h + src/content/scripting/js_functions.cc + src/content/scripting/js_functions.h + src/content/scripting/playlist_parser_script.cc + src/content/scripting/playlist_parser_script.h + src/content/scripting/scripting_runtime.cc + src/content/scripting/scripting_runtime.h + src/content/scripting/script.cc + src/content/scripting/script.h + src/content/scripting/script_names.h + src/content/update_manager.cc + src/content/update_manager.h + src/context.cc + src/context.h src/contrib/md5.c src/contrib/md5.h src/device_description_handler.cc @@ -114,11 +145,6 @@ src/iohandler/mem_io_handler.h src/iohandler/process_io_handler.cc src/iohandler/process_io_handler.h - src/layout/fallback_layout.cc - src/layout/fallback_layout.h - src/layout/js_layout.cc - src/layout/js_layout.h - src/layout/layout.h src/metadata/exiv2_handler.cc src/metadata/exiv2_handler.h src/metadata/ffmpeg_handler.cc @@ -129,65 +155,38 @@ src/metadata/libexif_handler.h src/metadata/taglib_handler.cc src/metadata/taglib_handler.h - src/metadata/fanart_handler.cc - src/metadata/fanart_handler.h + src/metadata/metacontent_handler.cc + src/metadata/metacontent_handler.h src/metadata/matroska_handler.cc src/metadata/matroska_handler.h - src/onlineservice/atrailers_content_handler.cc - src/onlineservice/atrailers_content_handler.h - src/onlineservice/atrailers_service.cc - src/onlineservice/atrailers_service.h - src/onlineservice/lastfm_scrobbler.cc - src/onlineservice/lastfm_scrobbler.h - src/onlineservice/online_service.cc - src/onlineservice/online_service.h - src/onlineservice/online_service_helper.cc - src/onlineservice/online_service_helper.h - src/onlineservice/sopcast_content_handler.cc - src/onlineservice/sopcast_content_handler.h - src/onlineservice/sopcast_service.cc - src/onlineservice/sopcast_service.h src/request_handler.cc src/request_handler.h - src/scripting/import_script.cc - src/scripting/import_script.h - src/scripting/js_functions.cc - src/scripting/js_functions.h - src/scripting/playlist_parser_script.cc - src/scripting/playlist_parser_script.h - src/scripting/runtime.cc - src/scripting/runtime.h - src/scripting/script.cc - src/scripting/script.h - src/search_handler.cc - src/search_handler.h src/server.cc src/serve_request_handler.cc src/serve_request_handler.h src/server.h - src/storage/mysql/mysql_create_sql.h - src/storage/mysql/mysql_storage.cc - src/storage/mysql/mysql_storage.h - src/storage/sqlite3/sqlite3_create_sql.h - src/storage/sqlite3/sqlite3_storage.cc - src/storage/sqlite3/sqlite3_storage.h - src/storage/sql_storage.cc - src/storage/sql_storage.h - src/storage/storage.cc - src/storage/storage.h + src/database/mysql/mysql_database.cc + src/database/mysql/mysql_database.h + src/database/sqlite3/sqlite_database.cc + src/database/sqlite3/sqlite_database.h + src/database/sql_database.cc + src/database/sql_database.h + src/database/database.cc + src/database/database.h + src/database/search_handler.cc + src/database/search_handler.h src/subscription_request.cc src/subscription_request.h src/transcoding/transcode_dispatcher.cc src/transcoding/transcode_dispatcher.h src/transcoding/transcode_ext_handler.cc src/transcoding/transcode_ext_handler.h + src/transcoding/transcode_handler.cc src/transcoding/transcode_handler.h src/transcoding/transcoding.cc src/transcoding/transcoding.h src/transcoding/transcoding_process_executor.cc src/transcoding/transcoding_process_executor.h - src/update_manager.cc - src/update_manager.h src/upnp_cds.cc src/upnp_cds.h src/upnp_cm.cc @@ -196,8 +195,6 @@ src/upnp_mrreg.h src/upnp_xml.cc src/upnp_xml.h - src/url.cc - src/url.h src/url_request_handler.cc src/url_request_handler.h src/util/executor.h @@ -205,6 +202,8 @@ src/util/generic_task.h src/util/jpeg_resolution.cc src/util/logger.h + src/util/mime.cc + src/util/mime.h src/util/mt_inotify.cc src/util/mt_inotify.h src/util/process.cc @@ -213,10 +212,9 @@ src/util/process.h src/util/string_converter.cc src/util/string_converter.h - src/util/task_processor.cc - src/util/task_processor.h src/util/thread_executor.cc src/util/thread_executor.h + src/util/thread_runner.h src/util/timer.cc src/util/timer.h src/util/tools.cc @@ -227,6 +225,8 @@ src/util/upnp_headers.cc src/util/upnp_quirks.h src/util/upnp_quirks.cc + src/util/url.cc + src/util/url.h src/util/xml_to_json.cc src/util/xml_to_json.h src/web/action.cc @@ -234,6 +234,8 @@ src/web/add_object.cc src/web/auth.cc src/web/clients.cc + src/web/config_load.cc + src/web/config_save.cc src/web/containers.cc src/web/directories.cc src/web/edit_load.cc @@ -250,18 +252,42 @@ src/web/tasks.cc src/web/web_autoscan.cc src/web/web_update.cc - ) +) target_include_directories(libgerbera PUBLIC "${CMAKE_SOURCE_DIR}/src") add_executable(gerbera src/main.cc) -target_link_libraries(gerbera libgerbera) +target_link_libraries(gerbera PRIVATE libgerbera) + +# Warnings are nice +target_compile_options(gerbera PRIVATE -Wall) +target_compile_options(libgerbera PRIVATE -Wall) + +# Add the automatically determined parts of the RPATH which point to +# directories outside the build tree to the install RPATH +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + +# System specific stuff +if (${CMAKE_SYSTEM_NAME} MATCHES ".*(SunOS|Solaris).*") + target_compile_definitions(libgerbera PUBLIC SOLARIS) +elseif (${CMAKE_SYSTEM_NAME} MATCHES ".*BSD.*") + target_compile_definitions(libgerbera PUBLIC BSD) +endif() # Generate Compile Information include("GenCompileInfo") generate_compile_info() -target_compile_definitions(gerbera PRIVATE -DCOMPILE_INFO="${COMPILE_INFO}") -target_compile_definitions(gerbera PRIVATE -DGIT_BRANCH="${GIT_BRANCH}") -target_compile_definitions(gerbera PRIVATE -DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}") +target_compile_definitions(gerbera PRIVATE COMPILE_INFO="${COMPILE_INFO}") +target_compile_definitions(gerbera PRIVATE GIT_BRANCH="${GIT_BRANCH}") +target_compile_definitions(gerbera PRIVATE GIT_COMMIT_HASH="${GIT_COMMIT_HASH}") + +if ((${GERBERA_VERSION} STREQUAL "git") AND (NOT "${GIT_TAG}" STREQUAL "")) + # Master/git build so use git info + set(GERBERA_VERSION ${GIT_TAG}) +endif() +message(STATUS "Gerbera Version: ${GERBERA_VERSION}") +target_compile_definitions(libgerbera PUBLIC GERBERA_VERSION="${GERBERA_VERSION}") + +target_compile_definitions(gerbera PRIVATE PACKAGE_DATADIR="${CMAKE_INSTALL_PREFIX}/share/gerbera") # Check for C++17 STL Optional include(CheckIncludeFileCXX) @@ -271,226 +297,269 @@ endif() if (WITH_DEBUG) - add_definitions(-DTOMBDEBUG) - add_definitions(-DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_DEBUG) + target_compile_definitions(libgerbera PUBLIC TOMBDEBUG) + target_compile_definitions(libgerbera PUBLIC SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_DEBUG) else() - add_definitions(-DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_INFO) + target_compile_definitions(libgerbera PUBLIC SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_INFO) endif() find_package(Threads REQUIRED) -target_link_libraries(libgerbera Threads::Threads) +target_link_libraries(libgerbera PUBLIC Threads::Threads) check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_ATOMIC) if(HAVE_ATOMIC) - target_link_libraries(libgerbera atomic) + target_link_libraries(libgerbera PUBLIC atomic) endif(HAVE_ATOMIC) find_package(Filesystem REQUIRED) -target_link_libraries(libgerbera std::filesystem) +target_link_libraries(libgerbera PUBLIC std::filesystem) find_package(Iconv REQUIRED) -target_link_libraries(libgerbera Iconv::Iconv) +target_link_libraries(libgerbera PUBLIC Iconv::Iconv) find_package(libuuid REQUIRED) -include_directories(${libuuid_INCLUDE_DIRS}) -target_link_libraries(libgerbera ${libuuid_LIBRARIES}) +target_include_directories(libgerbera PUBLIC ${libuuid_INCLUDE_DIRS}) +target_link_libraries(libgerbera PUBLIC ${libuuid_LIBRARIES}) if (FOUND_BSD_UUID) - add_definitions(-DBSD_NATIVE_UUID) + target_compile_definitions(libgerbera PUBLIC BSD_NATIVE_UUID) endif() find_package(LFS REQUIRED) -add_definitions(${LFS_DEFINITIONS}) -add_compile_options(${LFS_COMPILE_OPTIONS}) -target_link_libraries(libgerbera ${LFS_LIBRARIES}) +target_compile_definitions(libgerbera PUBLIC ${LFS_DEFINITIONS}) +target_compile_options(libgerbera PUBLIC ${LFS_COMPILE_OPTIONS}) +target_link_libraries(libgerbera PUBLIC ${LFS_LIBRARIES}) -find_package (pupnp "1.12.1" REQUIRED) +if (WITH_NPUPNP) + find_package(PkgConfig QUIET) + pkg_check_modules(NPUPNP QUIET libnpupnp>=4.1.2) + if (NOT NPUPNP_FOUND) + find_package(NPUPNP REQUIRED) + endif() + target_include_directories(libgerbera PUBLIC ${NPUPNP_INCLUDE_DIRS}) + target_compile_definitions(libgerbera PUBLIC USING_NPUPNP) + target_link_libraries(libgerbera PUBLIC ${NPUPNP_LIBRARIES}) +else() + set(REQ_UPNP_VERSION 1.14.0) + # LibUPnP official target since 1.16 (Lib version 18) + # This will prefer the provided UPNPConfig.cmake if found, if not, it will fall back our FindUPNP.cmake + find_package(UPNP ${REQ_UPNP_VERSION} QUIET) + if(NOT TARGET UPNP::UPNP) + # Conan packages have autogenerated CMake packages under pupnp::pupnp + find_package(pupnp ${REQ_UPNP_VERSION} QUIET) + if(TARGET pupnp::pupnp)# + add_library(UPNP::UPNP ALIAS pupnp::pupnp) + endif() + endif() + if(NOT TARGET UPNP::UPNP) + message(FATAL_ERROR "Gerbera failed to find libupnp! at least version ${REQ_UPNP_VERSION} is needed.") + endif() + # Conan autogenerated targets dont set a version, but to set name_VERSION var + get_target_property(_UPNP_VERSION UPNP::UPNP VERSION) + if (NOT _UPNP_VERSION) + set(_UPNP_VERSION ${pupnp_VERSION}) + endif() + get_target_property(_UPNP_LIB UPNP::UPNP LOCATION) + # Provide our own status message as we search QUIET-ly + message(STATUS "Found libupnp: ${_UPNP_LIB} (found version ${_UPNP_VERSION})") + + # Check and warn for libupnp features + include(CheckCXXSymbolExists) + get_target_property(UPNP_INCLUDE_DIR UPNP::UPNP INTERFACE_INCLUDE_DIRECTORIES) + check_cxx_symbol_exists(UPNP_ENABLE_IPV6 "${UPNP_INCLUDE_DIR}/upnpconfig.h" UPNP_HAS_IPV6) + if (NOT UPNP_HAS_IPV6) + message(FATAL_ERROR "Gerbera requires libupnp with IPv6 support.") + endif() -set(CMAKE_REQUIRED_LIBRARIES pupnp::pupnp) + check_cxx_symbol_exists(UPNP_MINISERVER_REUSEADDR "${UPNP_INCLUDE_DIR}/upnpconfig.h" UPNP_HAS_REUSEADDR) + if (NOT UPNP_HAS_REUSEADDR) + message(WARNING [=[ + !! It is strongly recommended to build libupnp with --enable-reuseaddr !! + Without this option Gerbera will be unable to restart with the same port number.]=]) + endif() -check_cxx_symbol_exists(UPNP_ENABLE_IPV6 "upnpconfig.h" UPNP_HAS_IPV6) -if (NOT UPNP_HAS_IPV6) - message(FATAL_ERROR "Gerbera requires libupnp with IPv6 support.") -endif() + check_cxx_symbol_exists(UPNP_ENABLE_BLOCKING_TCP_CONNECTIONS "${UPNP_INCLUDE_DIR}/upnpconfig.h" UPNP_HAS_BLOCKING_TCP) + if (UPNP_HAS_BLOCKING_TCP) + message(WARNING [=[ + !! It is strongly recommended to build libupnp with --disable-blocking-tcp-connections !! + Without this option non-responsive control points can cause libupnp to hang.]=]) + endif() -check_cxx_symbol_exists(UPNP_MINISERVER_REUSEADDR "upnpconfig.h" UPNP_HAS_REUSEADDR) -if (NOT UPNP_HAS_REUSEADDR) - message(WARNING [=[ -!! It is strongly recommended to build libupnp with --enable-reuseaddr !! -Without this option Gerbera will be unable to restart with the same port number.]=]) -endif() + check_cxx_symbol_exists(UPNP_HAVE_TOOLS "${UPNP_INCLUDE_DIR}/upnpconfig.h" UPNP_HAS_TOOLS) + if (NOT UPNP_HAS_TOOLS) + message(WARNING [=[ + !! It is strongly recommended to build libupnp with --enable-tools !! + ]=]) + endif() -target_link_libraries (libgerbera pupnp::pupnp) + target_link_libraries(libgerbera PUBLIC UPNP::UPNP) +endif() -find_package(fmt REQUIRED) -target_link_libraries(libgerbera fmt::fmt) +find_package(fmt 5.3 REQUIRED) +target_link_libraries(libgerbera PUBLIC fmt::fmt) find_package(spdlog REQUIRED) -target_link_libraries(libgerbera spdlog::spdlog) +target_link_libraries(libgerbera PUBLIC spdlog::spdlog) find_package(pugixml REQUIRED) -target_link_libraries(libgerbera pugixml::pugixml) +target_link_libraries(libgerbera PUBLIC pugixml::pugixml) -find_package(SQLite3 REQUIRED) -# Unfortunately Conan and CMake Find module produce slightly different targets. -if(TARGET SQLite::SQLite3) - target_link_libraries(libgerbera SQLite::SQLite3) -else() - target_link_libraries(libgerbera SQLite3::SQLite3) -endif() +find_package(SQLite3 3.7.0 REQUIRED) +target_link_libraries(libgerbera PUBLIC SQLite::SQLite3) # We should probably move these two out to their own FindLocale include(CheckFunctionExists) check_function_exists(nl_langinfo HAVE_NL_LANGINFO) if (HAVE_NL_LANGINFO) - add_definitions("-DHAVE_NL_LANGINFO") + target_compile_definitions(libgerbera PUBLIC HAVE_NL_LANGINFO) endif() check_function_exists(setlocale HAVE_SETLOCALE) if (HAVE_SETLOCALE) - add_definitions("-DHAVE_SETLOCALE") + target_compile_definitions(libgerbera PUBLIC HAVE_SETLOCALE) endif() # Link to the socket library if it exists. This is something you need on Solaris/OmniOS/Joyent find_library(SOCKET_LIBRARY socket) if(SOCKET_LIBRARY) - set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${SOCKET_LIBRARY}) - target_link_libraries(libgerbera ${SOCKET_LIBRARY}) + target_link_libraries(libgerbera PUBLIC ${SOCKET_LIBRARY}) endif() # Link to libnsl (Network services library) if it exists. This is something you need on Solaris/OmniOS/Joyent find_library(NSL_LIBRARY nsl) if(NSL_LIBRARY) - set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${NSL_LIBRARY}) - target_link_libraries(libgerbera ${NSL_LIBRARY}) + target_link_libraries(libgerbera PUBLIC ${NSL_LIBRARY}) endif() if(WITH_INOTIFY) - find_package(INotify) + find_package(INotify REQUIRED) if(INOTIFY_FOUND) - include_directories(${INOTIFY_INCLUDE_DIR}) - add_definitions(-DHAVE_INOTIFY) + target_include_directories(libgerbera PUBLIC ${INOTIFY_INCLUDE_DIR}) + target_compile_definitions(libgerbera PUBLIC HAVE_INOTIFY) # FreeBSD INotify shim! if(INOTIFY_LIBRARY) - target_link_libraries(libgerbera ${INOTIFY_LIBRARY}) + target_link_libraries(libgerbera PUBLIC ${INOTIFY_LIBRARY}) endif() - endif () + endif() endif() if(WITH_JS) find_package(duktape REQUIRED) - target_link_libraries(libgerbera duktape::duktape) - add_definitions(-DHAVE_JS) + target_link_libraries(libgerbera PUBLIC duktape::duktape) + target_compile_definitions(libgerbera PUBLIC HAVE_JS) endif() if(WITH_MYSQL) - find_package(MySQL REQUIRED) - include_directories(${MYSQL_INCLUDE_DIRS}) - target_link_libraries (libgerbera ${MYSQL_CLIENT_LIBS}) - add_definitions(-DHAVE_MYSQL) + find_package(mariadb-connector-c QUIET) + if(mariadb-connector-c_FOUND) + target_include_directories(libgerbera PUBLIC ${mariadb-connector-c_INCLUDE_DIRS}) + target_link_libraries(libgerbera PUBLIC ${mariadb-connector-c_LIBS}) + target_compile_definitions(libgerbera PUBLIC HAVE_MYSQL) + + find_package(OpenSSL REQUIRED) + target_include_directories(libgerbera PUBLIC ${OpenSSL_INCLUDE_DIRS}) + target_link_libraries(libgerbera PUBLIC ${OpenSSL_LIBS}) + else() + find_package(MySQL REQUIRED) + target_include_directories(libgerbera PUBLIC ${MYSQL_INCLUDE_DIRS}) + target_link_libraries(libgerbera PUBLIC ${MYSQL_CLIENT_LIBS}) + target_compile_definitions(libgerbera PUBLIC HAVE_MYSQL) + endif() endif() if(WITH_CURL) find_package(PkgConfig QUIET) - pkg_check_modules (CURL QUIET libcurl) + pkg_check_modules(CURL QUIET libcurl) if (NOT CURL_FOUND) - find_package (CURL REQUIRED) - endif() - if (CURL_FOUND) - include_directories(${CURL_INCLUDE_DIRS}) - target_link_libraries (libgerbera ${CURL_LIBRARIES}) - - add_definitions(-DHAVE_CURL) - add_definitions(-DONLINE_SERVICES) - add_definitions(-DATRAILERS) - add_definitions(-DSOPCAST) - else() - message(FATAL_ERROR "cURL not found") + find_package(CURL REQUIRED) endif() + + target_include_directories(libgerbera PUBLIC ${CURL_INCLUDE_DIRS}) + target_link_libraries(libgerbera PUBLIC ${CURL_LIBRARIES}) + + target_compile_definitions(libgerbera PUBLIC + HAVE_CURL + ONLINE_SERVICES + ATRAILERS + SOPCAST) endif() if(WITH_TAGLIB) - find_package (Taglib REQUIRED) - include_directories(${TAGLIB_INCLUDE_DIRS}) - target_link_libraries (libgerbera ${TAGLIB_LIBRARIES}) - add_definitions(-DHAVE_TAGLIB) + find_package(Taglib REQUIRED) + target_include_directories(libgerbera PUBLIC ${TAGLIB_INCLUDE_DIRS}) + target_link_libraries(libgerbera PUBLIC ${TAGLIB_LIBRARIES}) + target_compile_definitions(libgerbera PUBLIC HAVE_TAGLIB) endif() if(WITH_MAGIC) - find_package (LibMagic REQUIRED) - include_directories(${MAGIC_INCLUDE_DIRS}) - target_link_libraries (libgerbera ${MAGIC_LIBRARIES}) - add_definitions(-DHAVE_MAGIC) + find_package(LibMagic REQUIRED) + target_include_directories(libgerbera PUBLIC ${LibMagic_INCLUDE_DIRS}) + target_link_libraries(libgerbera PUBLIC ${LibMagic_LIBRARIES}) + target_compile_definitions(libgerbera PUBLIC HAVE_MAGIC) endif() if(WITH_AVCODEC) - find_package (FFMPEG REQUIRED) - target_link_libraries(libgerbera PkgConfig::FFMPEG) - add_definitions(-DHAVE_FFMPEG) + find_package(FFMPEG REQUIRED) + target_link_libraries(libgerbera PUBLIC PkgConfig::FFMPEG) + target_compile_definitions(libgerbera PUBLIC HAVE_FFMPEG) include(CheckStructHasMember) set(CMAKE_REQUIRED_LIBRARIES PkgConfig::FFMPEG) check_struct_has_member("struct AVStream" codecpar libavformat/avformat.h HAVE_AVSTREAM_CODECPAR LANGUAGE C) if (HAVE_AVSTREAM_CODECPAR) - add_definitions(-DHAVE_AVSTREAM_CODECPAR) + target_compile_definitions(libgerbera PUBLIC HAVE_AVSTREAM_CODECPAR) endif() endif() if(WITH_FFMPEGTHUMBNAILER) - find_package (FFMpegThumbnailer) - if (FFMPEGTHUMBNAILER_FOUND) - include_directories(${FFMPEGTHUMBNAILER_INCLUDE_DIR}) - target_link_libraries (libgerbera ${FFMPEGTHUMBNAILER_LIBRARIES}) - add_definitions(-DHAVE_FFMPEGTHUMBNAILER) - else() - message(FATAL_ERROR "FFMpegThumbnailer not found") - endif () + find_package (FFMpegThumbnailer REQUIRED) + target_include_directories(libgerbera PUBLIC ${FFMPEGTHUMBNAILER_INCLUDE_DIR}) + target_link_libraries(libgerbera PUBLIC ${FFMPEGTHUMBNAILER_LIBRARIES}) + target_compile_definitions(libgerbera PUBLIC HAVE_FFMPEGTHUMBNAILER) + if (FFMPEGTHUMBNAILER_VERSION_STRING VERSION_GREATER 2.2.0) + target_compile_definitions(libgerbera PUBLIC HAVE_FFMPEGTHUMBNAILER_SIZE_API) + endif() endif() if(WITH_EXIF) - find_package (EXIF REQUIRED) - include_directories(${EXIF_INCLUDE_DIRS}) - target_link_libraries (libgerbera ${EXIF_LIBRARIES}) - add_definitions(-DHAVE_LIBEXIF) + find_package(EXIF REQUIRED) + target_include_directories(libgerbera PUBLIC ${EXIF_INCLUDE_DIRS}) + target_link_libraries(libgerbera PUBLIC ${EXIF_LIBRARIES}) + target_compile_definitions(libgerbera PUBLIC HAVE_LIBEXIF) endif() if(WITH_EXIV2) - find_package (EXIV2) - if (EXIV2_FOUND) - include_directories(${EXIV2_INCLUDE_DIRS}) - target_link_libraries (libgerbera ${EXIV2_LIBRARIES}) - add_definitions(-DHAVE_EXIV2) - # Exiv still uses std::auto_ptr - if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_definitions(-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) - endif() - else() - message(FATAL_ERROR "Exiv2 not found") + find_package(EXIV2 REQUIRED) + target_include_directories(libgerbera PUBLIC ${EXIV2_INCLUDE_DIRS}) + target_link_libraries(libgerbera PUBLIC ${EXIV2_LIBRARIES}) + target_compile_definitions(libgerbera PUBLIC HAVE_EXIV2) + # Exiv still uses std::auto_ptr + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_definitions(libgerbera PUBLIC _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) endif() endif() if(WITH_MATROSKA) - find_package (Matroska) - if (MATROSKA_FOUND AND EBML_FOUND) - include_directories(${MATROSKA_INCLUDE_DIRS}) - target_link_libraries (libgerbera ${MATROSKA_LIBRARIES}) - include_directories(${EBML_INCLUDE_DIRS}) - target_link_libraries (libgerbera ${EBML_LIBRARIES}) - add_definitions(-DHAVE_MATROSKA) - else() - message(FATAL_ERROR "Matroska not found") - endif() + find_package(EBML REQUIRED) + + target_include_directories(libgerbera PUBLIC ${EBML_INCLUDE_DIRS}) + target_link_libraries(libgerbera PUBLIC ${EBML_LIBRARIES}) + + find_package(Matroska REQUIRED) + target_include_directories(libgerbera PUBLIC ${Matroska_INCLUDE_DIRS}) + target_link_libraries(libgerbera PUBLIC ${Matroska_LIBRARIES}) + + target_compile_definitions(libgerbera PUBLIC HAVE_MATROSKA) endif() if(WITH_LASTFM) - find_package (LastFMLib) - if (LASTFMLIB_FOUND) - include_directories(${LASTFMLIB_INCLUDE_DIRS}) - target_link_libraries (libgerbera ${LASTFMLIB_LIBRARIES}) - add_definitions(-DHAVE_LASTFMLIB) - else() - message(FATAL_ERROR "LastFMLib not found") - endif() + find_package (LastFMLib REQUIRED) + target_include_directories(libgerbera PUBLIC ${LASTFMLIB_INCLUDE_DIRS}) + target_link_libraries(libgerbera PUBLIC ${LASTFMLIB_LIBRARIES}) + target_compile_definitions(libgerbera PUBLIC HAVE_LASTFMLIB) endif() +find_package (ZLIB REQUIRED) +target_link_libraries (libgerbera PUBLIC ZLIB::ZLIB) + if(WITH_SYSTEMD) find_package(Systemd) if(SYSTEMD_FOUND) @@ -510,10 +579,6 @@ endif() endif() -# Needs to be towards the end (after CURL, TagLib, etc...) -find_package (ZLIB REQUIRED) -target_link_libraries (libgerbera ZLIB::ZLIB) - if(WITH_TESTS) message(STATUS "Configuring unit tests") enable_testing() @@ -524,8 +589,9 @@ INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/scripts/js DESTINATION share/gerbera) INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/web DESTINATION share/gerbera) INSTALL(FILES - ${PROJECT_SOURCE_DIR}/config/mappings.xml - ${PROJECT_SOURCE_DIR}/config/mysql.sql - ${PROJECT_SOURCE_DIR}/config/sqlite3.sql + src/database/mysql/mysql.sql + src/database/sqlite3/sqlite3.sql DESTINATION share/gerbera) INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/gerbera.1 DESTINATION share/man/man1) + +include(packaging) diff -Nru gerbera-1.6.0/conanfile.py gerbera-1.8.2/conanfile.py --- gerbera-1.6.0/conanfile.py 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/conanfile.py 2021-05-31 22:04:08.000000000 +0000 @@ -39,13 +39,13 @@ scm = {"type": "git", "url": "auto", "revision": "auto"} requires = [ - "fmt/6.2.1", - "spdlog/1.6.0", + "fmt/[>=7.1.3]", + "spdlog/[>=1.8.5]", "pugixml/1.10", "libiconv/1.16", - "sqlite3/3.31.1", + "sqlite3/[>3.31.1]", "zlib/1.2.11", - "pupnp/1.12.1", + "pupnp/[>=1.14.0]", ] def configure(self): @@ -70,6 +70,12 @@ if self.options.js: self.requires("duktape/2.5.0") + if self.options.curl: + self.requires("libcurl/[>=7.74.0]") + + if self.options.mysql: + self.requires("mariadb-connector-c/3.1.11") + if not self._needs_system_uuid: self.requires("libuuid/1.0.3") @@ -96,7 +102,7 @@ installer.install( { "apt": "libmagic-dev", - "pacman": "file-dev", + "pacman": "file", "yum": "file-devel", "freebsd": [], }[pm] @@ -106,7 +112,7 @@ installer.install( { "apt": "libtag1-dev", - "pacman": "taglib-dev", + "pacman": "taglib", "yum": "libtag-devel", "freebsd": "taglib", }[pm] @@ -116,7 +122,7 @@ installer.install( { "apt": "libexif-dev", - "pacman": "libexif-dev", + "pacman": "libexif", "yum": "libexif-devel", "freebsd": "libexif", }[pm] @@ -126,39 +132,17 @@ installer.install( { "apt": "libmatroska-dev", - "pacman": "libmatroska-dev", + "pacman": "libmatroska", "yum": "libmatroska-devel", "freebsd": "libmatroska", }[pm] ) - # Note: there is a CURL Conan package, but it depends on openssl - # which is also in Conan. - if self.options.curl: - installer.install( - { - "apt": "libcurl4-openssl-dev", - "pacman": "curl-dev", - "yum": "libcurl-devel", - "freebsd": "curl", - }[pm] - ) - - if self.options.mysql: - installer.install( - { - "apt": "libmariadb-dev", - "pacman": "mariadb-connector-c-dev", - "yum": "mariadb-connector-c-devel", - "freebsd": "mysql-connector-c", - }[pm] - ) - if self.options.ffmpeg: installer.install( { "apt": "libavformat-dev", - "pacman": "ffmpeg-dev", + "pacman": "ffmpeg", "yum": "ffmpeg-devel", "freebsd": "ffmpeg", }[pm] @@ -173,7 +157,7 @@ installer.install( { "apt": "libffmpegthumbnailer-dev", - "pacman": "ffmpegthumbnailer-dev", + "pacman": "ffmpegthumbnailer", "yum": "ffmpegthumbnailer-devel", "freebsd": "ffmpegthumbnailer", }[pm] diff -Nru gerbera-1.6.0/config/bin2hex.pl gerbera-1.8.2/config/bin2hex.pl --- gerbera-1.6.0/config/bin2hex.pl 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/config/bin2hex.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -#!/usr/bin/perl - -# -# bin2hex.pl by Chami.com -# http://www.chami.com/tips/ -# - -# number of characters per line -$chars_per_line = 15; - -# ------------------------------------- - -# language id -# -# 0 = Perl (default) -# 1 = C / C++ -# 2 = Pascal / Delphi -# -$lang = $ARGV[1]; - -$rem_begin = "begin binary data:"; -$rem_end = "end binary data."; - -# initialize for Perl strings -# by default -$_var = "# $rem_begin\n". - "$bin_data = # %d}n"; -$_begin = "\""; -$_end = "\";}\n"; -$_break = "\".\n\""; -$_format = "\\x%02X"; -$_separator = ""; -$_comment = "# $rem_end ". - "size = %d bytes"; - - -# C / C++ -if(1 == $lang) -{ - $_var = "/* $rem_begin */\n". - "char bin_data[] = ". - "/* %d */\n"; - $_begin = "{"; - $_end = "};\n"; - $_break = "\n"; - $_format = "0x%02X"; - $_separator = ","; - $_comment = "/* $rem_end ". - "size = %d bytes */"; -} -elsif(2 == $lang) -{ - $_var = "{ $rem_begin }\n". - "const bin_data : ". - "array [1..%d] of ". - "byte = \n"; - $_begin = "("; - $_end = ");\n"; - $_break = "\n"; - $_format = "$%02X"; - $_separator = ","; - $_comment = "{ $rem_end ". - "size = %d bytes }"; -} - -if(open(F, "<".$ARGV[0])) -{ - binmode(F); - - $s = ''; - $i = 0; - $count = 0; - $first = 1; - $s .= $_begin; - while(!eof(F)) - { - if($i >= $chars_per_line) - { - $s .= $_break; - $i = 0; - } - if(!$first) - { - $s .= $_separator; - } - $s .= sprintf( - $_format, ord(getc(F))); - ++$i; - ++$count; - $first = 0; - } - $s .= $_end; - $s .= sprintf $_comment, $count; - $s .= "\n\n"; - - $s = "\n".sprintf($_var, $count).$s; - - print $s; - - close( F ); -} -else -{ - print - "bin2hex.pl by Chami.com\n". - "\n". - "usage:\n". - " perl bin2hex.pl ". - " \n". - "\n". - " : path to the ". - "binary file\n". - " : 0 = Perl, ". - "1 = C/C++/Java, ". - "2 = Pascal/Delphi\n". - "\n"; -} - diff -Nru gerbera-1.6.0/config/config2.xsd gerbera-1.8.2/config/config2.xsd --- gerbera-1.6.0/config/config2.xsd 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/config/config2.xsd 2021-05-31 22:04:08.000000000 +0000 @@ -72,6 +72,7 @@ + @@ -81,7 +82,9 @@ + + @@ -289,7 +292,7 @@ - + @@ -297,14 +300,15 @@ + - + @@ -349,6 +353,7 @@ + @@ -360,6 +365,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -390,11 +436,17 @@ + + + + + + @@ -402,6 +454,7 @@ + @@ -410,6 +463,7 @@ + @@ -425,6 +479,9 @@ + + + @@ -435,11 +492,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -476,6 +592,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -543,11 +681,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + @@ -561,14 +752,25 @@ + + + + + + + + + + - + + @@ -577,6 +779,7 @@ + @@ -612,6 +815,7 @@ + @@ -627,6 +831,7 @@ + diff -Nru gerbera-1.6.0/config/config.xsd gerbera-1.8.2/config/config.xsd --- gerbera-1.6.0/config/config.xsd 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/config/config.xsd 2021-05-31 22:04:08.000000000 +0000 @@ -72,6 +72,7 @@ + @@ -80,7 +81,9 @@ + + @@ -200,14 +203,15 @@ + - + @@ -251,6 +255,7 @@ + @@ -261,6 +266,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -291,12 +337,17 @@ + + + + + @@ -304,6 +355,7 @@ + @@ -312,6 +364,7 @@ + @@ -327,6 +380,9 @@ + + + @@ -337,11 +393,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -378,6 +493,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -445,11 +581,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + @@ -463,22 +652,34 @@ + - + + - + + + + + + + + + + + @@ -514,6 +715,7 @@ + @@ -529,6 +731,7 @@ + diff -Nru gerbera-1.6.0/config/generate-c-cource-from-dump.sh gerbera-1.8.2/config/generate-c-cource-from-dump.sh --- gerbera-1.6.0/config/generate-c-cource-from-dump.sh 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/config/generate-c-cource-from-dump.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -#!/bin/sh - -case "$1" in - "mysql"*) - FN=mysql.sql - DEF=MS_CREATE_SQL - VARIABLE=mysql_create_sql - FN_FINAL=mysql_create_sql.h - ;; - "sqlite"*) - FN=sqlite3.sql - DEF=SL3_CREATE_SQL - VARIABLE=sqlite3_create_sql - FN_FINAL=sqlite3_create_sql.h - ;; - *) - echo 'illegal parameter' - exit - ;; -esac - -./zpipe < $FN > ${FN}.Z - -REAL_SIZE=`du -b --apparent-size $FN | awk '{print $1}'` -GZIPPED_SIZE=`du -b --apparent-size $FN.Z | awk '{print $1}'` - -FN_Z_C=${FN}.Z.c - -echo "#define ${DEF}_INFLATED_SIZE $REAL_SIZE" > $FN_Z_C -echo "#define ${DEF}_DEFLATED_SIZE $GZIPPED_SIZE" >> $FN_Z_C - -./bin2hex.pl ${FN}.Z 1 | sed "s/char bin_data/const unsigned char ${VARIABLE}/" >> $FN_Z_C - -cat ${FN}.tmpl.h $FN_Z_C ${FN}.tmpl.f > ${FN_FINAL} diff -Nru gerbera-1.6.0/config/mappings.xml gerbera-1.8.2/config/mappings.xml --- gerbera-1.6.0/config/mappings.xml 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/config/mappings.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru gerbera-1.6.0/config/mysql.sql gerbera-1.8.2/config/mysql.sql --- gerbera-1.6.0/config/mysql.sql 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/config/mysql.sql 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -CREATE TABLE `mt_cds_object` ( - `id` int(11) NOT NULL auto_increment, - `ref_id` int(11) default NULL, - `parent_id` int(11) NOT NULL default '0', - `object_type` tinyint(4) unsigned NOT NULL, - `upnp_class` varchar(80) default NULL, - `dc_title` varchar(255) default NULL, - `location` blob, - `location_hash` int(11) unsigned default NULL, - `metadata` blob, - `auxdata` blob, - `resources` blob, - `update_id` int(11) NOT NULL default '0', - `mime_type` varchar(40) default NULL, - `flags` int(11) unsigned NOT NULL default '1', - `track_number` int(11) default NULL, - `service_id` varchar(255) default NULL, - PRIMARY KEY (`id`), - KEY `cds_object_ref_id` (`ref_id`), - KEY `cds_object_parent_id` (`parent_id`,`object_type`,`dc_title`), - KEY `cds_object_object_type` (`object_type`), - KEY `location_parent` (`location_hash`,`parent_id`), - KEY `cds_object_track_number` (`track_number`), - KEY `cds_object_service_id` (`service_id`), - CONSTRAINT `mt_cds_object_ibfk_1` FOREIGN KEY (`ref_id`) REFERENCES `mt_cds_object` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `mt_cds_object_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `mt_cds_object` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=MyISAM CHARSET=utf8; -INSERT INTO `mt_cds_object` VALUES (-1,NULL,-1,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,9,NULL,NULL); -INSERT INTO `mt_cds_object` VALUES (0,NULL,-1,1,'object.container','Root',NULL,NULL,NULL,NULL,NULL,0,NULL,9,NULL,NULL); -UPDATE `mt_cds_object` SET `id`='0' WHERE `id`='1'; -INSERT INTO `mt_cds_object` VALUES (1,NULL,0,1,'object.container','PC Directory',NULL,NULL,NULL,NULL,NULL,0,NULL,9,NULL,NULL); -CREATE TABLE `mt_cds_active_item` ( - `id` int(11) NOT NULL, - `action` varchar(255) NOT NULL, - `state` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `mt_cds_active_item_ibfk_1` FOREIGN KEY (`id`) REFERENCES `mt_cds_object` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=MyISAM CHARSET=utf8; -CREATE TABLE `mt_internal_setting` ( - `key` varchar(40) NOT NULL, - `value` varchar(255) NOT NULL, - PRIMARY KEY (`key`) -) ENGINE=MyISAM CHARSET=utf8; -INSERT INTO `mt_internal_setting` VALUES ('db_version','5'); -CREATE TABLE `mt_autoscan` ( - `id` int(11) NOT NULL auto_increment, - `obj_id` int(11) default NULL, - `scan_level` enum('basic','full') NOT NULL, - `scan_mode` enum('timed','inotify') NOT NULL, - `recursive` tinyint(4) unsigned NOT NULL, - `hidden` tinyint(4) unsigned NOT NULL, - `interval` int(11) unsigned default NULL, - `last_modified` bigint(20) unsigned default NULL, - `persistent` tinyint(4) unsigned NOT NULL default '0', - `location` blob, - `path_ids` blob, - `touched` tinyint(4) unsigned NOT NULL default '1', - PRIMARY KEY `id` (`id`), - UNIQUE KEY `mt_autoscan_obj_id` (`obj_id`), - CONSTRAINT `mt_autoscan_ibfk_1` FOREIGN KEY (`obj_id`) REFERENCES `mt_cds_object` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=MyISAM CHARSET=utf8; -CREATE TABLE `mt_metadata` ( - `id` int(11) NOT NULL auto_increment, - `item_id` int(11) NOT NULL, - `property_name` varchar(255) NOT NULL, - `property_value` text NOT NULL, - PRIMARY KEY `id` (`id`), - KEY `metadata_item_id` (`item_id`), - CONSTRAINT `mt_metadata_idfk1` FOREIGN KEY (`item_id`) REFERENCES `mt_cds_object` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=MyISAM CHARSET=utf8; -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; diff -Nru gerbera-1.6.0/config/mysql.sql.tmpl.f gerbera-1.8.2/config/mysql.sql.tmpl.f --- gerbera-1.6.0/config/mysql.sql.tmpl.f 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/config/mysql.sql.tmpl.f 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#endif // __MYSQL_CREATE_SQL_H__ - -#endif // HAVE_MYSQL diff -Nru gerbera-1.6.0/config/mysql.sql.tmpl.h gerbera-1.8.2/config/mysql.sql.tmpl.h --- gerbera-1.6.0/config/mysql.sql.tmpl.h 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/config/mysql.sql.tmpl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -/*MT* - - MediaTomb - http://www.mediatomb.cc/ - - mysql_create_sql.h - this file is part of MediaTomb. - - Copyright (C) 2005 Gena Batyan , - Sergey 'Jin' Bostandzhyan - - Copyright (C) 2006-2010 Gena Batyan , - Sergey 'Jin' Bostandzhyan , - Leonhard Wimmer - - MediaTomb is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 - as published by the Free Software Foundation. - - MediaTomb is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - version 2 along with MediaTomb; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - - $Id$ -*/ - -/// \file mysql_create_sql.h - -#ifdef HAVE_MYSQL - -#ifndef __MYSQL_CREATE_SQL_H__ -#define __MYSQL_CREATE_SQL_H__ diff -Nru gerbera-1.6.0/config/pgsql.sql.tmpl.f gerbera-1.8.2/config/pgsql.sql.tmpl.f --- gerbera-1.6.0/config/pgsql.sql.tmpl.f 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/config/pgsql.sql.tmpl.f 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#endif // __PGSQL_CREATE_SQL_H__ - -#endif // HAVE_PGSQL diff -Nru gerbera-1.6.0/config/pgsql.sql.tmpl.h gerbera-1.8.2/config/pgsql.sql.tmpl.h --- gerbera-1.6.0/config/pgsql.sql.tmpl.h 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/config/pgsql.sql.tmpl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -/*MT* - - MediaTomb - http://www.mediatomb.cc/ - - pgsql_create_sql.h - this file is part of MediaTomb. - - Copyright (C) 2005 Gena Batyan , - Sergey 'Jin' Bostandzhyan - - Copyright (C) 2006-2010 Gena Batyan , - Sergey 'Jin' Bostandzhyan , - Leonhard Wimmer - - MediaTomb is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 - as published by the Free Software Foundation. - - MediaTomb is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - version 2 along with MediaTomb; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - - $Id$ -*/ - -/// \file pgsql_create_sql.h - -#ifdef HAVE_PGSQL - -#ifndef __PGSQL_CREATE_SQL_H__ -#define __PGSQL_CREATE_SQL_H__ diff -Nru gerbera-1.6.0/config/sqlite3.sql gerbera-1.8.2/config/sqlite3.sql --- gerbera-1.6.0/config/sqlite3.sql 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/config/sqlite3.sql 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -BEGIN TRANSACTION; -CREATE TABLE "mt_cds_object" ( - "id" integer primary key, - "ref_id" integer default NULL, - "parent_id" integer NOT NULL default 0, - "object_type" tinyint unsigned NOT NULL, - "upnp_class" varchar(80) default NULL, - "dc_title" varchar(255) default NULL, - "location" text default NULL, - "location_hash" integer unsigned default NULL, - "metadata" text default NULL, - "auxdata" text default NULL, - "resources" text default NULL, - "update_id" integer NOT NULL default 0, - "mime_type" varchar(40) default NULL, - "flags" integer unsigned NOT NULL default 1, - "track_number" integer default NULL, - "service_id" varchar(255) default NULL, - CONSTRAINT "cds_object_ibfk_1" FOREIGN KEY ("ref_id") REFERENCES "mt_cds_object" ("id") ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT "cds_object_ibfk_2" FOREIGN KEY ("parent_id") REFERENCES "mt_cds_object" ("id") ON DELETE CASCADE ON UPDATE CASCADE -); -INSERT INTO "mt_cds_object" VALUES(-1, NULL, -1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 9, NULL, NULL); -INSERT INTO "mt_cds_object" VALUES(0, NULL, -1, 1, 'object.container', 'Root', NULL, NULL, NULL, NULL, NULL, 0, NULL, 9, NULL, NULL); -INSERT INTO "mt_cds_object" VALUES(1, NULL, 0, 1, 'object.container', 'PC Directory', NULL, NULL, NULL, NULL, NULL, 0, NULL, 9, NULL, NULL); -CREATE TABLE "mt_cds_active_item" ( - "id" integer primary key, - "action" varchar(255) NOT NULL, - "state" varchar(255) NOT NULL, - CONSTRAINT "mt_cds_active_item_ibfk_1" FOREIGN KEY ("id") REFERENCES "mt_cds_object" ("id") ON DELETE CASCADE ON UPDATE CASCADE -); -CREATE TABLE "mt_internal_setting" ( - "key" varchar(40) primary key NOT NULL, - "value" varchar(255) NOT NULL -); -INSERT INTO "mt_internal_setting" VALUES('db_version', '5'); -CREATE TABLE "mt_autoscan" ( - "id" integer primary key, - "obj_id" integer default NULL, - "scan_level" varchar(10) NOT NULL, - "scan_mode" varchar(10) NOT NULL, - "recursive" tinyint unsigned NOT NULL, - "hidden" tinyint unsigned NOT NULL, - "interval" integer unsigned default NULL, - "last_modified" integer unsigned default NULL, - "persistent" tinyint unsigned NOT NULL default '0', - "location" text default NULL, - "path_ids" text default NULL, - "touched" tinyint unsigned NOT NULL default '1', - CONSTRAINT "mt_autoscan_id" FOREIGN KEY ("obj_id") REFERENCES "mt_cds_object" ("id") ON DELETE CASCADE ON UPDATE CASCADE -); -CREATE TABLE "mt_metadata" ( - "id" integer primary key, - "item_id" integer NOT NULL, - "property_name" varchar(255) NOT NULL, - "property_value" text NOT NULL, - CONSTRAINT "mt_metadata_idfk1" FOREIGN KEY ("item_id") REFERENCES "mt_cds_object" ("id") ON DELETE CASCADE ON UPDATE CASCADE -); -CREATE INDEX mt_cds_object_ref_id ON mt_cds_object(ref_id); -CREATE INDEX mt_cds_object_parent_id ON mt_cds_object(parent_id,object_type,dc_title); -CREATE INDEX mt_object_type ON mt_cds_object(object_type); -CREATE INDEX mt_location_parent ON mt_cds_object(location_hash,parent_id); -CREATE INDEX mt_track_number ON mt_cds_object(track_number); -CREATE INDEX mt_internal_setting_key ON mt_internal_setting(key); -CREATE UNIQUE INDEX mt_autoscan_obj_id ON mt_autoscan(obj_id); -CREATE INDEX mt_cds_object_service_id ON mt_cds_object(service_id); -CREATE INDEX mt_metadata_item_id ON mt_metadata(item_id); -COMMIT; diff -Nru gerbera-1.6.0/config/sqlite3.sql.tmpl.f gerbera-1.8.2/config/sqlite3.sql.tmpl.f --- gerbera-1.6.0/config/sqlite3.sql.tmpl.f 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/config/sqlite3.sql.tmpl.f 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#endif // __SQLITE3_CREATE_SQL_H__ - -#endif // HAVE_SQLITE3 diff -Nru gerbera-1.6.0/config/sqlite3.sql.tmpl.h gerbera-1.8.2/config/sqlite3.sql.tmpl.h --- gerbera-1.6.0/config/sqlite3.sql.tmpl.h 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/config/sqlite3.sql.tmpl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -/*MT* - - MediaTomb - http://www.mediatomb.cc/ - - sqlite3_create_sql.h - this file is part of MediaTomb. - - Copyright (C) 2005 Gena Batyan , - Sergey 'Jin' Bostandzhyan - - Copyright (C) 2006-2010 Gena Batyan , - Sergey 'Jin' Bostandzhyan , - Leonhard Wimmer - - MediaTomb is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 - as published by the Free Software Foundation. - - MediaTomb is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - version 2 along with MediaTomb; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - - $Id$ -*/ - -/// \file sqlite3_create_sql.h - -#ifdef HAVE_SQLITE3 - -#ifndef __SQLITE3_CREATE_SQL_H__ -#define __SQLITE3_CREATE_SQL_H__ diff -Nru gerbera-1.6.0/config/zpipe.c gerbera-1.8.2/config/zpipe.c --- gerbera-1.6.0/config/zpipe.c 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/config/zpipe.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,205 +0,0 @@ -/* zpipe.c: example of proper use of zlib's inflate() and deflate() - Not copyrighted -- provided to the public domain - Version 1.4 11 December 2005 Mark Adler */ - -/* Version history: - 1.0 30 Oct 2004 First version - 1.1 8 Nov 2004 Add void casting for unused return values - Use switch statement for inflate() return values - 1.2 9 Nov 2004 Add assertions to document zlib guarantees - 1.3 6 Apr 2005 Remove incorrect assertion in inf() - 1.4 11 Dec 2005 Add hack to avoid MSDOS end-of-line conversions - Avoid some compiler warnings for input and output buffers - */ - -#include -#include -#include -#include "zlib.h" - -#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) -# include -# include -# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) -#else -# define SET_BINARY_MODE(file) -#endif - -#define CHUNK 16384 - -/* Compress from file source to file dest until EOF on source. - def() returns Z_OK on success, Z_MEM_ERROR if memory could not be - allocated for processing, Z_STREAM_ERROR if an invalid compression - level is supplied, Z_VERSION_ERROR if the version of zlib.h and the - version of the library linked do not match, or Z_ERRNO if there is - an error reading or writing the files. */ -int def(FILE *source, FILE *dest, int level) -{ - int ret, flush; - unsigned have; - z_stream strm; - unsigned char in[CHUNK]; - unsigned char out[CHUNK]; - - /* allocate deflate state */ - strm.zalloc = Z_NULL; - strm.zfree = Z_NULL; - strm.opaque = Z_NULL; - ret = deflateInit(&strm, level); - if (ret != Z_OK) - return ret; - - /* compress until end of file */ - do { - strm.avail_in = fread(in, 1, CHUNK, source); - if (ferror(source)) { - (void)deflateEnd(&strm); - return Z_ERRNO; - } - flush = feof(source) ? Z_FINISH : Z_NO_FLUSH; - strm.next_in = in; - - /* run deflate() on input until output buffer not full, finish - compression if all of source has been read in */ - do { - strm.avail_out = CHUNK; - strm.next_out = out; - ret = deflate(&strm, flush); /* no bad return value */ - assert(ret != Z_STREAM_ERROR); /* state not clobbered */ - have = CHUNK - strm.avail_out; - if (fwrite(out, 1, have, dest) != have || ferror(dest)) { - (void)deflateEnd(&strm); - return Z_ERRNO; - } - } while (strm.avail_out == 0); - assert(strm.avail_in == 0); /* all input will be used */ - - /* done when last data in file processed */ - } while (flush != Z_FINISH); - assert(ret == Z_STREAM_END); /* stream will be complete */ - - /* clean up and return */ - (void)deflateEnd(&strm); - return Z_OK; -} - -/* Decompress from file source to file dest until stream ends or EOF. - inf() returns Z_OK on success, Z_MEM_ERROR if memory could not be - allocated for processing, Z_DATA_ERROR if the deflate data is - invalid or incomplete, Z_VERSION_ERROR if the version of zlib.h and - the version of the library linked do not match, or Z_ERRNO if there - is an error reading or writing the files. */ -int inf(FILE *source, FILE *dest) -{ - int ret; - unsigned have; - z_stream strm; - unsigned char in[CHUNK]; - unsigned char out[CHUNK]; - - /* allocate inflate state */ - strm.zalloc = Z_NULL; - strm.zfree = Z_NULL; - strm.opaque = Z_NULL; - strm.avail_in = 0; - strm.next_in = Z_NULL; - ret = inflateInit(&strm); - if (ret != Z_OK) - return ret; - - /* decompress until deflate stream ends or end of file */ - do { - strm.avail_in = fread(in, 1, CHUNK, source); - if (ferror(source)) { - (void)inflateEnd(&strm); - return Z_ERRNO; - } - if (strm.avail_in == 0) - break; - strm.next_in = in; - - /* run inflate() on input until output buffer not full */ - do { - strm.avail_out = CHUNK; - strm.next_out = out; - ret = inflate(&strm, Z_NO_FLUSH); - assert(ret != Z_STREAM_ERROR); /* state not clobbered */ - switch (ret) { - case Z_NEED_DICT: - ret = Z_DATA_ERROR; /* and fall through */ - case Z_DATA_ERROR: - case Z_MEM_ERROR: - (void)inflateEnd(&strm); - return ret; - } - have = CHUNK - strm.avail_out; - if (fwrite(out, 1, have, dest) != have || ferror(dest)) { - (void)inflateEnd(&strm); - return Z_ERRNO; - } - } while (strm.avail_out == 0); - - /* done when inflate() says it's done */ - } while (ret != Z_STREAM_END); - - /* clean up and return */ - (void)inflateEnd(&strm); - return ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR; -} - -/* report a zlib or i/o error */ -void zerr(int ret) -{ - fputs("zpipe: ", stderr); - switch (ret) { - case Z_ERRNO: - if (ferror(stdin)) - fputs("error reading stdin\n", stderr); - if (ferror(stdout)) - fputs("error writing stdout\n", stderr); - break; - case Z_STREAM_ERROR: - fputs("invalid compression level\n", stderr); - break; - case Z_DATA_ERROR: - fputs("invalid or incomplete deflate data\n", stderr); - break; - case Z_MEM_ERROR: - fputs("out of memory\n", stderr); - break; - case Z_VERSION_ERROR: - fputs("zlib version mismatch!\n", stderr); - } -} - -/* compress or decompress from stdin to stdout */ -int main(int argc, char **argv) -{ - int ret; - - /* avoid end-of-line conversions */ - SET_BINARY_MODE(stdin); - SET_BINARY_MODE(stdout); - - /* do compression if no arguments */ - if (argc == 1) { - ret = def(stdin, stdout, Z_DEFAULT_COMPRESSION); - if (ret != Z_OK) - zerr(ret); - return ret; - } - - /* do decompression if -d specified */ - else if (argc == 2 && strcmp(argv[1], "-d") == 0) { - ret = inf(stdin, stdout); - if (ret != Z_OK) - zerr(ret); - return ret; - } - - /* otherwise, report usage */ - else { - fputs("zpipe usage: zpipe [-d] < source > dest\n", stderr); - return 1; - } -} diff -Nru gerbera-1.6.0/CONTRIBUTING.md gerbera-1.8.2/CONTRIBUTING.md --- gerbera-1.6.0/CONTRIBUTING.md 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/CONTRIBUTING.md 2021-05-31 22:04:08.000000000 +0000 @@ -2,9 +2,9 @@ We welcome pull requests from everyone! -MediaTomb is an old project that we are working on modernising - there are a lot of cobwebs 🕸 . +Gerbera was originally based on MediaTomb which is an old project that we are working on modernising - there are a lot of cobwebs 🕸 . -For new code please use modern C++ (up to 17) constructs where possible, and avoid the `zmm` namespace. +For new code please use "modern" C++ (up to 17) constructs where possible. 1. Fork this repo. @@ -21,6 +21,8 @@ Some things that will increase the chance that your pull request is accepted: * Stick to [Webkit style](https://webkit.org/code-style-guidelines/). +* Format your code with `clang-format`. +* Ensure your code works as expected by running it. * Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). It is also a good idea to run cmake with`-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_CXX_FLAGS="-Werror"` diff -Nru gerbera-1.6.0/debian/changelog gerbera-1.8.2/debian/changelog --- gerbera-1.6.0/debian/changelog 2020-08-22 01:37:34.000000000 +0000 +++ gerbera-1.8.2/debian/changelog 2021-06-09 15:49:01.000000000 +0000 @@ -1,3 +1,9 @@ +gerbera (1.8.2-1~ppa1) focal; urgency=medium + + * Upstream version 1.8.2 + + -- Stephen Czetty Wed, 09 Jun 2021 10:49:01 -0500 + gerbera (1.6.0-1~ppa1) focal; urgency=medium * Upstream version 1.6.0 diff -Nru gerbera-1.6.0/debian/patches/series gerbera-1.8.2/debian/patches/series --- gerbera-1.6.0/debian/patches/series 2020-08-22 01:37:34.000000000 +0000 +++ gerbera-1.8.2/debian/patches/series 2021-06-09 15:49:01.000000000 +0000 @@ -1,3 +0,0 @@ -0008_symlinks.patch -0013_more-spelling.patch -0014_autoconfigure.patch diff -Nru gerbera-1.6.0/doc/compile.rst gerbera-1.8.2/doc/compile.rst --- gerbera-1.6.0/doc/compile.rst 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/doc/compile.rst 2021-05-31 22:04:08.000000000 +0000 @@ -15,45 +15,52 @@ In order to compile Gerbera you will have to install the following packages: -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| Library | Version | Required? | Note | Compile-time option | Default | -+===================+===========+===============+============================+========================+==========+ -| libupnp | >=1.8.6 | Required | `pupnp `_ | | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| libuuid | | Depends on OS | On BSD native libuuid is | | | -| | | | used others require | | | -| | | | e2fsprogs-libuuid | | | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| pugixml | | Required | | | | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| fmtlib | | Required | | | | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| libiconv | | Required | | | | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| sqlite3 | | Required | Database storage | | | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| duktape | | Optional | Scripting Support | WITH_JS | Enabled | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| mysql | | Optional | Alternate database storage | WITH_MYSQL | Disabled | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| curl | | Optional | Enables web services | WITH_CURL | Enabled | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| taglib | 1.11.1 | Optional | Audio tag support | WITH_TAGLIB | Enabled | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| libmagic | | Optional | File type detection | WITH_MAGIC | Enabled | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| ffmpeg/libav | | Optional | File metadata | WITH_AVCODEC | Disabled | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| libexif | | Optional | JPEG Exif metadata | WITH_EXIF | Enabled | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| libexiv2 | | Optional | Exif, IPTC, XMP metadata | WITH_EXIV2 | Disabled | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| lastfmlib | 0.4.0 | Optional | Enables scrobbling | WITH_LASTFM | Disabled | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| ffmpegthumbnailer | | Optional | Generate video thumbnails | WITH_FFMPEGTHUMBNAILER | Disabled | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ -| inotify | | Optional | Efficient file monitoring | WITH_INOTIFY | Enabled | -+-------------------+-----------+---------------+----------------------------+------------------------+----------+ ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| Library | Min Version | Required? | Note | Compile-time option | Default | ++=====================+===============+=================+==============================+===========================+============+ +| libupnp | 1.14.0 | XOR libnpupnp | [pupnp] | | | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| libnpupnp | 4.1.2 | XOR libupnp | [npupnp] | WITH\_NPUPNP | Disabled | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| libuuid | | Depends on OS | Not required on \*BSD | | | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| pugixml | | Required | [pugixml] | | | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| libiconv | | Required | | | | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| sqlite3 | 3.7.0 | Required | Database storage | | | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| zlib | | Required | | | | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| fmtlib | 5.3 | Required | | | | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| spdlog | | Required | | | | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| duktape | 2.1.0 | Optional | Scripting Support | WITH\_JS | Enabled | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| mysql | | Optional | Alternate database storage | WITH\_MYSQL | Disabled | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| curl | | Optional | Enables web services | WITH\_CURL | Enabled | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| [taglib] | 1.11.1 | Optional | Audio tag support | WITH\_TAGLIB | Enabled | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| libmagic | | Optional | File type detection | WITH\_MAGIC | Enabled | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| libmatroska | | Optional | MKV metadata | WITH\_MATROSKA | Enabled | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| ffmpeg/libav | | Optional | File metadata | WITH\_AVCODEC | Disabled | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| libexif | | Optional | JPEG Exif metadata | WITH\_EXIF | Enabled | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| libexiv2 | | Optional | Exif, IPTC, XMP metadata | WITH\_EXIV2 | Disabled | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| lastfmlib | 0.4.0 | Optional | Enables scrobbling | WITH\_LASTFM | Disabled | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| ffmpegthumbnailer | | Optional | Generate video thumbnails | WITH\_FFMPEGTHUMBNAILER | Disabled | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ +| inotify | | Optional | Efficient file monitoring | WITH\_INOTIFY | Enabled | ++---------------------+---------------+-----------------+------------------------------+---------------------------+------------+ + .. index:: Quick Start Build @@ -118,7 +125,7 @@ To build gerbera on Ubuntu 18.04 you have to install a newer version of the gcc++ compiler and clang++: -:: +:: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt update @@ -151,7 +158,7 @@ Install all libraries gerbera needs. Because they are to old libupnp, libfmt must be build and installed from the source: - + :: sudo apt install -y uuid-dev libsqlite3-dev libmysqlclient-dev libmagic-dev \ @@ -164,7 +171,7 @@ Build and install libupnp with the ``--enable-ipv6`` and ``--enable-reuseaddr`` option and libfmt from sourcec :: - + wget "https://downloads.sourceforge.net/project/pupnp/pupnp/libupnp-1.12.1/libupnp-1.12.1.tar.bz2?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fpupnp%2Ffiles%2Flatest%2Fdownload&ts=1588248015" -O libupnp-1.12.1.tar.bz2 tar -xf libupnp-1.12.1.tar.bz2 cd libupnp-1.12.1 @@ -181,7 +188,7 @@ It is strongly recommended to to rebuild spdlog without bundled fmt: - + :: git clone https://github.com/gabime/spdlog @@ -191,7 +198,7 @@ sudo make install -Now it's time to get the source of gerbera and compile it. +Now it's time to get the source of gerbera and compile it. :: @@ -199,10 +206,76 @@ mkdir build cd build cmake -DWITH_MAGIC=1 -DWITH_MYSQL=1 -DWITH_CURL=1 -DWITH_JS=1 -DWITH_TAGLIB=1 -DWITH_AVCODEC=1 -DWITH_EXIF=1 -DWITH_LASTFM=0 -DWITH_SYSTEMD=1 ../gerbera - make + make sudo make install +.. index:: Debian Buster + +Build On Debian Buster +~~~~~~~~~~~~~~~~~~~~~~ + +This guide is based on buildinh Gerbera on Pogo Kirkwood Armel architecture boxes running Debian buster. + +1. Create a swapfile when using 128Mb devices (and probably 256MB too). Add a HD or SSD but not a USB stick because of the risk of hardware failure. + +2. If you for libnpupnp and libupnpp6 from https://www.lesbonscomptes.com/upmpdcli/ - Follow the build instructions to create Debian packages which you can then install with dpkg. + +3. Build the latest Taglib [`cmake; make -j2`] and use `make install` to install + +4. Use Apt-get to install the rest of the dev packages as per dependencies list. It is best to load fmtlib-dev and libspdlog.dev from the Buster Backports + +5. Clone the Gerbera git and edit the CMakeLists.txt file and comment the original version and add the new. + +`# set(GERBERA_VERSION "git")` +`set(GERBERA_VERSION "1.6.4-185-gae283931+d")` + +and add these lines to make the debian package + +`SET(CPACK_GENERATOR "DEB")` +`SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "KK")` +`# include (cmake)` +`include(packaging)` + +6. This is the Cmake command: + +`cmake -g DEB ../gerbera -DWITH_NPUPNP=YES -DWITH_JS=1 -DWITH_MYSQL=1 -DWITH_CURL=1 -DWITH_TAGLIB=1 -DWITH_MAGIC=1 -DWITH_MATROSKA=0 -DWITH_AVCODEC=1 -DWITH_EXIF=1 -DWITH_EXIV2=0 -DWITH_LASTFM=0 -DWITH_FFMPEGTHUMBNAILER=1 -DWITH_INOTIFY=1` + +Resolve any dependency issues now! + +7. the `make -j2` will take at least some hours - go for a walk, read a book, grab some sleep ..... + +8. `cpack -G DEB` will create a debian package file - All being well - no errors. Use dpkg to install. + +9. follow the gerbera manual for installation. Create the gerbera user (give the user a home directory e.g. /home/gerbera). Make the /etc/gerbera folder and get the config.xml. Symbolic link the config file: + +`ln -s /etc/gerbera/config.xml /home/gerbera/.config/gerbera` + +Symbolic link the web directory: + +`ln -s /usr/share/gerbera /usr/local/share` + +10. Edit `config.xml` and change the path to + +`/home/gerbera/.config/gerbera` + +11. Start gerbera with the standard launch command. The server should start - watch the messages for errors. Check the web interface functions too. when happy that all is good - control-c to get back to shell + +`gerbera -c /etc/gerbera/config.xml` + +12. For SystemD users, copy the gerbera.service script into /usr/systemd/system and edit it to correct the path to the gerbera server the use the systemctl command as per the manual to start and stop the server and debug any problems. + +`ExecStart=/usr/bin/gerbera -c /etc/gerbera/config.xml` + +13. For init.d users, you need a gerbera script which I took from the earlier version which is in the Debian APT library + +14. You need to put your new gerbera package on hold to prevent apt-get upgrade downgrading back to 1.1 + +`apt-mark hold gerbera` + +That should be everything you need. Gerbera version 1.6.4-185 build with this guide was running on a PogoPlug V2E02 and a V4 Pro quite happily using vlc and bubbleupnp as clients on to a fire stick and chromecast devices. + + .. index:: FreeBSD Build On FreeBSD @@ -242,4 +315,48 @@ The Gerbera Team maintains a Homebrew Tap to build and install Gerbera Media Server. Take a look at the Homebrew formula to see an example of how to compile Gerbera on macOS. -`homebrew-gerbera/gerbera.rb `_ \ No newline at end of file +`homebrew-gerbera/gerbera.rb `_ + + + +.. index:: Build Docker Container On Ubuntu + +Build Docker Container On Ubuntu +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Install required tools in Ubuntu + +:: + + sudo apt-get install docker.io git + +Simplest way of building: + +:: + + sudo docker build https://github.com/gerbera/gerbera.git + +After successfull build you should get something like + +:: + + Successfully built a13ccc793373 + +Afterwards start the container like described in the `Gerbera Docker `_ +documentation while replacing "gerbera/gerbera:vX.X.X" with the unique ID reported at the end of the build. + +To change the compile options of Gerbera split up the process. +Download the project: + +:: + + git clone https://github.com/gerbera/gerbera.git + +Then modify the compile parameter values in gerbera/Dockerfile. Also additional libraries might be required. +E.g. to build a container with exiv2 support add the compile option "-DWITH_EXIV2=YES" and the library +"exiv2-dev" in the first "RUN apk" command and "exiv2" in the second "RUN apk" command in the gerbera/Dockerfile. +To start the build enter + +:: + + sudo docker build gerbera/ \ No newline at end of file diff -Nru gerbera-1.6.0/doc/config-extended.rst gerbera-1.8.2/doc/config-extended.rst --- gerbera-1.6.0/doc/config-extended.rst 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/doc/config-extended.rst 2021-05-31 22:04:08.000000000 +0000 @@ -45,7 +45,7 @@ * Optional * Default: **/cache-dir** - Storage location for the thumbnail cache when FFMPEGThumbnailer is enabled. Defaults to Gerbera Home. + Database location for the thumbnail cache when FFMPEGThumbnailer is enabled. Defaults to Gerbera Home. Creates a thumbnail with file format as: ``-thumb.jpg`` The attributes of the tag have the following meaning: diff -Nru gerbera-1.6.0/doc/config-import.rst gerbera-1.8.2/doc/config-import.rst --- gerbera-1.6.0/doc/config-import.rst 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/doc/config-import.rst 2021-05-31 22:04:08.000000000 +0000 @@ -11,7 +11,7 @@ :: - + * Optional @@ -30,6 +30,26 @@ This attribute defines if files starting with a dot will be imported into the database (”yes”). Autoscan can override this attribute on a per directory basis. + :: + + follow-symlinks="yes|no" + + * Optional + + * Default: **yes** + + This attribute defines if symbolic links should be treated as regular items and imported into the database (”yes”). This can cause duplicate entries if the link target is also scanned. + + :: + + readable-names="yes|no" + + * Optional + + * Default: **yes** + + This attribute defines that filenames are made readable on import, i.e. underscores are replaced by space and extensions are removed. This changes the title of the entry if no metadata is available + **Child tags:** ``filesystem-charset`` @@ -58,8 +78,8 @@ Same as above, but defines the charset of the metadata (i.e. id3 tags, Exif information, etc.) -``scripting script-charset`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``scripting`` +~~~~~~~~~~~~~ :: @@ -82,7 +102,7 @@ :: - + * Optional @@ -101,6 +121,22 @@ - **builtin**: a default layout will be created by the server - **js**: a user customizable javascript will be used (Gerbera must be compiled with js support) - **disabled**: only PC-Directory structure will be created, i.e. no virtual layout + :: + + audio-layout="Default|Structured" + video-layout="Default" + image-layout="Default" + trailer-layout="Default" + + * Optional + * Default: **Default** + + Specifies the virtual layout to be created: + + - **Default**: `addAudio` is used to create the virtual layout + - **Structured**: `addAudioStructured` is used to create the virtual layout + + `video-layout`, `image-layout` and `trailer-layout` are reserved for future use. The virtual layout can be adjusted using an import script which is defined as follows: @@ -113,6 +149,127 @@ Points to the script invoked upon media import. For more details read about :ref:`scripting ` + :: + + + + * Optional + + Contains options to pass into scripts. All values are available in scripts as e.g. + `config['/import/scripting/virtual-layout/script-options/script-option'].test`. + For more details see :ref:`scripting ` + + + **Child tags:** + + :: + + + + * Optional + + Set option `value` for option `name` + + :: + + name="..." + + * Required + + Name of the option. + + :: + + to="..." + + * Required + + Value of the option. + + :: + + + + * Optional + + Define mapping of genres to other text. + + + **Child tags:** + + :: + + + + * Optional + + Replace genre `from` by genre `to`. + + :: + + from="..." + + * Required + + Original genre value. Can be a regular expression. + + :: + + to="..." + + * Required + + Target genre value. + + :: + + + + * Optional + + Adjust layout of boxes for large collections in structured layout. Set audio-layout to **Structured** and choose values best for your media library. + + :: + + div-char="-" + + * Optional + * Default: **-** + + Symbols to use around the box text. + + :: + + skip-chars="-" + + * Optional + + Special characters in the beginning of a title that are not used for building a box. + + :: + + album-box="6" + artist-box="9" + genre-box="6" + track-box="6" + + * Optional + * Default: see above values + + Type of the box. The following values are supported + + - **1**: One large box + - **2**: Two boxes with 13 items each + - **3**: Boxes with 8, 9, 9 letters + - **4**: Boxes with 7, 6, 7, 6 letters + - **5**: Boxes with 5, 5, 5, 6, 5 letters + - **6**: Boxes with 4, 5, 4, 4, 5, 4 letters + - **7**: Boxes with 4, 3, 4, 4, 4, 3, 4 letters + - **9**: Boxes with 5, 5, 5, 4, 1, 6 letters; a large box for T + - **13**: Boxes with 2 letters each + - **26**: A speparate box for each letter + + ``common-script`` ~~~~~~~~~~~~~~~~~ @@ -123,8 +280,22 @@ * Optional * Default: ``${prefix}/share/gerbera/js/common.js``, **where ${prefix} is your installation prefix directory.** -Points to the so called common script - think of it as a custom library of js helper functions, functions added -there can be used in your import and in your playlist scripts. For more details read :ref:`scripting ` +Points to the so called common script - it is a shared library of js helper functions. +For more details read :ref:`scripting ` + +``custom-script`` +~~~~~~~~~~~~~~~~~ + +:: + + /path/to/my/custom-script.js + +* Optional +* Default: **empty** + +Points to the custom script - think of it as a custom library of js helper functions, functions added +there can be used in your import and in your playlist scripts. Theses functions also overwrite functions from the common script. +For more details read :ref:`scripting ` ``playlist-script`` ~~~~~~~~~~~~~~~~~~~ @@ -246,6 +417,40 @@ Allowed values: ``yes`` or ``no``, process hidden files, overrides the hidden-files value in the ```` tag. +``system-directories`` +~~~~~~~~~~~~~~~~~~~~~~ + +:: + + + +* Optional + +Specifies a list of system directories hidden in filesystem web ui. + +If the element does not exists, the default list of system directories is set to ``/bin, /boot, /dev, /etc, /lib, /lib32, /lib64, /libx32, /proc, /run, /sbin, /sys, /tmp, /usr, /var`` + + **Child tags:** + + :: + + + + * Optional + + Defines a system directory. + + The attributes specify various options: + + :: + + name=... + + * Required + + Absolute path to the directory that shall be hidden. + + ``layout`` ~~~~~~~~~~ @@ -293,6 +498,122 @@ Target path. / can be used to create sub structure. +``resources`` +~~~~~~~~~~~~~ + +:: + + + +* Optional + +Defines various resource options for file based resources. Older versions of Gerbera added sereral files automatically. For performance reasons no pattern is added anymore. You can set up your correct fanart file by yourself, if no image is embedded in your media. If you have subtitle files, add the correct pattern, also. + + :: + + case-sensitive="yes|no" + + * Optional + + * Default: **yes** + + This attribute defines whether search patterns are treated case sensitive or not, i.e. if set to **no** ``cover.png`` matches anything like ``Cover.PNG`` or ``cover.PNG``. + +**Child tags:** + + :: + + ... + ... + ... + ... + + * Optional + + Define file patterns to search for fanart, subtitle and resources respectivly. + + ``container``, ``fanart`` and ``subtitle`` patterns are used to identify external resources which are added to each item if the pattern matches. + + ``resource`` patterns are used to trigger rescan of the whole directory if such a file was changed, added or removed. + + Each of these tags can contain multiple ``add-file`` entries. ``container`` has additional attributes. + +**Child tags:** + +``container`` +------------- + + :: + + + + * Optional + + Set up container images. Drop your artists' images or logos for default containers here and they are displayed as thumbnail when browsing with a compatible client. + + :: + + location="..." + + * Optional + + Path to the directory containing the images to load. Relative paths are assumed to be under the server's home. + If the image is not found in that location, it is also searched in the physical folder itself + + :: + + parentCount="..." + + * Optional + + Number of level which the fanart of a media file can be propagated upwards. + + :: + + minDepth="..." + + * Optional + + Minimum number of path elements for container using fanart from media files. + + +``add-file`` +------------ + + :: + + + + + * Optional + + Add search pattern to resource handler. The search pattern can contain variables: + + - ``%album%``: Value of the album tag + - ``%albumArtist%``: Value of the albumArtist tag + - ``%artist%``: Value of the artist tag + - ``%filename%``: Name of the file without extension or name of the container + - ``%genre%``: Value of the genre tag + - ``%title%``: Value of the title tag + +A sample configuration would be: + +.. code-block:: xml + + + + + + + + + + + + + + + ``mappings`` ~~~~~~~~~~~~ @@ -477,7 +798,7 @@ (like title, artist, year, etc.), however some media provides more metadata and exceeds the scope of UPnP. This additional metadata can be used to fine tune the server layout, it allows the user to create a more complex container structure using a customized import script. The metadata that can be extracted depends on the -library, currently we support **taglib** (or id3lib if absent), **ffmpeg and libexif** which provide a default set of keys +library, currently we support **taglib** (or id3lib if absent), **ffmpeg and libexif** and **libexiv2** (if compiled with WITH_EXIV2 enabled) which provide a default set of keys that can be passed in the options below. The data according to those keys will the be extracted from the media and imported into the database along with the item. When processing the item, the import script will have full access to the gathered metadata, thus allowing the user to organize the data with the use of the extracted information. A practical example would be: @@ -695,3 +1016,62 @@ +``exiv2`` +---------- + +.. code-block:: xml + + + +* Optional + +These options apply to exiv2 libraries. + +**Child tags:** + +``auxdata`` +----------- + +.. code-block:: xml + + + +* Optional + +Currently only adding keywords to auxdata is supported. `This page `_ +documents all of the metadata keys that exiv2 honors, depending on the format being encoded. + + **Child tags:** + +``add-data`` +------------ + +.. code-block:: xml + + + + + + + + ... + +* Optional + +If the library was able to extract the data according to the given keyword, it will be added to auxdata. +You can then use that data in your import scripts. + +A sample configuration for the example described above would be: + +.. code-block:: xml + + + + + + + + + + + \ No newline at end of file diff -Nru gerbera-1.6.0/doc/config-server.rst gerbera-1.8.2/doc/config-server.rst --- gerbera-1.6.0/doc/config-server.rst 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/doc/config-server.rst 2021-05-31 22:04:08.000000000 +0000 @@ -16,6 +16,18 @@ This section defines the server configuration parameters. +**Attributes:** + + :: + + system-threads="yes|no" + + * Optional + + * Default: **yes** + + This attribute defines if mutli-threading in server will use all system resources. If set to **no** it only uses resources assigned to the server process. + ``port`` ~~~~~~~~ @@ -78,6 +90,19 @@ This tag sets the manufacturer URL of a UPnP device, a custom setting may be necessary to trick some renderers in order to enable special features that otherwise are only active with the vendor implemented server. +``virtualURL`` +~~~~~~~~~~~~~~ + +.. code-block:: xml + + http://gerbera.io/ + +* Optional +* Default: unset + +This tag sets the virtual URL of Gerbera web UI, a custom setting may be necessary if you want to access the web page via a reverse proxy. +The value defaults to `http://:port`. + ``modelName`` ~~~~~~~~~~~~~ @@ -445,103 +470,119 @@ .. code-block:: xml - + * Required -Defines the storage section - database selection is done here. Currently sqlite3 and mysql are supported. +Defines the storage section - database selection is done here. Currently SQLite3 and MySQL are supported. Each storage driver has it's own configuration parameters. - **Child Tags** +Exactly one driver must be enabled: ``sqlite3`` or ``mysql``. The available options depend on the selected driver. + + + **Attributes** :: - caching="yes" + use-transactions="yes" * Optional - * Default: **yes** + * Default: **no** - Enables caching, this feature should improve the overall import speed. + Enables transactions. This feature should improve the overall import speed and avoid race-conditions on import. + The feature caused some issues and set to **no**. If you want to support testing, turn it to **yes** and report + if you can reproduce the issue. - .. code-block:: xml + **SQLite** - - Allowed values are ``sqlite3`` or ``mysql``, the available options depend on the selected driver. + Defines the SQLite storage driver section. - :: + :: - enabled="yes" + enabled="yes" - * Optional - * Default: **yes** + * Optional + * Default: **yes** - Below are the sqlite driver options: + Below are the sqlite driver options: - .. code-block:: xml + .. code-block:: xml - gerbera.db + /etc/gerbera/sqlite3.sql - * Optional - * Default: **gerbera.db** + * Optional + * Default: **Datadir / sqlite3.sql** - The database location is relative to the server's home, if the sqlite database does not exist it will be - created automatically. + The full path to the init script for the database - .. code-block:: xml + .. code-block:: xml - off + gerbera.db - * Optional - * Default: **off** + * Optional + * Default: **gerbera.db** - Possible values are ``off``, ``normal`` and ``full``. + The database location is relative to the server's home, if the sqlite database does not exist it will be + created automatically. - This option sets the SQLite pragma **synchronous**. This setting will affect the performance of the database - write operations. For more information about this option see the SQLite documentation: http://www.sqlite.org/pragma.html#pragma_synchronous + .. code-block:: xml - .. code-block:: xml + off - restore + * Optional + * Default: **off** - * Optional - * Default: **restore** + Possible values are ``off``, ``normal`` and ``full``. - Possible values are ``restore`` and ``fail``. + This option sets the SQLite pragma **synchronous**. This setting will affect the performance of the database + write operations. For more information about this option see the SQLite documentation: http://www.sqlite.org/pragma.html#pragma_synchronous - This option tells Gerbera what to do if an SQLite error occurs (no database or a corrupt database). - If it is set to **restore** it will try to restore the database from a backup file (if one exists) or try to - recreate a new database from scratch. + .. code-block:: xml - If the option is set to **fail**, Gerbera will abort on an SQLite error. + restore - .. code-block:: xml + * Optional + * Default: **restore** - + Possible values are ``restore`` and ``fail``. - * Optional + This option tells Gerbera what to do if an SQLite error occurs (no database or a corrupt database). + If it is set to **restore** it will try to restore the database from a backup file (if one exists) or try to + recreate a new database from scratch. - Backup parameters: + If the option is set to **fail**, Gerbera will abort on an SQLite error. - :: + .. code-block:: xml - enabled=... + * Optional - * Default: **no** - Enables or disables database backup. + Backup parameters: - :: + :: - interval=... + enabled=... - * Optional - * Default: **600** + * Optional + * Default: **no** - Defines the backup interval in seconds. + Enables or disables database backup. + + :: + + interval=... + + * Optional + * Default: **600** + + Defines the backup interval in seconds. + + **MySQL** .. code-block:: xml @@ -554,56 +595,216 @@ enabled=... * Optional - * Default: **yes** + * Default: **no** Enables or disables the MySQL driver. - Below are the child tags for MySQL: + Below are the child tags for MySQL: - .. code-block:: xml + .. code-block:: xml - localhost + localhost - * Optional - * Default: **"localhost"** + * Optional + * Default: **"localhost"** - This specifies the host where your MySQL database is running. + This specifies the host where your MySQL database is running. - .. code-block:: xml + .. code-block:: xml - 0 + 0 - * Optional - * Default: **0** + * Optional + * Default: **0** - This specifies the port where your MySQL database is running. + This specifies the port where your MySQL database is running. - .. code-block:: xml + .. code-block:: xml - root + root - * Optional - * Default: **"gerbera"** + * Optional + * Default: **"gerbera"** - This option sets the user name that will be used to connect to the database. + This option sets the user name that will be used to connect to the database. - .. code-block:: xml + .. code-block:: xml + + + + * Optional + * Default: **no password** + + Defines the password for the MySQL user. If the tag doesn't exist Gerbera will use no password, if + the tag exists, but is empty Gerbera will use an empty password. MySQL has a distinction between + no password and an empty password. + + .. code-block:: xml + + gerbera + + * Optional + + * Default: **"gerbera"** + + Name of the database that will be used by Gerbera. + + .. code-block:: xml + + /etc/gerbera/mysql.sql + + * Optional + * Default: **Datadir / mysql.sql** + + The full path to the init script for the database - + +``upnp`` +~~~~~~~~ + +:: + + + +* Optional + +Modify the settings for UPnP items. + +This section defines sets the properties which are send to UPnP clients as part of the response. + + **Child tags:** + + :: + + ... + ... + ... * Optional - * Default: **no password** - Defines the password for the MySQL user. If the tag doesn't exist Gerbera will use no password, if - the tag exists, but is empty Gerbera will use an empty password. MySQL has a distinction between - no password and an empty password. + Defines the properties to send in the response. - .. code-block:: xml + It contains the following entries. - gerbera + :: + + * Optional - * Default: **"gerbera"** + Defines an UPnP property. + + The attributes specify the property: + + :: + + upnp-tag="..." + + * Required + + UPnP tag to be send. See the UPnP specification for valid entries. + + :: + + meta-data="..." + + * Required - Name of the database that will be used by Gerbera. + Name of the metadata tag to export in upnp response. The following values are supported: + M_TITLE, M_ARTIST, M_ALBUM, M_DATE, M_UPNP_DATE, M_GENRE, M_DESCRIPTION, M_LONGDESCRIPTION, + M_PARTNUMBER, M_TRACKNUMBER, M_ALBUMARTURI, M_REGION, M_AUTHOR, M_DIRECTOR, M_PUBLISHER, + M_RATING, M_ACTOR, M_PRODUCER, M_ALBUMARTIST, M_COMPOSER, M_CONDUCTOR, M_ORCHESTRA. + + **Defaults:** + + * Album-Properties + + +----------------------+-------------------+ + | upnp-tag | meta-data | + +======================+===================+ + | ``dc:creator`` | ``M_ALBUMARTIST`` | + +----------------------+-------------------+ + | ``dc:date`` | ``M_UPNP_DATE`` | + +----------------------+-------------------+ + | ``dc:publisher`` | ``M_PUBLISHER`` | + +----------------------+-------------------+ + | ``upnp:artist`` | ``M_ALBUMARTIST`` | + +----------------------+-------------------+ + | ``upnp:albumArtist`` | ``M_ALBUMARTIST`` | + +----------------------+-------------------+ + | ``upnp:composer`` | ``M_COMPOSER`` | + +----------------------+-------------------+ + | ``upnp:conductor`` | ``M_CONDUCTOR`` | + +----------------------+-------------------+ + | ``upnp:date`` | ``M_UPNP_DATE`` | + +----------------------+-------------------+ + | ``upnp:genre`` | ``M_GENRE`` | + +----------------------+-------------------+ + | ``upnp:orchestra`` | ``M_ORCHESTRA`` | + +----------------------+-------------------+ + | ``upnp:producer`` | ``M_PRODUCER`` | + +----------------------+-------------------+ + + * Artist-Properties + + +----------------------+-------------------+ + | upnp-tag | meta-data | + +======================+===================+ + | ``upnp:artist`` | ``M_ALBUMARTIST`` | + +----------------------+-------------------+ + | ``upnp:albumArtist`` | ``M_ALBUMARTIST`` | + +----------------------+-------------------+ + | ``upnp:genre`` | ``M_GENRE`` | + +----------------------+-------------------+ + + * Title-Properties + + The title properties cannot be changed, but you may add them under another tag. + + +-----------------------------------+-----------------------+ + | upnp-tag | meta-data | + +===================================+=======================+ + | ``dc:date`` | ``M_DATE`` | + +-----------------------------------+-----------------------+ + | ``dc:description`` | ``M_DESCRIPTION`` | + +-----------------------------------+-----------------------+ + | ``dc:publisher`` | ``M_PUBLISHER`` | + +-----------------------------------+-----------------------+ + | ``dc:title`` | ``M_TITLE`` | + +-----------------------------------+-----------------------+ + | ``upnp:actor`` | ``M_ACTOR`` | + +-----------------------------------+-----------------------+ + | ``upnp:album`` | ``M_ALBUM`` | + +-----------------------------------+-----------------------+ + | ``upnp:albumArtURI`` | ``M_ALBUMARTURI`` | + +-----------------------------------+-----------------------+ + | ``upnp:artist`` | ``M_ARTIST`` | + +-----------------------------------+-----------------------+ + | ``upnp:artist@role[AlbumArtist]`` | ``M_ALBUMARTIST`` | + +-----------------------------------+-----------------------+ + | ``upnp:author`` | ``M_AUTHOR`` | + +-----------------------------------+-----------------------+ + | ``upnp:composer`` | ``M_COMPOSER`` | + +-----------------------------------+-----------------------+ + | ``upnp:conductor`` | ``M_CONDUCTOR`` | + +-----------------------------------+-----------------------+ + | ``upnp:date`` | ``M_UPNP_DATE`` | + +-----------------------------------+-----------------------+ + | ``upnp:director`` | ``M_DIRECTOR`` | + +-----------------------------------+-----------------------+ + | ``upnp:episodeSeason`` | ``M_PARTNUMBER`` | + +-----------------------------------+-----------------------+ + | ``upnp:genre`` | ``M_GENRE`` | + +-----------------------------------+-----------------------+ + | ``upnp:longDescription`` | ``M_LONGDESCRIPTION`` | + +-----------------------------------+-----------------------+ + | ``upnp:orchestra`` | ``M_ORCHESTRA`` | + +-----------------------------------+-----------------------+ + | ``upnp:originalTrackNumber`` | ``M_TRACKNUMBER`` | + +-----------------------------------+-----------------------+ + | ``upnp:producer`` | ``M_PRODUCER`` | + +-----------------------------------+-----------------------+ + | ``upnp:rating`` | ``M_RATING`` | + +-----------------------------------+-----------------------+ + | ``upnp:region`` | ``M_REGION`` | + +-----------------------------------+-----------------------+ diff -Nru gerbera-1.6.0/doc/config-transcode.rst gerbera-1.8.2/doc/config-transcode.rst --- gerbera-1.6.0/doc/config-transcode.rst 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/doc/config-transcode.rst 2021-05-31 22:04:08.000000000 +0000 @@ -58,7 +58,7 @@ .. code-block:: xml - + The mime type to profile mappings define which mime type is handled by which profile. @@ -68,6 +68,12 @@ The mappings under mimetype-profile are defined in the following manner: + :: + + allow-unused=... + + Suppress errors when loading profiles. Default **no**: Unused mappings are not allowed in config. + ``transcode`` ------------- @@ -99,10 +105,16 @@ .. code-block:: xml - + This section defines the various transcoding profiles. + :: + + allow-unused=... + + Suppress errors when loading profiles. Default **no**: Unused profiles are not allowed in config. + .. code-block:: xml @@ -332,16 +344,6 @@ .. code-block:: xml - yes - - * Optional - * Default: **yes** - - Specifies that the content should be sent out using chunked HTTP encoding, this is the default setting for - transcoded streams, because the content length of the data is not known. - - .. code-block:: xml - source * Optional diff -Nru gerbera-1.6.0/doc/conf.py gerbera-1.8.2/doc/conf.py --- gerbera-1.6.0/doc/conf.py 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/doc/conf.py 2021-05-31 22:04:08.000000000 +0000 @@ -46,7 +46,7 @@ # General information about the project. project = u'Gerbera' -copyright = u'2018-20, Gerbera Contributors' +copyright = u'2018-21, Gerbera Contributors' author = u'Gerbera Contributors' # The version info for the project you're documenting, acts as replacement for @@ -54,9 +54,9 @@ # built documents. # # The short X.Y version. -version = u'1.6' +version = u'1.8' # The full version, including alpha/beta/rc tags. -release = u'1.6.0' +release = u'1.8.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -Nru gerbera-1.6.0/doc/daemon.rst gerbera-1.8.2/doc/daemon.rst --- gerbera-1.6.0/doc/daemon.rst 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/doc/daemon.rst 2021-05-31 22:04:08.000000000 +0000 @@ -109,6 +109,20 @@ 2017-09-20 19:54:47 INFO: Loading configuration from: /etc/gerbera/config.xml 2017-09-20 19:54:47 INFO: Checking configuration... +.. index:: Commandline options + +Using Commandline options +~~~~~~~~~~~~~~~~~~~~~~~~~ + + +If your system uses an old style system V init, commandline options are available to start gerbera as a Daemon: + +--daemon or -d: daemonize after startup. + +--user or -u: when started by root, try to change to user USER after startup. All UIDs, GIDs and supplementary Groups will be set. + +--pidfile or -P: write a pidfile to the specified location. Full path is needed, e.g. /run/gerbera.pid. + .. index:: Solaris @@ -157,4 +171,4 @@ :: - $ launchctl stop gerbera.io \ No newline at end of file + $ launchctl stop gerbera.io diff -Nru gerbera-1.6.0/doc/index.rst gerbera-1.8.2/doc/index.rst --- gerbera-1.6.0/doc/index.rst 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/doc/index.rst 2021-05-31 22:04:08.000000000 +0000 @@ -8,8 +8,8 @@ It allows you to stream your digital media through your home network and listen to/watch it on a variety of UPnP compatible devices. -Gerbera should work with any UPnP compliant client, please tell us if you experience difficulties with -particular models, also take a look at the :ref:`Supported Devices ` list for more information. +Gerbera should work with any UPnP compliant client. Please tell us if you experience difficulties with +particular models. Please see the the :ref:`Supported Devices ` list for related information. Features ~~~~~~~~ @@ -54,7 +54,7 @@ | Sergey Bostandzhyan | Leonhard Wimmer - Copyright (C) 2016-2019 + Copyright (C) 2016-2021 | Gerbera Contributors License diff -Nru gerbera-1.6.0/doc/install.rst gerbera-1.8.2/doc/install.rst --- gerbera-1.6.0/doc/install.rst 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/doc/install.rst 2021-05-31 22:04:08.000000000 +0000 @@ -21,7 +21,23 @@ .. index:: Ubuntu Linux .. index:: Mint -Stephen Czetty maintains a `Ubuntu PPA `_. +We maintain a `Ubuntu Repository `_. + +To install the latest tagged release (>=1.8.0): + +.. code-block:: sh + + curl -fsSL https://gerbera.jfrog.io/artifactory/api/gpg/key/public | sudo apt-key add - + sudo apt-add-repository https://gerbera.jfrog.io/artifactory/debian + +Or for the latest code install git builds: + +.. code-block:: sh + + curl -fsSL https://gerbera.jfrog.io/artifactory/api/gpg/key/public | sudo apt-key add - + sudo apt-add-repository https://gerbera.jfrog.io/artifactory/debian-git + +Or Stephen Czetty maintains a `Ubuntu PPA `_. .. code-block:: sh @@ -55,6 +71,22 @@ sudo dnf install gerbera +FreeBSD +~~~~~~~~~~~~~~~~~ +.. index:: FreeBSD + +Gerbera is available via packages and ports collection. + +.. code-block:: sh + + pkg install gerbera + +or + +.. code-block:: sh + + cd /usr/ports/net/gerbera/ && make install clean + CentOS ~~~~~~~~~~~~~~~~~ .. index:: CentOS @@ -94,6 +126,13 @@ Gerbera is available in `Entware `_ for your embedded device/router! +OpenWrt (OpenWrt) +~~~~~~~~~~~~~~~~~ +.. index:: OpenWrt + +Gerbera is available in `OpenWrt `_ for your embedded device/router! + + macOS ~~~~~ .. index:: macOS diff -Nru gerbera-1.6.0/doc/run.rst gerbera-1.8.2/doc/run.rst --- gerbera-1.6.0/doc/run.rst 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/doc/run.rst 2021-05-31 22:04:08.000000000 +0000 @@ -170,6 +170,35 @@ minimum allowed value is ``49152``. If this option is omitted a default port will be chosen, however, in this case it is possible that the port will change upon server restart. +Daemon +------ + +:: + + --daemon or -d + +Daemonize after startup. This option is useful if your system does not use Systemd or similar +mechanisms to start services. See also --user and --pidfile options, below. + +User +---- + +:: + + --user or -u + +After startup when started by user root try to change all UIDs and GIDs to those belonging to user USER. +Also supplementary GIDs will be set. + +Pidfile +------- + +:: + + --pidfile or -P + +Write a pidfile to the specified location. Full path is needed, e.g. /run/gerbera.pid. + Configuration File ------------------ diff -Nru gerbera-1.6.0/doc/scripting.rst gerbera-1.8.2/doc/scripting.rst --- gerbera-1.6.0/doc/scripting.rst 2020-07-24 19:37:20.000000000 +0000 +++ gerbera-1.8.2/doc/scripting.rst 2021-05-31 22:04:08.000000000 +0000 @@ -51,8 +51,7 @@ Any media file added will have an entry inside the PC Directory tree. PC Directory's hierarchy reflects the file system hierarchy, all objects inside the PC Directory including itself are NON-VIRTUAL objects. All virtual objects may have a different title, description, etc., but they are still references to objects in the PC-Directory. - That's why it is not possible to change a location of a virtual object - the only exceptions are URL items and - Active items. + That's why it is not possible to change a location of a virtual object - the only exceptions are URL items. 2. Once an item is added to the PC Directory it is forwarded to the virtual object engine. The virtual object engine's mission is to organize and present the media database in a logical hierarchy based on the available metadata of the @@ -138,12 +137,8 @@ +----------------------------------+-----------------------------------------------+ | OBJECT_TYPE_ITEM | Object is an item | +----------------------------------+-----------------------------------------------+ - | OBJECT_TYPE_ACTIVE_ITEM | Object is an active item | - +----------------------------------+-----------------------------------------------+ | OBJECT_TYPE_ITEM_EXTERNAL_URL | Object is a link to a resource on the Internet| +----------------------------------+-----------------------------------------------+ - | OBJECT_TYPE_ITEM_INTERNAL_URL | Object is an internal link | - +----------------------------------+-----------------------------------------------+ .. js:attribute:: orig.title @@ -266,6 +261,12 @@ Track number of the item, this corresponds to ``upnp:originalTrackNumber`` in the DIDL-Lite XML. + .. js:attribute:: orig.meta[M_PARTNUMBER] + + **RW** + + Part number of the item. This contains the disc number for audio tracks. + .. js:attribute:: orig.meta[M_AUTHOR] **RW** @@ -293,7 +294,7 @@ .. js:attribute:: orig.meta[M_ACTOR] **RW** - + Actor of the media, this corresponds to ``upnp:actor`` in the DIDL-Lite XML. .. js:attribute:: orig.meta[M_PRODUCER] @@ -313,10 +314,21 @@ Currently aux data can be gathered from **taglib, ffmpeg and libexif** (see the - `Import section `_ in the main documentation for + `Import section `_ in the main documentation for more details). So, this array will hold the tags that you specified in your config.xml, allowing you to create your virtual structure according to your liking. +.. js:attribute:: orig.res + + **RO** + + Array holding the resources. Resources represent the files attached to the media item. Got the the web UI to see the names of available + resources. The names of the first resource (number 0) are stored as they are. Further resources are prepended with `-`. + + Currently resources can be gathered during import process (see the + `Import section `_ in the main documentation for + more details). So, this array will hold further data, allowing you to adjust the virtual structure according to your liking. + .. js:attribute:: orig.playlistOrder **RW** @@ -326,6 +338,22 @@ you will increment the number for each new object that you create while parsing the playlist, thus ensuring that the resulting order is the same as in the original playlist. + +Configuration +------------- + +The configuration from `config.xml` and values changed via web UI are available in the global dictionary `config`. The key in the dictionary +is the xpath as shown in brackets in the web UI. Array items can be accessed via index, Dictionaries with the key. Complex entries like +transcoding are not available. The autoscan entry corresponding to the active object is stored in `object_autoscan_id`. Examples: + + .. code-block:: js + + print(config['/server/name']); + print(config['/import/library-options/id3/auxdata/add-data'][0]); + print(config['/import/layout/path']['Directories']); + print(config['/import/autoscan/directory'][object_autoscan_id].location); + + Constants --------- @@ -333,45 +361,41 @@ engine initialization. Do not assign any values to them, otherwise following script invocation will be using wrong values. -+---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ -| Constant | Type | Value | Notes | -+=======================================+=========+======================================+===============================================+ -| ``UPNP_CLASS_CONTAINER`` | string | object.container | | -+---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ -| ``UPNP_CLASS_CONTAINER_MUSIC_ARTIST`` | string | object.container.person.musicArtist | | -+---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ -| ``UPNP_CLASS_CONTAINER_MUSIC_GENRE`` | string | object.container.genre.musicGenre | | -+---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ -| ``UPNP_CLASS_CONTAINER_MUSIC_ALBUM`` | string | object.container.album.musicAlbum | | This container class will be treated by the | -| | | | | server in a special way, all music items in | -| | | | | this container will be sorted by ID3 track | -| | | | | number. | -+---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ -| ``UPNP_CLASS_PLAYLIST_CONTAINER`` | string | object.container.playlistContainer | | This container class will be treated by the | -| | | | | server in a special way, all items in this | -| | | | | container will be sorted by the number | -| | | | | specified in the playlistOrder property | -| | | | | (this is set when an object is created by | -| | | | | the playlist script). | -+---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ -| ``UPNP_CLASS_ITEM`` | string | object.item | | -+---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ -| ``UPNP_CLASS_ITEM_MUSIC_TRACK`` | string | object.item.audioItem.musicTrack | | -+---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ -| ``UPNP_CLASS_ITEM_VIDEO`` | string | object.item.videoItem | | -+---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ -| ``UPNP_CLASS_ITEM_IMAGE`` | string | object.item.imageItem | | -+---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ -| ``OBJECT_TYPE_CONTAINER`` | integer | 1 | | -+---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ -| ``OBJECT_TYPE_ITEM`` | integer | 2 | | -+---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ -| ``OBJECT_TYPE_ACTIVE_ITEM`` | integer | 4 | | -+---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ -| ``OBJECT_TYPE_ITEM_EXTERNAL_URL`` | integer | 8 | | -+---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ -| ``OBJECT_TYPE_ITEM_INTERNAL_URL`` | integer | 16 | | -+---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ + +---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ + | Constant | Type | Value | Notes | + +=======================================+=========+======================================+===============================================+ + | ``UPNP_CLASS_CONTAINER`` | string | object.container | | + +---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ + | ``UPNP_CLASS_CONTAINER_MUSIC_ARTIST`` | string | object.container.person.musicArtist | | + +---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ + | ``UPNP_CLASS_CONTAINER_MUSIC_GENRE`` | string | object.container.genre.musicGenre | | + +---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ + | ``UPNP_CLASS_CONTAINER_MUSIC_ALBUM`` | string | object.container.album.musicAlbum | | This container class will be treated by the | + | | | | | server in a special way, all music items in | + | | | | | this container will be sorted by ID3 disk | + | | | | | number and track number. | + +---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ + | ``UPNP_CLASS_PLAYLIST_CONTAINER`` | string | object.container.playlistContainer | | This container class will be treated by the | + | | | | | server in a special way, all items in this | + | | | | | container will be sorted by the number | + | | | | | specified in the playlistOrder property | + | | | | | (this is set when an object is created by | + | | | | | the playlist script). | + +---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ + | ``UPNP_CLASS_ITEM`` | string | object.item | | + +---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ + | ``UPNP_CLASS_ITEM_MUSIC_TRACK`` | string | object.item.audioItem.musicTrack | | + +---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ + | ``UPNP_CLASS_ITEM_VIDEO`` | string | object.item.videoItem | | + +---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ + | ``UPNP_CLASS_ITEM_IMAGE`` | string | object.item.imageItem | | + +---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ + | ``OBJECT_TYPE_CONTAINER`` | integer | 1 | | + +---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ + | ``OBJECT_TYPE_ITEM`` | integer | 2 | | + +---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ + | ``OBJECT_TYPE_ITEM_EXTERNAL_URL`` | integer | 8 | | + +---------------------------------------+---------+--------------------------------------+-----------------------------------------------+ Functions @@ -399,15 +423,33 @@ :param object object: A virtual object that is either a copy of or a reference to 'orig' :param string containerChain: - A string, defining where the object will be added in the database hierarchy. The containers in the chain + - A string, defining where the object will be added in the database hierarchy. The containers in the chain are separated by a slash '/', for example, a value of '/Audio/All Music' will add the object to the Audio, All Music container in the server hierarchy. Make sure to properly escape the slash characters in container names. You will find more information on container chain escaping later in this chapter. + - A string, containing the container id as optained from `addContainerTree`. In this case the third parameter is not used. :param string lastContainerClass: A string, defining the ``upnp:class`` of the container that appears last in the chain. This parameter can be omitted, in this case the default value ``object.container`` will be taken. Setting specific upnp container classes is useful to define the special meaning of a particular container; for example, the server will always sort - songs by track number if upnp class of a container is set to ``object.container.album.musicAlbum``. + songs by disk number and track number if upnp class of a container is set to ``object.container.album.musicAlbum``. + + +.. js:function:: addContainerTree(arr) + + Creates a hierarchy of containers + + :param array arr: An array of container defintions. It has the object structure as described above. + :returns: container id formatted for use in ``addCdsObject`` + + .. code-block:: js + + const chain = { + audio: { title: 'Audio', objectType: OBJECT_TYPE_CONTAINER, upnpclass: UPNP_CLASS_CONTAINER }, + allAudio: { title: 'All Audio', objectType: OBJECT_TYPE_CONTAINER, upnpclass: UPNP_CLASS_CONTAINER } + }; + var container = addContainerTree([chain.audio, chain.allAudio]); + addCdsObject(obj, container); .. js:function:: copyObject(originalObject) @@ -455,7 +497,6 @@ `The 'from' charsets can be defined in the server configuration` - Native Functions Available To The Playlist Script ------------------------------------------------- @@ -506,22 +547,84 @@ return path; } +.. js:function:: mapGenre(genre) + + Map value of the genre in virtual layout + + :param string: Source value of the genre + :returns: string - Modified value of the genre + + .. code-block:: js + + function mapGenre(genre) { + const genreConfig = config['/import/scripting/virtual-layout/genre-map/genre']; + if (genreConfig) { + const genreNames = Object.getOwnPropertyNames(genreConfig); + for (var idx = 0; idx < genreNames.length; idx++) { + var re = new RegExp('(' + genreNames[idx] + ')', 'i'); + var match = re.exec(genre); + if (match) { + genre = genreConfig[genreNames[idx]]; + break; + } + } + } + return genre; + } + +.. js:function:: mapInitial(firstChar) + + Map character to uppercase latin version + + :param string: Source character + :returns: string - Modified value of the character + + .. literalinclude:: ../scripts/js/common.js + :start-after: // doc-map-initial-begin + :end-before: // doc-map-initial-end + :language: js + +.. js:function:: intFromConfig(entry, defValue) + + Read integer config value or use default + + :param string entry: Config Entry + :param int defValue: Config Entry + :returns: int - value from config or default + + .. literalinclude:: ../scripts/js/common.js + :start-after: // doc-map-int-config-begin + :end-before: // doc-map-int-config-end + :language: js + +.. js:function:: stringFromConfig(entry, defValue) + + Read string config value or use default + + :param string entry: Config Entry + :param string defValue: Config Entry + :returns: string - value from config or default + + .. literalinclude:: ../scripts/js/common.js + :start-after: // doc-map-string-config-begin + :end-before: // doc-map-string-config-end + :language: js .. js:function:: getYear(date) :param string: A date formatted in ``yyyy-mm-dd`` :returns: string - Year value -.. code-block:: js + .. code-block:: js - function getYear(date) - { - var matches = date.match(/^([0-9]{4})-/); - if (matches) - return matches[1]; - else - return date; - } + function getYear(date) + { + var matches = date.match(/^([0-9]{4})-/); + if (matches) + return matches[1]; + else + return date; + } .. js:function:: getPlaylistType(mimetype) @@ -531,16 +634,16 @@ :param string: A valid mime-type :returns: string - playlist type -.. code-block:: js + .. code-block:: js - function getPlaylistType(mimetype) - { - if (mimetype == 'audio/x-mpegurl') - return 'm3u'; - if (mimetype == 'audio/x-scpls') - return 'pls'; - return ''; - } + function getPlaylistType(mimetype) + { + if (mimetype == 'audio/x-mpegurl') + return 'm3u'; + if (mimetype == 'audio/x-scpls') + return 'pls'; + return ''; + } @@ -550,6 +653,9 @@ Now it is time to take a closer look at the default scripts that are supplied with Gerbera. Usually it is installed in the ``/usr/share/gerbera/js/`` directory, but you will also find it in ``scripts/js/`` in the Gerbera source tree. +The functions are defined in `common.js` and can easily be overwritten in a file which is set in `custom-script` in `config.xml`. +Compared to former versions of gerbera you do not have to copy the whole file to overwrite one function. + .. Note:: this is not a JavaScript tutorial, if you are new to JS you should probably make yourself familiar with the language. @@ -570,7 +676,7 @@ artist, genre, etc. information, this allows us to create a nice container layout. -.. literalinclude:: ../scripts/js/import.js +.. literalinclude:: ../scripts/js/common.js :start-after: // doc-add-audio-begin :end-before: // doc-add-audio-end :language: js @@ -598,7 +704,7 @@ specify the fields of interest in the import section of your configuration file (See documentation about library-options). -.. literalinclude:: ../scripts/js/import.js +.. literalinclude:: ../scripts/js/common.js :start-after: // doc-add-image-begin :end-before: // doc-add-image-end :language: js @@ -619,7 +725,7 @@ specify the fields of interest in the import section of your configuration file (See documentation about library-options). -.. literalinclude:: ../scripts/js/import.js +.. literalinclude:: ../scripts/js/common.js :start-after: // doc-add-video-begin :end-before: // doc-add-video-end :language: js @@ -631,7 +737,7 @@ This function processes items that are imported via the Apple Trailers feature. We will organize the trailers by genre, post date and release date, additionally we will also add a container holding all trailers. -.. literalinclude:: ../scripts/js/import.js +.. literalinclude:: ../scripts/js/common.js :start-after: // doc-add-trailer-begin :end-before: // doc-add-trailer-end :language: js @@ -676,7 +782,7 @@ Below is the complete function with some comments: -.. literalinclude:: ../scripts/js/playlists.js +.. literalinclude:: ../scripts/js/common.js :start-after: // doc-add-playlist-item-begin :end-before: // doc-add-playlist-item-end :language: js @@ -692,9 +798,434 @@ To keep things easy we will only list the m3u parsing here. Again, if you are not familiar with regular expressions, now is probably the time to take a closer look. -.. literalinclude:: ../scripts/js/playlists.js +.. literalinclude:: ../scripts/js/common.js :start-after: // doc-playlist-m3u-parse-begin :end-before: // doc-playlist-m3u-parse-end :language: js **Happy scripting!** + + +Example: How to import and play CD-Images (CUE-File) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Do you want to archive your CDs without loss? With ExactAudioCopy (EAC) you can easily create an image in FLAC format and a CUE file. The CUE file is a text file containing information about the individual tracks. Gerbera allows you to use scripts to read in the CUE file and play back the individual tracks. + +Prerequisits +------------ + +1) You have a image copy of your CD in the FLAC-format and a CUE-File. The FLAC-File may include the cover art. +#) Gerbera with the External-Link-Patch. +#) Linux (here Ubuntu 18.04 is used). +#) A flac player on your system. + +:: + + sudo apt install flac + + + +Create a transcoder-script +-------------------------- + +:: + + #!/bin/bash + # flac2wav.sh transcoding script to play a range from a flac file. + # + # Usage flac2wav.sh + # + # The is a base64-encoded URL: + # ::= "params?skip=