Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 452916

Summary: net-misc/stargazer - Stargazer billing system for small home and office networks.
Product: Gentoo Linux Reporter: Vladimir Pavljuchenkov (SpiderX) <spiderx>
Component: New packagesAssignee: Vladimir Pavljuchenkov (SpiderX) <spiderx>
Status: RESOLVED FIXED    
Severity: enhancement CC: gentoo, sergey.gnativ, tomwij
Priority: Normal Keywords: EBUILD, PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: ebuild for stargazer
patches, mans, logrotate, init-scripts for ebuild
metadata for ebuild
patches, mans, logrotate, init-scripts for ebuild
updated ebuild for stargazer
really updated ebuild
patches, mans, logrotate, init-scripts for ebuild
updated ebuild
patches, mans, logrotate, init-scripts for ebuild
ebuild for stargazer

Description Vladimir Pavljuchenkov (SpiderX) 2013-01-19 09:24:31 UTC
Created attachment 336104 [details]
ebuild for stargazer

Stargazer is a powerful (inter)net billing system, capable of gathering traffic statistics from many sources (such as NetFlow protocol, ethernet packets capture, or IPQ subsystem), managing and billing user accounts according to specified fees and rules (including time-based rules, traffic source/destination rules and a payoff system). The current stable release is Stargazer 2.408.

Stargazer Homepage: http://stg.dp.ua/ (in russian)
Ebuild repo on bitbucket: https://bitbucket.org/SpiderX/ebuilds
Comment 1 Vladimir Pavljuchenkov (SpiderX) 2013-01-19 09:27:52 UTC
Created attachment 336108 [details]
patches, mans, logrotate, init-scripts for ebuild
Comment 2 Vladimir Pavljuchenkov (SpiderX) 2013-01-19 09:28:38 UTC
Created attachment 336110 [details]
metadata for ebuild
Comment 3 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-01-19 13:36:00 UTC
1. Typo s/Stargtazer/Stargazer/ in "DESCRIPTION"
2. Some of the patches might benefit being put together, for instance the path patches.
3. Can't you call configure with the module options instead of "sed -i 's/authorization\/ao//'"? Just double checking...
4. "emake" should probably not be in "src_configure".
5. Since you use the authorization -> ao mapping twice, you might be able to create a mapping in the beginning and loop through that twice.
6. Is it possible to avoid generation of static libs through configure or a simple patch? ("use static-libs || find "${D}" -name '*.a' -exec rm -f {} +")
Comment 4 Vladimir Pavljuchenkov (SpiderX) 2013-01-19 19:00:23 UTC
Created attachment 336152 [details]
patches, mans, logrotate, init-scripts for ebuild

Thank you for reply!
1. Fixed. Thanks.
2. Indeed. I've merged stg-2.408-makefile-rscriptd.patch, stg-2.408-makefile-sgauth.patch, stg-2.408-makefile-stargazer.patch into stg-2.408-makefile.patch; and stg-2.408-rscriptd.conf.patch, stg-2.408-sgconv.conf.patch, stg-2.408-stargazer.conf.patch, stg-2.408-mod_remote_script.conf.patch, stg-2.408-store_files.conf.patch, stg-2.408-store_firebird.conf.patch, stg-2.408-rpcconfig.cpp.patch, stg-2.408-00-base-00.sql.patch into stg-2.408-correct-paths.patch.
3. Unfortunately, no. As you can see build system in stargazer is not "autotools compliant", and only options it has is "debug".
4. Is it really-really necessary? Since stargazer has a custom build system, lots of problems come in separating "configure sources" and "compiling sources".
Configure section of stargazer build system for every project produces different libs, it is not safe to separate configuring and compiling.
Repoman gives no QA Notice about emake in src_configure, emerge too.
5. Did not understand what you mean. I use 'ao' in: use module_auth_always_online   || sed -i 's/authorization\/ao//' "${S}"/projects/stargazer/configure, because module always online is placed in directory ao.
Can you provide some example of what you mean?
6. "Configure", as I mention above, has only one option - debug. Patch is provided - stg-2.408-static-libs.patch. I think, patch is simple enough :)
Comment 5 Vladimir Pavljuchenkov (SpiderX) 2013-01-19 19:01:24 UTC
Created attachment 336154 [details]
updated ebuild for stargazer
Comment 6 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-01-19 19:46:25 UTC
(In reply to comment #4)

> 2. Indeed. I've merged stg-2.408-makefile-rscriptd.patch,
> stg-2.408-makefile-sgauth.patch, stg-2.408-makefile-stargazer.patch into
> stg-2.408-makefile.patch; and stg-2.408-rscriptd.conf.patch,
> stg-2.408-sgconv.conf.patch, stg-2.408-stargazer.conf.patch,
> stg-2.408-mod_remote_script.conf.patch, stg-2.408-store_files.conf.patch,
> stg-2.408-store_firebird.conf.patch, stg-2.408-rpcconfig.cpp.patch,
> stg-2.408-00-base-00.sql.patch into stg-2.408-correct-paths.patch.

Sounds good, you forgot to replace the lines in the ebuild with the new patch.

> 4. Is it really-really necessary? Since stargazer has a custom build system,
> lots of problems come in separating "configure sources" and "compiling
> sources".

As these are different directories, configuring something in one directory won't affect the other one, right? I was thinking about copying that for loop to src_compile and then in src_configure remove the make and in src_compile only keep the make.

> Configure section of stargazer build system for every project produces
> different libs, it is not safe to separate configuring and compiling.
> Repoman gives no QA Notice about emake in src_configure, emerge too.

Hmm, seems something worth reporting, might look into this.

> 5. Did not understand what you mean. I use 'ao' in: use
> module_auth_always_online   || sed -i 's/authorization\/ao//'
> "${S}"/projects/stargazer/configure, because module always online is placed
> in directory ao.
> Can you provide some example of what you mean?

Occurence 1 near the beginning:

	use module_auth_always_online	|| sed -i 's/authorization\/ao//' "${S}"/projects/stargazer/configure

Occurence 2 near the end:

	use module_auth_always_online	&& doins "${S}"/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ao.conf

I was thinking you could generate these lines through a loop, by using a hash table. Look at http://stackoverflow.com/questions/1494178/how-to-define-hash-tables-in-bash for an example.
Comment 7 Vladimir Pavljuchenkov (SpiderX) 2013-01-19 22:29:01 UTC
Created attachment 336180 [details]
really updated ebuild

> Sounds good, you forgot to replace the lines in the ebuild with the new patch.

Sorry, I've mistakenly replaced old ebuild with the same old ebuild.
Now done it right.

> As these are different directories, configuring something in one directory won't affect the other one, right?

Not exactly.
All projects use same /stglibs dir.

>  I was thinking about copying that for loop to src_compile and then in src_configure remove the make and in src_compile only keep the make.

That's will not work. Some projects will be failed on compile.

> I was thinking you could generate these lines through a loop, by using a hash table. Look at http://stackoverflow.com/questions/1494178/how-to-define-hash-tables-in-bash for an example.

Good idea. Did it.
Comment 8 Vladimir Pavljuchenkov (SpiderX) 2013-02-03 16:37:40 UTC
Created attachment 337812 [details]
patches, mans, logrotate, init-scripts for ebuild

1. Fixed bug introduced with hash table using:
sed -i 's/${MODULES[$i]%:*}//' -> sed -i "s/${MODULES[$module]%:*}//"
2. Fixed QA Notice: Pre-stripped files found:
Removed all 'install -s' in patch stg-2.408-makefile.patch
3. src_compile() section reverted back to src_configure() (it happened accidentally)
Comment 9 Vladimir Pavljuchenkov (SpiderX) 2013-02-03 16:39:33 UTC
Created attachment 337816 [details]
updated ebuild

updated ebuild
Comment 10 Vladimir Pavljuchenkov (SpiderX) 2013-02-22 17:46:22 UTC
Created attachment 339730 [details]
patches, mans, logrotate, init-scripts for ebuild
Comment 11 Vladimir Pavljuchenkov (SpiderX) 2013-02-22 17:47:20 UTC
Created attachment 339732 [details]
ebuild for stargazer

Added patch stg-2.408-fix-crash-on-stop.patch
Comment 12 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-02-23 20:14:45 UTC
+*stargazer-2.408 (23 Feb 2013)
+
+  23 Feb 2013; Tom Wijsman <TomWij@gentoo.org> +files/logrotate,
+  +files/mans/rscriptd.8, +files/mans/sgauth.8, +files/mans/sgconf.1,
+  +files/mans/sgconf_xml.1, +files/mans/sgconv.1, +files/mans/stargazer.8,
+  +files/patches/stg-2.408-build-upstream.patch,
+  +files/patches/stg-2.408-build.patch,
+  +files/patches/stg-2.408-correct-paths.patch,
+  +files/patches/stg-2.408-fix-crash-on-stop.patch,
+  +files/patches/stg-2.408-makefile-build-upstream.patch,
+  +files/patches/stg-2.408-makefile-firebird-upstream.patch,
+  +files/patches/stg-2.408-makefile.patch,
+  +files/patches/stg-2.408-on-upstream.patch,
+  +files/patches/stg-2.408-radius-upstream.patch,
+  +files/patches/stg-2.408-rscriptd-upstream.patch,
+  +files/patches/stg-2.408-rscriptd.conf-upstream.patch,
+  +files/patches/stg-2.408-sgauth.conf-upstream.patch,
+  +files/patches/stg-2.408-sgconv-upstream.patch,
+  +files/patches/stg-2.408-static-libs.patch, +files/rscriptd, +files/sgauth,
+  +metadata.xml, +stargazer-2.408.ebuild:
+  New ebuild for stargazer. Contributed by SpiderX. Fixes bug #452916.