SAMS2 (Squid Account Management System) is a WEB-based interface for managing Squid. Descendant of broken www/sams, but absolutely new and different.
Created attachment 145674 [details] sams2.shar
Thanks, we are making progress. Now, do you have any verification available? In order of preference, examples of what I'm looking for are: 1) "poudriere testport" or "poudriere bulk -t" logs 2) Redports or tinderbox logs 3) "make check-plist" followed by "make stage-qa" output (https://www.freebsd.org/doc/en/books/porters-handbook/porting-testing.html) Also, please run "portlint" and paste the output. Also, is there a good reason not to call this www/sams? There's no problem resurrecting www/sams and then replacing it with this shar. I don't see an immediate need to call this sams2 (it's generally not a good idea to have the version in the name although there plenty of exceptions)
Created attachment 145743 [details] sams2.shar Fixed some issues.
Created attachment 145744 [details] make check-plist;make stage-qa;portlint
Hi John. sams2.shar, in attachment, updated. Tests are here https://razumit.ru/poudriere/. Checks in attachment here https://bz-attachments.freebsd.org/attachment.cgi?id=145744. Not sure about the proper name. There is two different versions of SAMS, 1.x and 2.x. Latter one actively developing, but about first one not sure.
These warnings need to be fixed: Warning: 'bin/samsparser' is not stripped consider using ${STRIP_CMD} Warning: 'bin/sams2daemon' is not stripped consider using ${STRIP_CMD} Warning: 'bin/sams2redir' is not stripped consider using ${STRIP_CMD} Warning: 'lib/sams2/libloadavg.so.1' is not stripped consider using ${STRIP_CMD} Warning: 'lib/sams2/libfsusage.so.1' is not stripped consider using ${STRIP_CMD} ====> Checking for pkg-plist issues (check-plist) ===> Parsing plist ===> Checking for items in STAGEDIR missing from pkg-plist ===> Checking for directories owned by MTREEs ===> Checking for directories handled by dependencies ===> Checking for items in pkg-plist which are not in STAGEDIR ===> No pkg-plist issues found (check-plist) ====>> Checking for staging violations... done If it's an automake file, it may have "install-strip" target. If you define "INSTALL_TARGET= install-strip" in that case, the warnings will go away. the version "2" is part of the packagename already. So your package name right now is "sams2-2.0" which is redundant. There is no sams 1, so there's nothing to get confused with. It's perfectly normal to keep the same port name and increase the versions. So I think you should go back to calling this "sams" unless there truly is no upgrade path from sams-1 to sams-2 Anyway, you are very close. Fix those stage-qa warnings and thing about renaming it, then I think it will be patch-ready.
Created attachment 145753 [details] sams.shar renamed to sams
INSTALL_TARGET= install-strip did the trick. make stage-qa return no warnings. Renamed to sams.
fantastic! Note to next committer: resurrect www/sams first, then replace it with this shar. Moving to patch-ready.
But what if this approach sams2 update the old sams? I'm not sure a smooth transition from version 1.x.x to version sams 2.x.x. As rightly pointed above - in fact it is two different projects.
(In reply to Mikhail from comment #10) > But what if this approach sams2 update the old sams? There is no "old" sams. There's no sams at all, it's been deleted, remember? > I'm not sure a smooth > transition from version 1.x.x to version sams 2.x.x. As rightly pointed > above - in fact it is two different projects. What do you mean? Is it a fork? Is not sams-2.0 the logical successor to sams-1.0 ?
I'm talking about the case when sams 1.0 is already installed. (For example, I) Yes, sams2 rather fork of sams project. And sams2 unlikely will pick up settings and database from sams 1.0 "as is". But at least in sams 2 present tool for import from samas 1.0 database. Do you think in this approach appropriate to replacement sams-sams2?
why not? We can add an entry to UPDATING section for this. But if you guys really want to be called something else, we can do that as well. I'd prefer something other than "sams2" but if there's not a better name, so be it.
Well, as an option. Looking forward to the emergence of a new port.
Created attachment 145773 [details] sams2.shar
Dmitry Chemerik, author of sams also thinks that it should be sams2.
new version please: XPORTREVISION= 1 XPORTEPOCH= 1 If this is a new port then neither PORTREVISION nor PORTEPOCHE should be set
Created attachment 145774 [details] sams2.shar
Removed PORTREVISION, PORTEPOCH. Added PORTVERSION.
Need a small fix: sams2 designed primarily for Linux, as in linux squid is not located in /usr/local/sbin, but in /usr/sbin Therefore, for sams2 daemon was able to work correctly in FreeBSD needs to create a symbolic link: ln -s /usr/local/sbin/squid/usr/sbin/squid Otherwise, the sams2 daemon will not start. Everything else works great! Tested on freebsd 10+mysql5.6+php55+apache24+squid33
(In reply to Mikhail from comment #20) > Need a small fix: > sams2 designed primarily for Linux, as in linux squid is not located in > /usr/local/sbin, but in /usr/sbin > Therefore, for sams2 daemon was able to work correctly in FreeBSD needs to > create a symbolic link: > ln -s /usr/local/sbin/squid/usr/sbin/squid > Otherwise, the sams2 daemon will not start. > Everything else works great! > Tested on freebsd 10+mysql5.6+php55+apache24+squid33 symbolic link: ln -s /usr/local/sbin/squid /usr/sbin/squid Sorry for the any clerical.
(In reply to Mikhail from comment #21) > symbolic link: > ln -s /usr/local/sbin/squid /usr/sbin/squid > > > Sorry for the any clerical. will not work. Ports is not allowed to install anything in /usr/sbin, that's part of base. You need a better solution. Patch sams2 to look in the right place to begin with.
Sorry, this is not a bug. I just did not pay attention to the new variable "SQUIDPATH" file sams2.conf. The default value is "/usr/sbin", changed to "/usr/local/sbin" and there have been no creation of links. Everything works fine. I think the port is ready for use. I wait for it appearance in the ports tree.
(In reply to Mikhail from comment #23) > Sorry, this is not a bug. I just did not pay attention to the new variable > "SQUIDPATH" file sams2.conf. > The default value is "/usr/sbin", changed to "/usr/local/sbin" and there > have been no creation of links. If I understood this correctly, sams2 will default to /usr/sbin unless this variable is explicitly set in the sams2.conf file. It sounds like the default is bad. Or at the very list, this definition should be preset in a sample conf file. To have it not work by default is not optimal. I would have to look to see the details though.
No, this variable is initially set in file sams2.conf ie: "SQUIDPATH =/usr/sbin" For freebsd should be changed to: "SQUIDPATH =/usr/local/sbin" Once again, I draw your attention to - it's not a bug, but my flaw in the initial configuration sams2. I can later put here a working example file sams2.conf, adapted for freebsd.
(In reply to Mikhail from comment #25) > No, this variable is initially set in file sams2.conf > ie: "SQUIDPATH =/usr/sbin" > For freebsd should be changed to: "SQUIDPATH =/usr/local/sbin" > Once again, I draw your attention to - it's not a bug, but my flaw in the > initial configuration sams2. > I can later put here a working example file sams2.conf, adapted for freebsd. You mean there is no sample sams2.conf yet? It sounds like one is needed, why not add it now before the PR is claimed? if the conf.sample can be used with defaults, it should be preinstalled with the @sample keyword in the pkg-plist. But maybe it's impossible to run sams2 with an unaltered conf file, I don't know. In any case, a conf.sample should be provided with decent default values.
No, it is. And with examples and comments. But the default settings do not provide the correct work "out of the box." Need at least change the path to squid, squid.conf, squid logs dir and squid cache dir, to make things work. Iin its turn have already resulted in most of these parameters in accordance with the default paths for squid/cache/log/squid.conf in freebsd.
Created attachment 145808 [details] sams2.conf adapted for freebsd Here is config sams2.conf in which I have corrected all paths to the SQUID file and logs.
Created attachment 145819 [details] sams2.shar Added sams2.conf
no resurrection anymore, as long as we are fixing title.
(In reply to John Marino from comment #30) > no resurrection anymore, as long as we are fixing title. All is fixed for now I suppose.
minor feedback: you have "@" masking pre-install commands. Don't mask installation commands. The exception is mkdir; you are allowed to mask mkdir commands during install phase. The rest have to be visible.
major feedback: Your sams2.conf method is unacceptable; it will overwrite existing conf files. You must use @sample in pkg-plist for this. See advanced plist methods in porters handbook. I'll fix it here but you need to understand why it's wrong what you did.
There seems to be some sort of typo in pkg-plist, %%ETCDIR%%.conf makes no sense at all. My guess it was for sams2.conf even though there is not even a directory separator
what happens if apache is at 2.2? Right now no version of mod_php will be listed as run depends. Is that what is intended?
(In reply to John Marino from comment #35) > what happens if apache is at 2.2? Right now no version of mod_php will be > listed as run depends. Is that what is intended? Yes, there is no need to separate mod_php for apache2.2.
okay, thanks. I am running testport now to see about these apache sams2.conf files to see if they are overwriting as well. They might also need @sample treatment
moderate issue: Every single directory is removed with @dirrmtry. Surely this is incorrect. You must use @dirrm when it is guaranteed to succeed. I do not care that make makeplist generated that. It's supposed to be manually tailored. make makeplist is a bit stupid that way.
I am going to convert this to PORTDOCS. It will simplify the pkg-plist and make future maintenance easier for you.
the docs need to be in %%DOCSDIR%%, not %%DOCSDIR%%-2.0.0 I see no reason to have versioning on sams2 documents especially when only one version of sams2 is going to be on the system at the time.
These files aren't getting installed: %%APACHEETCDIR%%/doc4%%AP_NAME%%.conf %%APACHEETCDIR%%/doc4%%AP_NAME%%.conf-e %%APACHEETCDIR%%/%%AP_NAME%%.conf %%APACHEETCDIR%%/%%AP_NAME%%.conf-e Why are they here? Is it apache 2.2 only?
okay, hold on, it's in the stage directory but wasn't installed. Checking further.
what's the point of .conf and .conf-e ? --- doc4sams2.conf-e 2014-08-24 10:08:11.000000000 +0000 +++ doc4sams2.conf 2014-08-24 10:08:11.000000000 +0000 @@ -3,7 +3,7 @@ # to be accessed at http://localhost/sams2/ # -Alias /sams2/doc __DOCPREFIX +Alias /sams2/doc /usr/local/share/doc/sams2 <Location "/sams2/doc"> Options Indexes --- sams2.conf-e 2014-08-24 10:08:11.000000000 +0000 +++ sams2.conf 2014-08-24 10:08:11.000000000 +0000 @@ -3,7 +3,7 @@ # to be accessed at http://localhost/sams2/ # -Alias /sams2 __WEBPREFIX +Alias /sams2 /usr/local/share/sams2 <Location "/sams2"> Options Indexes It seems to me that conf-e shouldn't be installed at all, and conf should really be conf.sample (installed with @sample) Right?
BIG QUESTION: You are installing this in %%DATADIR%% shouldn't it be installed in %%WWWDIR%% ?
another question, are the apache24 files installed when sams2 is build on apache22 ? If not, shouldn't these be conditional in the pkg-plist?
> It seems to me that conf-e shouldn't be installed at all, and conf should > really be conf.sample (installed with @sample) > > Right? I think yes. > BIG QUESTION: > > You are installing this in %%DATADIR%% > shouldn't it be installed in %%WWWDIR%% ? It is from make makeplist. Anyway it is installing in correct paths. Should it be fixed? > another question, are the apache24 files installed when sams2 is build on > apache22 ? If not, shouldn't these be conditional in the pkg-plist? If there is already apache22 in system apache24 will not be installing.
(In reply to Roman from comment #46) > > You are installing this in %%DATADIR%% > > shouldn't it be installed in %%WWWDIR%% ? > It is from make makeplist. Anyway it is installing in correct paths. Should > it be fixed? make makeplist creats the list from where it got installed. That doesn't mean it got installed in the correct spot for FreeBSD. I don't think it did. I'll have to override the location just like I had to for the docsdir. > > another question, are the apache24 files installed when sams2 is build on > > apache22 ? If not, shouldn't these be conditional in the pkg-plist? > If there is already apache22 in system apache24 will not be installing. Well then the port will fail to install in that case because you don't have a conditional switch. I'll have to fix that too.
I'm going to leave it in %%DATADIR%%. I'm not sure that %%WWWDIR%% is correct in this case.
You trusted "make makeplist" way too much. There are many %%AP_NAME%% variables that are completely incorrect. They should be hardcoded "sams2", not a variable. The lesson is: The warning at the top of the resulting plist says not to use the plist as given, but to review and edit it. You used it without changing it and that was a mistake.
look at this post-install message: *********************************************************************** * INSTALL COMPLETE * *********************************************************************** Add following into httpd.conf: Alias /sams2 /usr/local/share/sams2/ restart httpd, and point your browser to http://yourserver/sams2 why would http://yourserver/sams2 work if you don't install it in %%%WWWDIR%%?
ack, your pkg-message is also hardcode to /usr/local. <---- don't do that
(In reply to John Marino from comment #50) > > Alias /sams2 /usr/local/share/sams2/ > > restart httpd, and point your browser to http://yourserver/sams2 > why would http://yourserver/sams2 work if you don't install it in > %%%WWWDIR%%? Because of Alias, above. (In reply to John Marino from comment #51) > ack, your pkg-message is also hardcode to /usr/local. <---- don't do that Didn't get it, hardcoded where?
(In reply to Roman from comment #52) > (In reply to John Marino from comment #50) > > > > Alias /sams2 /usr/local/share/sams2/ > > > > restart httpd, and point your browser to http://yourserver/sams2 > > why would http://yourserver/sams2 work if you don't install it in > > %%%WWWDIR%%? > Because of Alias, above. > > (In reply to John Marino from comment #51) > > ack, your pkg-message is also hardcode to /usr/local. <---- don't do that > Didn't get it, hardcoded where? You can't assume this is installed in /usr/local. That's only the default. It could be anything. I was in the process of shifting it to www/sams2 Wouldn't it be better there? Your instructions are apache-specific no? what about other webservers?
Okay, it's building and installing cleanly in %%WWWDIR%% If you agree that's okay, then the only thing left to do is modify the pkg-message to: "point your browser to http://yourserver/sams2" The http server doesn't need to be restarted, no conf changes are needed. The pkg-message doesn't even need variables. What do you think?
(In reply to John Marino from comment #54) > Okay, it's building and installing cleanly in %%WWWDIR%% > > If you agree that's okay, then the only thing left to do is modify the > pkg-message to: > > "point your browser to http://yourserver/sams2" > > The http server doesn't need to be restarted, no conf changes are needed. > The pkg-message doesn't even need variables. > > What do you think? Yes, seems all right.
FYI, I used MAKE_ARGS to fix the directories because CONFIGURE_ARGS wasn't working. I just realized that is because you overrode the configure target but incompletely, thus breaking CONFIGURE_ARGS. I think I'm going to fiddle with this a bit more to restore configure.
makefile.cvs is calling a bunch of autotools that weren't specified. It's probably not even needed, we probably only need to specify them with USE_AUTOTOOLS
this is frustrating. If I do the configure properly, it won't build. Only your hacky way works. That indicates sams2 makefile stuff isn't quite current. I'm tired off wasting so much time on this so I'm probably going to keep your way.
I'll commit this when I get back. The configure script says it knows --docdir but it doesn't. The configure system is kind of messed up. I had to hack docdir with MAKE_ARGS.
A commit references this bug: Author: marino Date: Sun Aug 24 16:12:52 UTC 2014 New revision: 365952 URL: http://svnweb.freebsd.org/changeset/ports/365952 Log: Add new port www/sams2 PR: 192587 Submitted by: Roman Modified by: marino SAMS (Squid Account Management System) is a WEB-based interface and tool to manage users of SQUID proxy server. Main features are: * manage users access to SQUID - proxy with NTLM, NCSA authorization or IP address * manage prohibition of users to access to URL * manage to rewrite requested URL to graphical resources (banners, counters) * save and build reports of users statistic * switch of users access to SQUID proxy if his traffic quota is off * manage a delay pools for users groups Changes: head/www/Makefile head/www/sams2/ head/www/sams2/Makefile head/www/sams2/distinfo head/www/sams2/files/ head/www/sams2/files/sams2 head/www/sams2/files/sams2.conf.sample.in head/www/sams2/pkg-descr head/www/sams2/pkg-message head/www/sams2/pkg-plist
The issues with the configure script were very annoying and cost me a lot of time. I made a lot of changes but it builds cleanly with stage-qa. I hope it's what you want and need.
Hi, John. Great job, thanks. Strange, it's claiming that require apache24, but that's not true.
(In reply to Roman from comment #62) > Hi, John. > Great job, thanks. > Strange, it's claiming that require apache24, but that's not true. No, it sames it requires apache. However, that means apache24 unless you explicitly put apache22 in your make.conf That's your line. I didn't add it.
(In reply to John Marino from comment #63) > (In reply to Roman from comment #62) > > Hi, John. > > Great job, thanks. > > Strange, it's claiming that require apache24, but that's not true. > > No, it says it requires apache. However, that means apache24 unless you > explicitly put apache22 in your make.conf > > That's your line. I didn't add it. I also don't think it should have apache hardcoded. Do you want to convert this to options? for example, have a non-default option to add apache dependency?
> I also don't think it should have apache hardcoded. Do you want to convert > this to options? for example, have a non-default option to add apache > dependency? Yes, that would be better.
damn it. Sams is morphing the install depending on if it detects a webserver. It could do different things with conf/conf-e depending on what it finds.
FYI: (I really never want to see this port again, I spent another 2 hours on it) Author: marino Date: Mon Aug 25 19:49:16 2014 New Revision: 366141 URL: http://svnweb.freebsd.org/changeset/ports/366141 QAT: https://qat.redports.org/buildarchive/r366141/ Log: www/sams2: Fix some issues, especially apache22 There were a number of issues with the first version of sams2. The pkg-plist still had a bad "make makeplist" variable ("24" was wrongly converted to %%APACHE_VERSION%%). There was also a typo on a PLIST substitution but this has been completely removed. This port was converted to options, particularly the APACHE option was added as a non-default option. If selected, it will require the default version of Apache as a dependency and install sample apache conf files. Previously the port would scan the whole system and install conf files in different locations depending on what it found. Now the conf file creation is carefully controlled. Discussed with maintainer.
Created attachment 146297 [details] sams2.shar fixed SQUIDLOGDIR
(In reply to John Marino from comment #67) > FYI: (I really never want to see this port again, I spent another 2 hours > on it) Sorry to hear that, hope it isn't my fault mainly. Fixed minor issue with SQUIDLOGDIR.
I can't use this. "shar" is only for the initial port. After that you submit patches. It also really needs to be a new PR, but I'll accept a patch on this one.