Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Feat depends fixup #1

Merged
merged 7 commits into from
Sep 15, 2022
Merged

Feat depends fixup #1

merged 7 commits into from
Sep 15, 2022

Conversation

dekeonus
Copy link
Collaborator

Some ebuild tidy-up
fix invalid depends
add web server selection.

TODO
write code to handle old 10_zoneminder.conf
package dev-libs/libjwt

More details in the individual commits.

* copied existing zoneminder-1.36.9999.ebuild from oubliette-overlay to
  zoneminder-1.36.9999-r10.ebuild.

* Updated git branch selection code
* Updated src_prepare to be safer (don't invoke return in if .. else)
* Removed Keywords

This will provide base for future comparison. (so diff doesn't show just
new file).

Signed-off-by: Bill Prendergast <dek.devel@baisenvar.info>
DEPEND
* Remove depend on media-libs/libmp4v2 and encode use flag
  this was removed in upstream's 1.36 release and is noted in release notes

* Correct media-libs/openjpeg -> media-libs/libjpeg-turbo
  openjpeg is jpeg2000 codec/format, zoneminder needs jpeg codec/format (and
  thus looks for jpeg libs and headers)

OTHER
* Remove MY_PN variable: it was only used to set a single path element in a
  single URI for SRC_URI

* Add don't gzip man page patch, consequently remove the gzip exclude in
  src_install

* fix cmake config
  - /var/run is depreciated switch to /run
  - we use some paths that cmake build has defaults for, set them so we aren't
    surprised by some future update.
  - HAVE_LIBGNUTLS gets reset on us, cheat by setting -DGNUTLS_LIBRARIES=0

* don't remove upstream's readme in the ZM_CONFIG_DIR/conf.d dir
  as we no longer install zm config files into /etc/conf.d

Signed-off-by: Bill Prendergast <dek.devel@baisenvar.info>
so far apache2 and nginx

* cleanup potentially old web-api dir symlinks (my understanding is that this
  was fixed some time ago) Testing seemed to work here web and zmNinja

* new init.d to handle build time selection of web server / user
  updated to not use conf.d -was unnecessary to set cmd_stop/start in a conf.d

* Use upstream's systemd.service - with edits
  - switch the hard depend to a soft depend.
  - don't fiddle with the TZ environment.

* Don't use 10_zoneminder.conf for apache2 vhost. Use Gentoo style apache
  vhost config files.
  - Don't install a vhost.conf (ie active vhost) example installed in docs
  - *Do* install a vhost.include is also installed into docs

* New README to coincide with webserver selection

TODO
* handle moving old 10_zoneminder.conf to zoneminder.include then adding
   symlink (so an upgrade won't break an existing install).
  need to test some here: the move has to come before the new install so
   etc-update is using the old file as a base for the new install, not the
   other way around
* Finalise dev-libs/libjwt packaging: gnutls builds do not work without it
   I Also note that 1.37+ will allow openssl builds to use libjwt as well.
use %WWW_SERVER% mysql php-fpm
}

start_pre() {
Copy link
Collaborator Author

@dekeonus dekeonus Aug 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also have a init.d-r2 designed for a system with tmpfiles.d support.

Edit: i.e. it does not have nor need the start_pre() function, but does require installation of a tmpfiles.conf and that the system has tmpfiles.d support installed

@dekeonus
Copy link
Collaborator Author

dekeonus commented Aug 31, 2022

I'm not sure how to convince github web interface to show a diff between the first commit and the last commit.

EDIT: nvm - view diff from single commit (first) and then use next / prev on upper right.

if [[ ${PV} == 9999 || ${MY_PV_P} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/ZoneMinder/zoneminder"
if [[ "${MY_PV_MM}" == 1.36 ]]; then
Copy link
Collaborator Author

@dekeonus dekeonus Aug 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for future ease of maintenance: when 1.37 releases as 1.38 this could be changed to support a live build for the 1.38 series. However it is to be noted that already 1.37 has different dependencies than 1.36 so this git branch selection might also want to be in the base 9999 ebuild.

Thank you very much vim, those spaces were wanted not tabs.

Signed-off-by: Bill Prendergast <dek.devel@baisenvar.info>
pkgcheck:
- TarballAvailable: URI uses .zip archive when .tar* is available
- UnknownUseFlags: nginx missing from metadata.xml

Note on TarballAvailable, using a zip archive in SRC_URI *requires*
BDEPEND on app-arch/zip, but tar.gz should be preferred as it has better
compression

Signed-off-by: Bill Prendergast <dek.devel@baisenvar.info>
Update DEPEND so that use gnutls pulls in dev-libs/libjwt[gnutls] as
this is a required dependancy for a gnutls build - The build system will
fall back to openssl if that has been found (but this is not what the
user asked for).

Signed-off-by: Bill Prendergast <dek.devel@baisenvar.info>
fi

LICENSE="GPL-2"
IUSE_WEB_SERVER="apache2 nginx"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this triggers a pkgcheck warning RequiredUseDefaults ~~ in default profiles there is no apache2 nor nginx USE flag set so an end user would need to configure /etc/portage/package.use (or make.conf) to enable building the package.
I feel this is the correct approach: you can't build out-of-the-box without first setting your desired web-server.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm might also want a pkg_pretend (I've forgotten the exact phase name) to check if the web-server is changing: if so we almost definitely want the zoneminder instance stopped as we will need to chown the existing events etc.

#keepdir /var/lib/zoneminder/api_tmp
# set perms/owners per dir, to keep .keep files root owned
fperms 0775 /var/lib/zoneminder /var/lib/zoneminder/images /var/lib/zoneminder/events
fowners ${MY_WEB_USER}:${MY_WEB_GROUP} /var/lib/zoneminder /var/lib/zoneminder/images /var/lib/zoneminder/events
Copy link
Collaborator Author

@dekeonus dekeonus Sep 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These directories will need some pkg_postinst work (fowners -R /blah/ ) in the case that the web-server changes: can't be done here this only affects the install image. An existing install with events will need to have those events owner:group changed. (On that note also need to examine the database: is any reference to web-server user/group saved in there?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked, Not seeing any reference to web-server user/group in the database

@nabbi nabbi merged commit 6edd145 into nabbi:main Sep 15, 2022
@dekeonus dekeonus deleted the feat-depends-fixup branch September 17, 2022 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants