Page MenuHomeFreeBSD

net-mgmt/librenms: Add a second DISTFILES entry, for the vendor directory, not included byupstream code.
ClosedPublic

Authored by dvl on Aug 29 2018, 1:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 28, 3:45 PM
Unknown Object (File)
Feb 26 2024, 12:36 PM
Unknown Object (File)
Feb 23 2024, 11:22 AM
Unknown Object (File)
Feb 12 2024, 4:58 AM
Unknown Object (File)
Feb 12 2024, 4:58 AM
Unknown Object (File)
Feb 12 2024, 4:58 AM
Unknown Object (File)
Feb 12 2024, 4:57 AM
Unknown Object (File)
Feb 12 2024, 4:57 AM
Subscribers
None

Details

Summary

The latest librenms releases expect PHP composer to be run. That is difficult to do at package build time, but we might be able to do it. In the meantime, I have resorted to manually creating the expected tarball.

Test Plan

The maintainer needs to run the commands on each release and then
upload the resulting vendor directory tarball:

git clone git@github.com:librenms/librenms.git

avoid php warnings/errors

in /usr/local/etc/php.ini set:
date.timezone = "UTC"

install required packages

pkg install php56-mysqli php56-session php56-gd php56-tokenizer php56-xmlwriter php56-curl php56-xml php56-pdo

get the upstream code

git clone git@github.com:librenms/librenms.git

select the release we are buliding

cd librenms
git checkout tags/1.42.01

use composer to build the vendor directory

./scripts/composer_wrapper.php install --no-dev

create the tarball

mv vendor librenms-vendor-1.42.01
tar -czf librenms-vendor-1.42.01.tar.gz librenms-vendor-1.42.01

copy it to where it can be fetched:

scp librenms-vendor-1.42.01.tar.gz freefall:~/public_distfiles/

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 19267
Build 18880: arc lint + arc unit

Event Timeline

net-mgmt/librenms/Makefile
10

I have no idea if this is the correct way to specify additional MASTER_SITES and DISTFILES

It is working, but I suspect there is a better way.

165

The upstream vendor code expects to write to this location, hence the +w

I don't like it. I would prefer the code did not do this, but there is no known configuration change which will affect this.

net-mgmt/librenms/files/pkg-message.in
33

This is something I wish we could do for the user, but it is site-specific and generates a key for the app.

dvl retitled this revision from Add a second DISTFILES entry, for the vendor directory, not included by upstream code. to Add a second DISTFILES entry, for the vendor directory, not included byupstream code..Aug 29 2018, 2:01 PM
dvl edited the summary of this revision. (Show Details)
net-mgmt/librenms/Makefile
10

It is not, as make fetch-urlall-list will show you. Read 5.4.9. Multiple Distribution or Patches Files from Multiple Locations

dvl marked an inline comment as done.

Do multiple MASTER_SITES

dvl marked an inline comment as done.Aug 29 2018, 5:45 PM
dvl added inline comments.
net-mgmt/librenms/Makefile
10

Ahh, I did not see that when searching. merci.

$ make fetch-urlall-list
http://distcache.FreeBSD.org/local-distfiles/dvl/librenms-vendor-1.42.01.tar.gz
http://distcache.us-east.FreeBSD.org/local-distfiles/dvl/librenms-vendor-1.42.01.tar.gz
http://distcache.eu.FreeBSD.org/local-distfiles/dvl/librenms-vendor-1.42.01.tar.gz
http://distcache.us-west.FreeBSD.org/local-distfiles/dvl/librenms-vendor-1.42.01.tar.gz
http://distcache.FreeBSD.org/ports-distfiles/librenms-vendor-1.42.01.tar.gz
https://codeload.github.com/librenms/librenms/tar.gz/1.42.01?dummy=/librenms-librenms-1.42.01_GH0.tar.gz
http://distcache.FreeBSD.org/ports-distfiles/librenms-librenms-1.42.01_GH0.tar.gz
https://codeload.github.com/librenms/librenms/tar.gz/1.42.01?dummy=/librenms-librenms-1.42.01_GH0.tar.gz
http://distcache.FreeBSD.org/ports-distfiles/librenms-librenms-1.42.01_GH0.tar.gz
11

I am going to change this to use PORTVERSION etc.

12

Is this an appropriate way to name the vendor distfile?

linimon retitled this revision from Add a second DISTFILES entry, for the vendor directory, not included byupstream code. to net-mgmt/librenms: Add a second DISTFILES entry, for the vendor directory, not included byupstream code..Aug 29 2018, 5:49 PM
dvl marked an inline comment as done.

Use variables for DISTFILES

dvl marked an inline comment as done.Aug 29 2018, 5:53 PM
net-mgmt/librenms/Makefile
9–12

Remove all the :librenms stuff, it's already added, correctly, by USE_GITHUB.

dvl marked an inline comment as done.

Add .env.example & patch it for simple use
Patch includes/common.php so the about has a valid version and date
Remove :librenms from DISTFILES and MASTER_SITES because GH fixes that.

Patch for installing from packages vs git

Not sure what changed this time.

net-mgmt/librenms/Makefile
10

You should probably use ports-mgmt/distilator to check things instead of relying on eyes and fetch-urlall-list :-)

19–22

Wrong place in the Makefile. See Chapter 15. Order of Variables in Port Makefiles.

Fix up USES
rearange Makefile according to proper order

dvl marked 2 inline comments as done.Aug 31 2018, 4:38 PM

Ready to commit now, after removing PORTREVISION

net-mgmt/librenms/Makefile
9

This is for net-mgmt/librenms/files/patch-includes_common.php

The code expects a timestamp value.

9–12

Yes, I noticed this:

===>  Extracting for librenms-1.42.01_5,1
=> SHA256 Checksum OK for librenms-vendor-1.42.01.tar.gz.
=> SHA256 Checksum OK for librenms-librenms-1.42.01_GH0.tar.gz.
=> SHA256 Checksum OK for librenms-librenms-1.42.01_GH0.tar.gz.
10

This must be removed before the commit.

10

This is a nice tool. Thank you.

$ distilator . 
301 [WWW]	http://www.librenms.org -> https://www.librenms.org/
200 [DISTFILE]	http://distcache.FreeBSD.org/local-distfiles/dvl/librenms-vendor-1.42.01.tar.gz
200 [DISTFILE]	http://distcache.eu.FreeBSD.org/local-distfiles/dvl/librenms-vendor-1.42.01.tar.gz
200 [DISTFILE]	https://codeload.github.com/librenms/librenms/tar.gz/1.42.01?dummy=/librenms-librenms-1.42.01_GH0.tar.gz
200 [DISTFILE]	http://distcache.us-west.FreeBSD.org/local-distfiles/dvl/librenms-vendor-1.42.01.tar.gz
200 [DISTFILE]	http://distcache.us-east.FreeBSD.org/local-distfiles/dvl/librenms-vendor-1.42.01.tar.gz
19–22

I moved a whole bunch of stuff around.

net-mgmt/librenms/files/patch-config.php.default
7 ↗(On Diff #47466)

This patch tells the code that we were installed from a package, not from git.

net-mgmt/librenms/files/patch-includes_common.php
24 ↗(On Diff #47466)

It is valid to have git installed but be installed from a package.

11 ↗(On Diff #47463)

The code assumes we have installed via git clone. This new code will ensure the /about/ page will populate.

net-mgmt/librenms/files/pkg-message.in
58

Ahh yes, this needs to be added to your configuration file. I think I will also create an UPDATING entry.

net-mgmt/librenms/Makefile
56

Wrong place in the Makefile. See Chapter 15. Order of Variables in Port Makefiles.

58

Why +=?

net-mgmt/librenms/files/pkg-message.in
2

%%LOCALBASE%%/etc/mysql/my.cnf.

dvl marked 6 inline comments as done.Sep 1 2018, 6:26 PM
dvl added inline comments.
net-mgmt/librenms/Makefile
56

Oh, it goes after USES and USE

58

I don't know.

This revision was not accepted when it landed; it landed in state Needs Review.Sep 1 2018, 7:02 PM
Closed by commit rP478715: Upgrade to 1.42.01 (authored by dvl). · Explain Why
This revision was automatically updated to reflect the committed changes.
dvl marked 2 inline comments as done.