-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7cbb079
commit 1e8e710
Showing
19 changed files
with
331 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# - Try to find the GLIB2 libraries | ||
# Once done this will define | ||
# | ||
# GLIB2_FOUND - system has glib2 | ||
# GLIB2_INCLUDE_DIR - the glib2 include directory | ||
# GLIB2_LIBRARIES - glib2 library | ||
|
||
# Copyright (c) 2008 Laurent Montel, <montel@kde.org> | ||
# | ||
# Redistribution and use is allowed according to the terms of the BSD license. | ||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||
|
||
|
||
if(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES) | ||
# Already in cache, be silent | ||
set(GLIB2_FIND_QUIETLY TRUE) | ||
endif(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES) | ||
|
||
if (NOT WIN32) | ||
find_package(PkgConfig) | ||
if (PKG_CONFIG_FOUND) | ||
pkg_check_modules(PC_LibGLIB2 glib-2.0) | ||
endif (PKG_CONFIG_FOUND) | ||
endif(NOT WIN32) | ||
|
||
if (PC_LibGLIB2_INCLUDEDIR) | ||
set(GLIB2_MAIN_INCLUDE_DIR ${PC_LibGLIB2_INCLUDEDIR}) | ||
else (PC_LibGLIB2_INCLUDEDIR) | ||
find_path(GLIB2_MAIN_INCLUDE_DIR NAMES glib.h PATH_SUFFIXES glib-2.0) | ||
endif (PC_LibGLIB2_INCLUDEDIR) | ||
|
||
# search the glibconfig.h include dir under the same root where the library is found | ||
find_library(GLIB2_LIBRARIES | ||
NAMES glib-2.0 | ||
HINTS ${PC_LibGLIB2_LIBDIR} | ||
) | ||
|
||
get_filename_component(glib2LibDir "${GLIB2_LIBRARIES}" PATH) | ||
|
||
find_path(GLIB2_INTERNAL_INCLUDE_DIR glibconfig.h | ||
PATH_SUFFIXES glib-2.0/include | ||
HINTS ${PC_LibGLIB2_INCLUDEDIR} "${glib2LibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH}) | ||
|
||
set(GLIB2_INCLUDE_DIR "${GLIB2_MAIN_INCLUDE_DIR}") | ||
|
||
# not sure if this include dir is optional or required | ||
# for now it is optional | ||
if(GLIB2_INTERNAL_INCLUDE_DIR) | ||
set(GLIB2_INCLUDE_DIR ${GLIB2_INCLUDE_DIR} "${GLIB2_INTERNAL_INCLUDE_DIR}") | ||
endif(GLIB2_INTERNAL_INCLUDE_DIR) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(GLIB2 DEFAULT_MSG GLIB2_LIBRARIES GLIB2_MAIN_INCLUDE_DIR) | ||
|
||
mark_as_advanced(GLIB2_INCLUDE_DIR GLIB2_LIBRARIES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# - Try to find Polkit | ||
# Once done this will define | ||
# | ||
# POLKIT_FOUND - system has Polkit | ||
# POLKIT_INCLUDE_DIRS - Polkit's include directories | ||
# POLKIT_AGENT_INCLUDE_DIRS - Polkit-agent's include directories | ||
# POLKIT_LIBRARIES - Link this to use polkit's gobject library | ||
# POLKIT_AGENT_LIBRARY - Link this to use the agent wrapper in polkit | ||
# POLKIT_DEFINITIONS - Compiler switches required for using Polkit | ||
# Copyright (c) 2009, Dario Freddi, <drf@kde.org> | ||
# | ||
# Redistribution and use is allowed according to the terms of the BSD license. | ||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||
#NOTE: Polkit agent library is disabled! | ||
if (POLKIT_INCLUDE_DIR AND POLKIT_LIB) | ||
set(POLKIT_FIND_QUIETLY TRUE) | ||
endif (POLKIT_INCLUDE_DIR AND POLKIT_LIB) | ||
if (NOT WIN32) | ||
# use pkg-config to get the directories and then use these values | ||
# in the FIND_PATH() and FIND_LIBRARY() calls | ||
find_package(PkgConfig) | ||
pkg_check_modules(PC_POLKIT polkit-gobject-1) | ||
#pkg_check_modules(PC_POLKIT_AGENT polkit-agent-1) | ||
set(POLKIT_DEFINITIONS ${PC_POLKIT_CFLAGS_OTHER}) | ||
endif (NOT WIN32) | ||
# We must include glib paths too... which sucks balls | ||
find_package(GLIB2) | ||
find_path( GLIB_CONFIG_INCLUDE_DIR | ||
NAMES glibconfig.h | ||
PATH_SUFFIXES glib-2.0/include | ||
HINTS ${PC_POLKIT_INCLUDE_DIRS} | ||
) | ||
find_path( POLKIT_INCLUDE_DIR | ||
NAMES polkit/polkit.h | ||
PATH_SUFFIXES polkit-1 | ||
HINTS ${PC_POLKIT_INCLUDE_DIRS} | ||
) | ||
#find_path( POLKIT_AGENT_INCLUDE_DIR | ||
# NAMES polkitagent/polkitagent.h | ||
# PATH_SUFFIXES polkit-1 | ||
# HINTS ${PC_POLKIT_AGENT_INCLUDE_DIRS} | ||
#) | ||
#set(POLKIT_INCLUDE_DIRS ${GLIB2_INCLUDE_DIR} ${_POLKIT_INCLUDE_DIR}) | ||
#set(POLKIT_AGENT_INCLUDE_DIRS ${GLIB2_INCLUDE_DIR} ${_POLKIT_AGENT_INCLUDE_DIR}) | ||
find_library( POLKIT_LIBRARIES | ||
NAMES polkit-gobject-1 | ||
HINTS ${PC_POLKIT_LIBDIR} | ||
) | ||
#find_library( POLKIT_AGENT_LIBRARY | ||
# NAMES polkit-agent-1 | ||
# HINTS ${PC_POLKIT_AGENT_LIBDIR} | ||
#) | ||
#set(POLKIT_LIBRARIES ${_POLKIT_LIBRARIES} ${GLIB2_LIBRARIES}) | ||
#set(POLKIT_AGENT_LIBRARY ${_POLKIT_AGENT_LIBRARY} ${GLIB2_LIBRARIES}) | ||
include(FindPackageHandleStandardArgs) | ||
# handle the QUIETLY and REQUIRED arguments and set POLKIT_FOUND to TRUE if | ||
# all listed variables are TRUE | ||
#find_package_handle_standard_args(Polkit DEFAULT_MSG POLKIT_LIBRARIES POLKIT_AGENT_LIBRARY | ||
# POLKIT_INCLUDE_DIR POLKIT_AGENT_INCLUDE_DIR GLIB2_FOUND) | ||
find_package_handle_standard_args(Polkit DEFAULT_MSG POLKIT_LIBRARIES | ||
POLKIT_INCLUDE_DIR GLIB2_FOUND) | ||
mark_as_advanced(POLKIT_INCLUDE_DIRS POLKIT_AGENT_INCLUDE_DIRS POLKIT_LIBRARIES POLKIT_AGENT_LIBRARY GLIB_INCLUDE_DIR) | ||
set(POLKIT_POLICY_FILES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/polkit-1/actions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
1e8e710
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional to not install the zoneminder.service file at this time with autotools ? (not included in AC_CONFIG_FILES)
On my server (debian jessie), zm fails to start because of this missing file.
The service hangs forever on starting and there is no fallback to sysvinit.
I added manually the file but I had to comment the Requires line as both mysqld.service and httpd.service files are not yet available on debian.
1e8e710
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Historically, zoneminder has neither installed the sys v init file nor will it install the systemd service file.
This is by design and is only the case when building from source, rather than from package. The distro-specific packaging scripts take care of installing the correct startup script.
1e8e710
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, got it. I mixed up the files with those from a previous installation.
The comment is still usefull because the file is not generated by autotools (it is with cmake).
1e8e710
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But in the past zoneminder could run without installing the sys v init files - you could start it via "zmpkg.pl start"
With the current zoneminder systemd intergration, if you don't install the zoneminder.service file, zoneminder can't start. In addition, there's nothing about this requirement in the INSTALL file.
It really should be installed even for source builds, or at least the INSTALL documentation should be updated.
Similar for the /etc/tmpfiles.d/zoneminder.conf - also, that file should be installed to /usr/lib/tmpfiles.d, at least on Fedora 21, per man tmpfiles.d and http://fedoraproject.org/wiki/Packaging:Tmpfiles.d
PS: I'm running zoneminder 1.28 on Fedora 21, via the tar file download. Keep up the good work :-)
1e8e710
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@patmans Exactly. In the past and in a sys v init environment. Systemd requires a service file. This is just one example where systemd is not flexible like the old sys v init. Systemd only looks similar on the surface. Under the hood it is a completely different animal and there is no way to accomplish what you are asking w/o breaking other things.
Zoneminder handles the systemd service file exactly the same way it has always handled the old sys v init script. This functionality has not changed. When building from source, it is up to you to choose the correct startup script, verify it is correct for your system, copy it from the source tree, and into the correct place. It is not possible to write a script that gets this right for every single distro out there.
Now if you install from a package then you can expect the package maintainer to have done this work for you. The correct script should get auto-installed. If it isn't then it should be reported as a bug to the package maintainer.
1e8e710
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could conditionally copy the service file depending on whether or not systemd is in installed.
But in any case the INSTALL file should be updated.
1e8e710
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we absolutely cannot! That would require us to make assumptions that won't be true in every case.
Take Ubuntu 14.10 for example. It has both sys v init and systemd installed on it at the same time. As soon as we make the assumption that we should go with sys v init then that would break any install that chooses to go with systemd.
Go look at other open source softwares and you will see that this task has always been handled by the package maintainer.
I will update the INSTALL file to make it more clear what you need to do (step 10 I presume)
1e8e710
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already have distro specific cmake files - so only install it for Fedora.
1e8e710
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is already done in the Fedora specfile. If you don't want to have to put on your developer hat on then you should not be building from source. Use zmrepo to install the rpm package instead.
1e8e710
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There aren't any repos for F21, and the RPM I'd been using was for F19, so I chose to use the source.
I thought of just trying to build via the specfile, but decided to build from source first.
I wouldn't be posting here if I hadn't put my developer hat on ...