summaryrefslogtreecommitdiff
path: root/net-misc/stargazer
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/stargazer')
-rw-r--r--net-misc/stargazer/Manifest28
-rw-r--r--net-misc/stargazer/files/logrotate9
-rw-r--r--net-misc/stargazer/files/mans/rscriptd.851
-rw-r--r--net-misc/stargazer/files/mans/sgauth.854
-rw-r--r--net-misc/stargazer/files/mans/sgconf.1160
-rw-r--r--net-misc/stargazer/files/mans/sgconf_xml.179
-rw-r--r--net-misc/stargazer/files/mans/sgconv.142
-rw-r--r--net-misc/stargazer/files/mans/stargazer.864
-rw-r--r--net-misc/stargazer/files/patches/stg-2.408-build-upstream.patch214
-rw-r--r--net-misc/stargazer/files/patches/stg-2.408-build.patch179
-rw-r--r--net-misc/stargazer/files/patches/stg-2.408-correct-paths.patch186
-rw-r--r--net-misc/stargazer/files/patches/stg-2.408-fix-crash-on-stop.patch190
-rw-r--r--net-misc/stargazer/files/patches/stg-2.408-makefile-build-upstream.patch386
-rw-r--r--net-misc/stargazer/files/patches/stg-2.408-makefile-firebird-upstream.patch13
-rw-r--r--net-misc/stargazer/files/patches/stg-2.408-makefile.patch203
-rw-r--r--net-misc/stargazer/files/patches/stg-2.408-on-upstream.patch151
-rw-r--r--net-misc/stargazer/files/patches/stg-2.408-radius-upstream.patch31
-rw-r--r--net-misc/stargazer/files/patches/stg-2.408-rscriptd-upstream.patch26
-rw-r--r--net-misc/stargazer/files/patches/stg-2.408-rscriptd.conf-upstream.patch80
-rw-r--r--net-misc/stargazer/files/patches/stg-2.408-sgauth.conf-upstream.patch112
-rw-r--r--net-misc/stargazer/files/patches/stg-2.408-sgconv-upstream.patch40
-rw-r--r--net-misc/stargazer/files/patches/stg-2.408-static-libs.patch10
-rw-r--r--net-misc/stargazer/files/rscriptd23
-rw-r--r--net-misc/stargazer/files/sgauth27
-rw-r--r--net-misc/stargazer/metadata.xml54
-rw-r--r--net-misc/stargazer/stargazer-2.408.ebuild558
26 files changed, 2970 insertions, 0 deletions
diff --git a/net-misc/stargazer/Manifest b/net-misc/stargazer/Manifest
new file mode 100644
index 000000000000..38d6ff9e0aff
--- /dev/null
+++ b/net-misc/stargazer/Manifest
@@ -0,0 +1,28 @@
+AUX logrotate 130 SHA256 aa61e339247685708af8661f82e02b9312f733a1b4f3662e79868c95b92f53e9 SHA512 bc6b186ac83fdfdbd26c75fbef6a350e7e3af0b106082cebc4001512b07be501326df23bc260846453b1bb322e8a08abc2a1b111982c71edf1df5c05cb394790 WHIRLPOOL 158eaf9ed5595a101d96922c7f8fe734548019f41eaffe9077e23f404bc0927675556b3390b4765fb44a1f4661ee23dbf33f827e6f7ece56a0031b9b89d6384f
+AUX mans/rscriptd.8 1057 SHA256 2858cd9ecebe64b352809a92c2b1228aa761f5b1ddce035161d6a832e74984bc SHA512 2afbd834aceb273a7574012bae43881d9918247524c96a1f60fa31cdc4331757a0e345432155d83a21a21a7c37f494984c175a282f4b16e4f1fb2882754676bc WHIRLPOOL 3fc0a8e7b68f673188b2737ce2fd4c6f67012bb53a83f004e946cd9ea91482656c300dd88c0ff0ed9878a1cd5e3682f03803a0eb4b1f24f1f70c4df0ce6d9c6e
+AUX mans/sgauth.8 1146 SHA256 261ed5b23e4cda616e200fbf08aa232a3f9aeff115992ff0539e67c717f146b8 SHA512 724ce9ed66abe53b9c22db273e04e372663d958bb8a70938baa88f844410f7eccaaf3b95515f2d24189b6b93711f26d2588758ffd2cdf8116631c092d18d72c2 WHIRLPOOL 92148933eef8d0076043907f4e1cd7155dcc28ef2c9a1edbbc72ce39c79e84e55d67b55c1edd7d4b25212f6ae2d39830b81854ec16df3539e79c1a548f31662c
+AUX mans/sgconf.1 2870 SHA256 be35cebafe115fea1b43ba51394f5c73d7c5f706776290630b3ea4ebdc25ac65 SHA512 5ae47adf857d52ee339937cf2ef892602ae513037358470fb87ae682397fe4321ef15d03211d384020c06af3488dc868f5be8ccdaec5b3ad2bea446a8c939776 WHIRLPOOL 258b7a7efb68d2f1fda1e0c719423b15ba104d6ce60f6dbacee5220edc0891f0c24c47e7c9df6cbb5aef193501ee0f33f7a3f2640d66f538d9169e228a4fc15b
+AUX mans/sgconf_xml.1 1527 SHA256 d3b4c006137182c693679e3277e5f0991355868a68a6a3036d636b49f7922638 SHA512 db79a12955865955022a1cdeef1c6496f9c4232b1cac972f3c8bfdf7aff503f206d3b177961357bcaa14a60426b06bd49ffe8601fc57bbf2c00dd2bea890da75 WHIRLPOOL 3b2575457a445a0b9107957a8f46ea5722c1c4e11c9e00b56bbe59555ef328dc8e1c8ddabbec583ad0aa816b0dbbcb52b37f4de50eafb62e86e76cb5f6c8ac44
+AUX mans/sgconv.1 892 SHA256 9b6e7b52b0d051fb5a0a44c0fb8c7f2e70a1f240a61bc71d25e6d98aa64fd5fe SHA512 de6ff8c3569a5aba6690539a2c523833200e732777c1b7e9325b4e518ca1cb72906325fb4ea58c2abd0ce80bb0bf5c55f564cc31cbd122c93d8528d2e3a033e8 WHIRLPOOL a2ec524e388ea2a0b5e3aea60fb7add256e15db57572f376fd12e56b0fb7c1d38ade2772a6011598894126a68c08377eeb9665c0bccab850fe5b6d73221830d0
+AUX mans/stargazer.8 1394 SHA256 4e0c1e7f16d3de50de0299b1013f9cba7472b1f334a542c50539d754d7309d6e SHA512 6c69970f0dfee31f1a9d68ee784a54f169b2ba272a10bb3f3be139407d374fd8d8d5e9e37c4d1e3091c85c22cd84ed7235894cd5f678614017111b6175e08e89 WHIRLPOOL 7251a461b07eb3bbd4d030992b6c293a49504919379f47273f32ef17f140efc0cbc8a520d3852fb2e6b6caf0decc98c5d4b42b2ed397c94e510bf5f802ba2104
+AUX patches/stg-2.408-build-upstream.patch 4759 SHA256 f9bfcb79a678bdc647ad840673f1da9be85e61608ff419fe53e17f283b33e31e SHA512 76cd10b98db0c70f989b5f498a13c7baacac3e2a0b6bc0b1449d34789a94317b2576bfb96d48ee567480ce98783c758920a7f3004990f487592fc8a7e8bcd7df WHIRLPOOL 1b7de2fe1fffc79a17da199285cbb949fa924abf78ebb791f2c2499f6b4e159becfb4943232c8403d38e23085db44238a7658bac124e2daef580cbf357d4a064
+AUX patches/stg-2.408-build.patch 4220 SHA256 d5bab39ee070d245a5e8860d3131848a06d44ee2496f2da900d6a61c34922439 SHA512 98b3824b379aa8c9febf4e0907135ad072844cfea63541e3384e99cd47f6d0a9457e376d1658fb146196ea6ee397dcf7e715abb9bb1a279d209866735974448f WHIRLPOOL ec000b4f6a0583f1707ffa7818925b223f6ddf5c2936d901808263bb439f95e74643300b51a175d3a9222e12659b07f2796e5be026230c9b80547cd916794605
+AUX patches/stg-2.408-correct-paths.patch 6489 SHA256 ad173a7cb322de0ac1f31ccfec95ec4abcbf3361207f95fbfe9c4185a06dc173 SHA512 e400b4d5ba4bb7305557aaba29fae7415d8bde0343a695ac7e979839549b843cf90a0d19e598f050d08282d717ed3b46e4e5572d4be6b295ce88e962ac6966d3 WHIRLPOOL e665ab3af671b9b5abe54e3874af11b93cd1b9f4c90605d457d8b64d4e0d2d72baf61c55d4ad1556510bd8bb51c220b0c3c99388bc06b151b0e430d68d8ac5f7
+AUX patches/stg-2.408-fix-crash-on-stop.patch 6125 SHA256 d015c4d19f33b2fb84c0d325d45662f2a4c5f2a9c84fc9f9382f08071b28ab9f SHA512 efa0345eafaffc8fd3efa78dfe511987b4fc8990446339b797f3ffaf0dad2f44b061baba390ee4f22232bbb8a8cd785a7ea5062377afb92c4287dbde9df7523b WHIRLPOOL cddf720e4555ad56d4240842f42401fbfb6989b7d3fc099234835c10464bee8fd4cd37d9caaacffa211ac47a4e77317ee3068b1c243392e54c80db53cc77eb9e
+AUX patches/stg-2.408-makefile-build-upstream.patch 11266 SHA256 433bb4118fab97a59e58b7299f21e5f41df5762b7b9cf8698629748f8ca4f95c SHA512 722be9686fdcd1b979d3a303c088c6b1567fe6288609696a47cf2677280244fee2345c6f31b0caecd73d7bc4a423e0dfd2cd73f53a795137adc18bfc6ec97d3e WHIRLPOOL 2d4ab114051aefa47ee1c56cb6947c0dfbb7731361936707533b8a561342c2ee255a06fa5ec7f30bfc2b46203a4e6508a10a6f02f774306b5b8bf3b3de749559
+AUX patches/stg-2.408-makefile-firebird-upstream.patch 396 SHA256 9262bb643034aa9dacb3cfcac44761a100709cd8d5cd0d771b5c95a91a53b83a SHA512 c7a3cf5a4f9ace4aa7293c56530207827b390aed6aee7cafd38ca50502c47ade22020dbdc096dea3971551f0507910f8d5051dee7ba4d7fc14366cb2f765de76 WHIRLPOOL ac01b4a191276970ee9e5126e3a4a649bba248431f24f43b2519ad25ea37950ab92d63d343b718b5ed8db8e65f9b8440a850e5372b8f4ac67bd2aaac04621891
+AUX patches/stg-2.408-makefile.patch 8499 SHA256 0106c2655fa64f8e9a1c02dc7a21e4a2d473f676ba9c33e2ec5cf002e9ec3c6d SHA512 5d4ad2104710d3c6a7bd8bc48d8c71c20b68f14aff7017606a028d55003344832d47d9e28853b595581863b4128c312e971cdea260515269d9c8cf1e693dacab WHIRLPOOL a4201cc145161a61477b0fa0d04f548ee7c2103e1a5e3fce95eec07b1bc7aedf4e1f5798b5fb4ca3c255036b711aa93ea82c4cbc5e7b664dc92ccf8519297bab
+AUX patches/stg-2.408-on-upstream.patch 5160 SHA256 b7ece6e7187b8bbfc4ad2f55c30bbf15ecd531b537fdb40b6856b9e133a46bcf SHA512 9b83b8e744b246c391abbaad49226b5ccade1395ce2d6eb8573bd13e3e3d1dcdb4b4611a0625ad5a426d9859b09913c6af050161c739a7a63c24bb7ce71f406b WHIRLPOOL ba6de01f2c72dbc72917351a317c21b852261c44fa55003d503afd57fe0cdae8e0cfc736162206a6e575d76f62d9f9858bb42982cc39bf560e3d882cb1ce2780
+AUX patches/stg-2.408-radius-upstream.patch 861 SHA256 ef147f056236b0fde0a21a567ac4f3c7a83290651a10a57c83e33892036dcafb SHA512 2c59de06ede39e6987d1235fd423e9d42a2d2a0cdcbe291b28c567d1bcd34243753243faedab8e9cf987e7bbb1dabbc2afc2d7757fd50f0f4170c724f16dd4ef WHIRLPOOL 93ce3418a29d746163855a99d371dde7cb6289518540870238bb695119012975ee7c2c2962487e55dee08676b3070c223c71a0a87b2c6e266e7edbf72dffb9fd
+AUX patches/stg-2.408-rscriptd-upstream.patch 1103 SHA256 2204be3eb6cdba6b2452dc178c711d0a456d258c36be911a28d99fb9d92a861d SHA512 397240006551501ec3b8829e967a9191e813f1299abd7108d8effc9c11e9ac048a091f77961c348a7878ffe475af3a612cf82aa9d804d3206411b610191bbde9 WHIRLPOOL 4d308bc68fdca640ef9b57f4361b8829360d1de2764f5a609969134012893e5f509608eb49f8d45ab3d1574b5824ac195cdecc8b467798227b8bf903126530cb
+AUX patches/stg-2.408-rscriptd.conf-upstream.patch 2515 SHA256 be1f4a43e36c7af3760f792028dbc7bdc51c90925ffe106c4263f3d9826b0183 SHA512 4b2da01d05d07e62bc9c5d002c4a7bc190958e59236c03dde49238ac4e23dfc8e4e67a323ac12c2f89872285506614d3bb127cf3f4873df095c1579f441aa73c WHIRLPOOL d006ca65f93aad5fc55a86b01203a5c392547a41f7601dd9bc8aeee678150e54b4c11bbf9d4fa23b1074d4b8029548aaae24907d935f11d50f98dc889d26461e
+AUX patches/stg-2.408-sgauth.conf-upstream.patch 2382 SHA256 778495180f9207a93c528c64afbe7ee576fbdc82a3ae38c36de1e0889d9f0270 SHA512 2875f9b719a2058d435220016bb83b2b30fba9c927b9d1f06b5bfd5149fad213e312106e8de3c1cdedc9c3dd8178d6a1944327f0f9635a57cee329a623946d39 WHIRLPOOL 8ed9902f77e922900744600480f1dc1c00814eaf3815382a717ffacde4448194eb97fa0543cd310cf04127ef232a544e1c44ed66ba41079d6ad3d90a8a93a4a8
+AUX patches/stg-2.408-sgconv-upstream.patch 1542 SHA256 cf607c416cc990b09e4f696915b4170139929b55899aa6942c368c0738385ca3 SHA512 bc25e9b682ae33ceec30edef35c62e90fc24cdd8c891397193c2aa041557f7e7071abe998ec77291401953899da4a817a269e825be5b5cb552e83c34ac026d70 WHIRLPOOL f613346d461d3f1227645cb13e92014778fe5658def366f4603ff20cca33cdae050d257aad302cb010ffaa19c9ce76da92ab783b840186d019a615521500da5d
+AUX patches/stg-2.408-static-libs.patch 194 SHA256 6e1cd7b76a266335bd49b00decd72f799e77eb5c6baefbfab291a4eb621c68d9 SHA512 f6961a429bf4c23ec17935a8568acfccdcecb7e646aa6a607177cbf95fd20b6169d17713e8a0649ff164eb5b34c11bebe94cd252ccdac8577025859aa2c0fca9 WHIRLPOOL 96d320406c8e11462a1e43e62aceb7ca56a3b147697951e7c53dbf675149814ade10e142b97f0bf23842730646ed9bcb6845b27b36c720b8425b8a23f7f8ea7e
+AUX rscriptd 453 SHA256 c47c6fb356207f97cd73cfa5be132a2d35ee26eefa57ae3809223bc927ad1636 SHA512 21cb21a5a14901f3b370f2cedb6ede9414c1080d3d4e073ed048f005f40622179cd91e8cf80f609f0a7b5cacecff5f15913a5cf954dfff56ad036649f4a0a48f WHIRLPOOL fb142b12339ece7e1a3a7ff10f2050bf89b33b281283a428e56203828307204a40fe8f0b03ed80272ddfe0efe588a515c4ff2f7270ba005000ad1cc1a1256c2e
+AUX sgauth 462 SHA256 5a03f047433a8b4a81494f831975a7d851f7dff93d31d57e9f03c11e33ac70dc SHA512 a2d6ba8c2200095072a73342fab4cb5706470d52d9dc6a57f023b16dc895957d4377bc089a4a3cd57126bc9628020c2c1bb60347758e53576eccbc0c854c2364 WHIRLPOOL 4410375712f6c30a17d22fb11a9d29184ee28a45c772b86dba5ea4397a93835e110ec0a83360f79343a5aab2aa269fcaa47275f1ac01564ab2608fc3e6233c94
+DIST stg-2.408.tar.gz 5100291 SHA256 f2de88cba1a07b10dba266df262ba719cdeb8efc169ce52711519d81b3c36fc1 SHA512 200e08cfd629dbacda31ffd3134c2908a1ad58604421cc288ad0ec1bdcd60fe021d51fed50fdc2517bb7c2b61ef23b0b9c71a606babd09bc7804cb899e0b7f75 WHIRLPOOL 3701d0bf16e06dc61474a772566a570a21d04fcf5ac5c28fb61b454f21c1471adc6f45645c3929b3ed15bb33eee10425a942b25f83ea7b3ea94eb15b80df7dad
+EBUILD stargazer-2.408.ebuild 19983 SHA256 bdadacbf2c678682e5bd8cc2531b43076188e16a172e14cb4ea6bc0d127152ad SHA512 a385d94e92c6407230dbe57f23830f19561561625d97d5c1c0d3c8db533693aa1241b84c509e4bab25d83bc3965a2dbbaa7e862a6a5eccb45eeb6a9fd705fc70 WHIRLPOOL 39a573a08712aa0349c79c60ed57ef3e61ddd1ffc83fa5cdfa80c46e7e2a747a0f9d5b4be4a6315f6101fec1f5ea291ec06e736539bad8bbf2ca77521c18d54d
+MISC ChangeLog 3869 SHA256 10b625447869fa336a94c2d60d255c2d4c3d08bcfb192e351bcc43a3993aa44a SHA512 5166111b4c3c73bd7c9181e10c198f590e06e0392d3b95eec4e52d049a2ebfb26cb96dd416aa3793a68f19c02c4873be2b186a7ccb98f9d1851b06945667d550 WHIRLPOOL 9818853d42418735ee85ef293d4459f3ad7e9aa04b59b69ea3290cb857085ae1ac48bd3dde51c5cce1cd5728f8f5a2383a36d53c0aefdee0dbe01abb2135ead2
+MISC ChangeLog-2015 2538 SHA256 3bec8395849706b23a0cee4564c9d940f9ed8e1a1a6c88c5ed429a683cde24e9 SHA512 2ac7c82473237d2ae9f7d6cc7a2c4c52c344c193ab254cc9e84b76529cf439ab7cb1d293573c98cae90513b6e0c7dad1581a9104e01d4c57e81b85d1daefde0d WHIRLPOOL 41a80aeafae8ec3e61c79316fbf5a736f7a1f82d840d002abd47949da9f9e1341d89e33ee543d00848f55574fb78bbca59c31448ca2e8590121404cdae23d84e
+MISC metadata.xml 4496 SHA256 557972b89248589b4ddfb7f0b0a2322e6c2797c905617572e977103dc0262dda SHA512 c5a2a3acd3b605a8108734fa620df6f26d7f693e99986961eff1dde3c0fff84638568d48f9f666b254c6d29e9f78e642387375d94b0cd69ec1eeae2cd3d0ab32 WHIRLPOOL 437e60a634e732576bb8928fb60e643ac206643dcf2f0855be8eb74d36b7584a98dbb24a36701316f35da8ef5119a512b2b9e01959f73c45fa99c0b6705c0aa5
diff --git a/net-misc/stargazer/files/logrotate b/net-misc/stargazer/files/logrotate
new file mode 100644
index 000000000000..ffa9c23f3012
--- /dev/null
+++ b/net-misc/stargazer/files/logrotate
@@ -0,0 +1,9 @@
+/var/log/stargazer/*.log {
+ daily
+ rotate 31
+ compress
+ missingok
+ notifempty
+ copytruncate
+ sharedscripts
+}
diff --git a/net-misc/stargazer/files/mans/rscriptd.8 b/net-misc/stargazer/files/mans/rscriptd.8
new file mode 100644
index 000000000000..440f7b0267b1
--- /dev/null
+++ b/net-misc/stargazer/files/mans/rscriptd.8
@@ -0,0 +1,51 @@
+.TH rscriptd 8 "December 31, 2012" "" "rscriptd"
+
+.SH NAME
+rscriptd \- a remote script execute daemon for Stargazer
+
+.SH SYNOPSIS
+.B rscriptd
+.RI [ config-file ]
+.br
+
+.SH DESCRIPTION
+The
+.B rscriptd
+daemon typically runs on a last-wire router before users and
+manages firewall rules to allow/disallow users get their services.
+.B rscriptd
+communicates with
+.B Stargazer
+main daemon by UDP protocol.
+
+.SH OPTIONS
+.TP
+.I config-file
+Path to rscriptd configuration file. Default is
+.B
+/etc/rscriptd/rscriptd.conf
+
+.SH FILES
+.B
+/usr/sbin/rsriptd
+.br
+.B
+/etc/stargazer/rscriptd.conf
+.br
+.B
+/var/log/stargazer/rscriptd.log
+
+.SH SEE ALSO
+.BR sgconf (1),
+.BR sgconf_xml (1),
+.BR sgconv (1),
+.BR sgauth (8),
+.BR stargazer (8).
+
+.SH AUTHOR
+rscriptd was originally written by Boris Mikhailenko <stg34@stargazer.dp.ua> and
+Maxim Mamontov <faust@stargazer.dp.ua>.
+.PP
+This manual page was written by Alexey Osipov <simba@lerlan.ru>,
+for the Debian project (and may be used by others), and was modified by
+Vladimir Pavljuchenkov <spiderx@spiderx.dp.ua> for Gentoo Linux \ No newline at end of file
diff --git a/net-misc/stargazer/files/mans/sgauth.8 b/net-misc/stargazer/files/mans/sgauth.8
new file mode 100644
index 000000000000..24c872761f7e
--- /dev/null
+++ b/net-misc/stargazer/files/mans/sgauth.8
@@ -0,0 +1,54 @@
+.TH sgauth 1 "December 31, 2012" "" "sgauth"
+
+.SH NAME
+sgauth \- a command-line utility for authorization in Stargazer
+
+.SH SYNOPSIS
+.B sgauth
+.RI [ config-file ]
+.br
+
+.SH DESCRIPTION
+.B sgauth
+allow user to become authorized in
+.B Stargazer
+billing system.
+.PP
+.B sgauth
+reads the
+.IR config-file ,
+connects to
+.B Stargazer
+server and authentificates on it using data supplied in
+.IR config-file .
+In addition, it runs a simple http-server on port 5580, capable of
+monitoring and controlling the connection (if specified in
+.IR config-file ")."
+
+.SH OPTIONS
+.TP
+.I config-file
+Path to file containing user login, password and other configuration data. Default is
+.B
+/etc/sgauth.conf
+
+.SH FILES
+.B
+/usr/sbin/sgauth
+.br
+.B
+/etc/stargazer/sgauth.conf
+
+.SH SEE ALSO
+.BR sgconf (1),
+.BR sgconf_xml (1),
+.BR sgconv (1),
+.BR stargazer (8),
+.BR rscriptd (8).
+
+.SH AUTHOR
+sgauth was initially written by Boris Mikhailenko <stg34@stargazer.dp.ua>.
+.PP
+This manual page was written by Alexey Osipov <simba@lerlan.ru>,
+for the Debian project (and may be used by others), and was modified by
+Vladimir Pavljuchenkov <spiderx@spiderx.dp.ua> for Gentoo Linux \ No newline at end of file
diff --git a/net-misc/stargazer/files/mans/sgconf.1 b/net-misc/stargazer/files/mans/sgconf.1
new file mode 100644
index 000000000000..4017d9e59648
--- /dev/null
+++ b/net-misc/stargazer/files/mans/sgconf.1
@@ -0,0 +1,160 @@
+.TH sgconf 1 "December 31, 2012" "" "sgconf"
+
+.SH NAME
+sgconf \- a command-line utility for configuring Stargazer
+
+.SH SYNOPSIS
+.B sgconf
+(
+.I get
+|
+.I set
+)
+.BI \-s " server"
+.BI \-p " port"
+.BI \-a " admin"
+.BI \-w " admin-pass"
+.BI \-u " user"
+.I special-options
+.br
+
+.SH DESCRIPTION
+.B sgconf
+allows
+.B Stargazer
+system administrators to configure users.
+.PP
+.B sgconf
+support two subset of commands -
+.I get
+and
+.IR set .
+.I get
+commands are for reading actual values from
+.B Stargazer
+and
+.I set
+commands are for writing new values to
+.BR Stargazer .
+
+.SH OPTIONS
+.TP
+.BI \-s " server"
+IP or hostname where
+.B Stargazer
+server run.
+.TP
+.BI \-p " port"
+Port, which
+.B Stargazer
+listen for configuration connections (typically 5555).
+.TP
+.BI \-a " admin"
+Administrator login.
+.TP
+.BI \-w " admin-pass"
+Administrator password.
+.TP
+.TP
+.IR special-options " are following:"
+(Use without argument for
+.IR get ")"
+.TP
+.BI \-c " add_cash[:log message]"
+Get user's balance or add money to user's balance with optional log message.
+.TP
+.BI \-v " set_cash[:log message]"
+Set user's balance with optional log message.
+.TP
+.BI \-t " tariff:now|delayed"
+Get/set user's tariff. If
+.I now
+specified, the change is immediate. If
+.I delayed
+specified, the change will happen at end of the month.
+.TP
+.BI \-r " credit"
+Get/set user's maximum credit.
+.TP
+.BI \-o " password"
+Get/set user's password.
+.TP
+.BI \-e " prepaid"
+Get/set amount of user's prepaid traffic.
+.TP
+.BI \-I " *|ip_addr[,ip_addr...]"
+Get/set user's allowed IP addresses. Asterisk mark means "any address".
+.TP
+.BI \-A " name"
+Get/set user's name.
+.TP
+.BI \-N " note"
+Get/set user's note.
+.TP
+.BI \-D " address"
+Get/set user's street address.
+.TP
+.BI \-L " email"
+Get/set user's email.
+.TP
+.BI \-P " phone"
+Get/set user's phone.
+.TP
+.BI \-G " group"
+Get/set group, user belongs to.
+.TP
+.BI \-d " 0|1"
+Get/set user's "down" ("disabled") flag.
+.TP
+.BI \-i " 0|1"
+Get/set user's "passive" ("frozen") flag.
+.TP
+.BI \-\-disable\-stat " 0|1"
+Get/set user's "disableDetailStat" flag.
+.TP
+.BI \-\-always\-online " 0|1"
+Get/set user's "alwaysOnline" flag.
+.TP
+.BI \-\-u "X traffic"
+Get/set user's upload traffic for
+.I X
+service (direction).
+.TP
+.BI \-\-d "X traffic"
+Get/set user's download traffic for
+.I X
+service (direction).
+.TP
+.BI \-\-ud "X userdata"
+Get/set user's
+.I X
+custom data.
+.TP
+.BI \-m " message"
+Send
+.I message
+to user.
+.TP
+.B \-n
+Create new user.
+.TP
+.B \-l
+Delete user.
+
+.SH FILES
+.B
+/usr/bin/sgconf
+
+.SH SEE ALSO
+.BR sgauth (8),
+.BR sgconf_xml (1),
+.BR sgconv (1),
+.BR stargazer (8),
+.BR rscriptd (8).
+
+.SH AUTHOR
+sgconf was initially written by Boris Mikhailenko <stg34@stargazer.dp.ua>.
+.PP
+This manual page was written by Alexey Osipov <simba@lerlan.ru>,
+for the Debian project (and may be used by others), and was modified by
+Vladimir Pavljuchenkov <spiderx@spiderx.dp.ua> for Gentoo Linux \ No newline at end of file
diff --git a/net-misc/stargazer/files/mans/sgconf_xml.1 b/net-misc/stargazer/files/mans/sgconf_xml.1
new file mode 100644
index 000000000000..428fadfd5b18
--- /dev/null
+++ b/net-misc/stargazer/files/mans/sgconf_xml.1
@@ -0,0 +1,79 @@
+.TH sgconf_xml 1 "December 31, 2012" "" "sgconf_xml"
+
+.SH NAME
+sgconf_xml \- a command-line xml-based utility for configuring Stargazer
+
+.SH SYNOPSIS
+.B sgconf_xml
+.BI \-s " server"
+.BI \-p " port"
+.BI \-a " admin"
+.BI \-w " admin-pass"
+(
+.BI \-r " request-string"
+|
+.BI \-f " request-file"
+)
+
+.SH DESCRIPTION
+.B sgconf_xml
+allows system administrators to configure
+.BR Stargazer .
+.PP
+.B sgconf_xml
+uses XML for requests and responses. You can specify a
+file containing XML request by using
+.B \-f
+option, or you can specify XML request directly as a
+string by using
+.B \-r
+option.
+
+.SH OPTIONS
+.TP
+.BI \-s " server"
+IP or hostname where
+.B Stargazer
+server run.
+.TP
+.BI \-p " port"
+Port, which
+.B Stargazer
+listen for configuration connections (typically 5555).
+.TP
+.BI \-a " admin"
+Administrator login.
+.TP
+.BI \-w " admin-pass"
+Administrator password.
+.TP
+.BI \-r " request-string"
+The request in form of XML.
+.TP
+.BI \-f " request-file"
+File containing request in form of XML.
+
+.SH REQUEST SYNTAX
+TODO.
+.br
+As for now you can check an example by running
+.B sgconf_xml
+without arguments.
+
+.SH FILES
+.B
+/usr/bin/sgconf_xml
+
+.SH SEE ALSO
+.BR sgauth (8),
+.BR sgconf (1),
+.BR sgconv (1),
+.BR stargazer (8),
+.BR rscriptd (8).
+
+.SH AUTHOR
+sgconf_xml was initially written by Boris Mikhailenko <stg34@stargazer.dp.ua>.
+.PP
+This manual page was written by Alexey Osipov <simba@lerlan.ru>,
+for the Debian project (and may be used by others), and was modified by
+Vladimir Pavljuchenkov <spiderx@spiderx.dp.ua> for Gentoo Linux \ No newline at end of file
diff --git a/net-misc/stargazer/files/mans/sgconv.1 b/net-misc/stargazer/files/mans/sgconv.1
new file mode 100644
index 000000000000..b5fb225ab064
--- /dev/null
+++ b/net-misc/stargazer/files/mans/sgconv.1
@@ -0,0 +1,42 @@
+.TH sgconv 1 "December 31, 2012" "" "sgconv"
+
+.SH NAME
+sgconv \- an utility to convert Stargazer data between storage backends
+
+.SH SYNOPSIS
+.B sgconv
+.RI [ config-file ]
+
+.SH DESCRIPTION
+.B sgconv
+allows system administrators to copy and merge
+.B Stargazer
+data from one storage backend to another.
+
+.SH OPTIONS
+.TP
+.I config-file
+A path to config file containing convertion parameters. Default is
+.B sgconv.conf
+in current directory.
+
+.SH FILES
+.B
+/usr/bin/sgconv
+.br
+.B
+/etc/stargazer/sgconv.conf
+
+.SH SEE ALSO
+.BR sgauth (8),
+.BR sgconf (1),
+.BR sgconf_xml (1),
+.BR stargazer (8),
+.BR rscriptd (8).
+
+.SH AUTHOR
+sgconv was initially written by Maxim Mamontov <faust@stargazer.dp.ua>.
+.PP
+This manual page was written by Alexey Osipov <simba@lerlan.ru>,
+for the Debian project (and may be used by others), and was modified by
+Vladimir Pavljuchenkov <spiderx@spiderx.dp.ua> for Gentoo Linux \ No newline at end of file
diff --git a/net-misc/stargazer/files/mans/stargazer.8 b/net-misc/stargazer/files/mans/stargazer.8
new file mode 100644
index 000000000000..a1860c5d97b9
--- /dev/null
+++ b/net-misc/stargazer/files/mans/stargazer.8
@@ -0,0 +1,64 @@
+.TH stargazer 8 "December 31, 2012" "" "stargazer"
+
+.SH NAME
+stargazer \- a powerfull billing system daemon
+
+.SH SYNOPSIS
+.B stargazer
+.RI [ config-directory ]
+.br
+
+.SH DESCRIPTION
+This manual page explains the
+.B stargazer
+daemon. This daemon address ISP user accounting and billing problems.
+.PP
+.B Stargazer
+is capable of:
+.PP
+- manage user accounts using several kinds of stores (plain files, MySQL, Firebird,
+PostgreSQL)
+.br
+- gather traffic flow information using several methods (Netflow protocol, rawsocket
+ethernet packets capture, netfilter IPQ capture)
+.br
+- bill user accounts according to rate rules and traffic classification
+.br
+- authentificate and authorize users to get access to the internet
+
+.SH OPTIONS
+.TP
+.I config-directory
+Path to directory containing stargazer configuration files. Default is
+.B
+/etc/stargazer
+
+.SH FILES
+.B
+/usr/sbin/stargazer
+.br
+.B
+/etc/stargazer/
+.br
+.B
+/var/lib/stargazer/
+.br
+.B
+/var/log/stargazer/stargazer.log
+.br
+.B
+/var/log/stargazer/xmlrpc.log
+
+.SH SEE ALSO
+.BR sgconf (1),
+.BR sgconf_xml (1),
+.BR sgconv (1),
+.BR sgauth (8),
+.BR rscriptd (8).
+
+.SH AUTHOR
+stargazer was initially written by Boris Mikhailenko <stg34@stargazer.dp.ua>.
+.PP
+This manual page was written by Alexey Osipov <simba@lerlan.ru>,
+for the Debian project (and may be used by others), and was modified by
+Vladimir Pavljuchenkov <spiderx@spiderx.dp.ua> for Gentoo Linux \ No newline at end of file
diff --git a/net-misc/stargazer/files/patches/stg-2.408-build-upstream.patch b/net-misc/stargazer/files/patches/stg-2.408-build-upstream.patch
new file mode 100644
index 000000000000..c8b73d85a63a
--- /dev/null
+++ b/net-misc/stargazer/files/patches/stg-2.408-build-upstream.patch
@@ -0,0 +1,214 @@
+--- projects/rlm_stg/build.org 2013-01-15 15:25:59.000000000 +0200
++++ projects/rlm_stg/build 2013-01-15 19:48:13.000000000 +0200
+@@ -16,21 +16,15 @@
+ DIR_MODE=0755
+ OWNER=root
+
+-if [ -z $1 ]
+-then
+- MAKEOPTS="-j1"
+- DEBUG="no"
++if [ "$1" = "debug" ]
++then
++ DEFS="$DEFS -DDEBUG"
++ MAKEOPTS="$MAKEOPTS -j1"
++ CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra"
++ DEBUG="yes"
+ else
+- if [ "$1" = "debug" ]
+- then
+- DEFS="-DDEBUG"
+- MAKEOPTS="-j1"
+- CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
+- DEBUG="yes"
+- else
+- MAKEOPTS="-j1"
+- DEBUG="no"
+- fi
++ DEFS="$DEFS -DNDEBUG"
++ DEBUG="no"
+ fi
+
+ CXXFLAGS="$CXXFLAGS -I/usr/local/include"
+--- projects/rscriptd/build.org 2013-01-15 18:28:32.000000000 +0200
++++ projects/rscriptd/build 2013-01-15 18:38:13.000000000 +0200
+@@ -16,21 +16,15 @@
+ DIR_MODE=0755
+ OWNER=root
+
+-if [ -z $1 ]
++if [ "$1" = "debug" ]
+ then
+- MAKEOPTS="-j1"
+- DEBUG="no"
++ DEFS="$DEFS -DDEBUG"
++ MAKEOPTS="$MAKEOPTS -j1"
++ CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra"
++ DEBUG="yes"
+ else
+- if [ "$1" = "debug" ]
+- then
+- DEFS="-DDEBUG"
+- MAKEOPTS="-j1"
+- CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
+- DEBUG="yes"
+- else
+- MAKEOPTS="-j1"
+- DEBUG="no"
+- fi
++ DEFS="$DEFS -DNDEBUG"
++ DEBUG="no"
+ fi
+
+ CXXFLAGS="$CXXFLAGS -I/usr/local/include"
+--- projects/sgauth/build.org 2013-01-15 18:29:20.000000000 +0200
++++ projects/sgauth/build 2013-01-15 18:36:33.000000000 +0200
+@@ -16,21 +16,15 @@
+ DIR_MODE=0755
+ OWNER=root
+
+-if [ -z $1 ]
++if [ "$1" = "debug" ]
+ then
+- MAKEOPTS="-j1"
+- DEBUG="no"
++ DEFS="$DEFS -DDEBUG"
++ MAKEOPTS="$MAKEOPTS -j1"
++ CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra"
++ DEBUG="yes"
+ else
+- if [ "$1" = "debug" ]
+- then
+- DEFS="-DDEBUG"
+- MAKEOPTS="-j1"
+- CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
+- DEBUG="yes"
+- else
+- MAKEOPTS="-j1"
+- DEBUG="no"
+- fi
++ DEFS="$DEFS -DNDEBUG"
++ DEBUG="no"
+ fi
+
+ CXXFLAGS="$CXXFLAGS -I/usr/local/include"
+--- projects/sgconf/build.org 2013-01-15 18:29:59.000000000 +0200
++++ projects/sgconf/build 2013-01-15 18:35:41.000000000 +0200
+@@ -16,21 +16,15 @@
+ DIR_MODE=0755
+ OWNER=root
+
+-if [ -z $1 ]
++if [ "$1" = "debug" ]
+ then
+- MAKEOPTS="-j1"
+- DEBUG="no"
++ DEFS="$DEFS -DDEBUG"
++ MAKEOPTS="$MAKEOPTS -j1"
++ CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra"
++ DEBUG="yes"
+ else
+- if [ "$1" = "debug" ]
+- then
+- DEFS="-DDEBUG"
+- MAKEOPTS="-j1"
+- CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
+- DEBUG="yes"
+- else
+- MAKEOPTS="-j1"
+- DEBUG="no"
+- fi
++ DEFS="$DEFS -DNDEBUG"
++ DEBUG="no"
+ fi
+
+ CXXFLAGS="$CXXFLAGS -I/usr/local/include"
+--- projects/sgconf_xml/build.org 2013-01-15 18:30:26.000000000 +0200
++++ projects/sgconf_xml/build 2013-01-15 18:34:53.000000000 +0200
+@@ -16,21 +16,15 @@
+ DIR_MODE=0755
+ OWNER=root
+
+-if [ -z $1 ]
++if [ "$1" = "debug" ]
+ then
+- MAKEOPTS="-j1"
+- DEBUG="no"
++ DEFS="$DEFS -DDEBUG"
++ MAKEOPTS="$MAKEOPTS -j1"
++ CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra"
++ DEBUG="yes"
+ else
+- if [ "$1" = "debug" ]
+- then
+- DEFS="-DDEBUG"
+- MAKEOPTS="-j1"
+- CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
+- DEBUG="yes"
+- else
+- MAKEOPTS="-j1"
+- DEBUG="no"
+- fi
++ DEFS="$DEFS -DNDEBUG"
++ DEBUG="no"
+ fi
+
+ CXXFLAGS="$CXXFLAGS -I/usr/local/include"
+--- projects/sgconv/build.org 2013-01-15 18:31:01.000000000 +0200
++++ projects/sgconv/build 2013-01-15 18:32:46.000000000 +0200
+@@ -16,11 +16,20 @@
+ DIR_MODE=0755
+ OWNER=root
+ VAR_DIR="./inst/var/stargazer"
+-DEFS="-DDEBUG"
+-MAKEOPTS="-j1"
++
++if [ "$1" = "debug" ]
++then
++ DEFS="$DEFS -DDEBUG"
++ MAKEOPTS="$MAKEOPTS -j1"
++ CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra"
++ DEBUG="yes"
++else
++ DEFS="$DEFS -DNDEBUG"
++ DEBUG="no"
++fi
++
+ CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -I/usr/local/include"
+ LDFLAGS="$LDFLAGS -L/usr/local/lib"
+-DEBUG="yes"
+
+ if [ "$sys" = "Linux" ]
+ then
+--- projects/stargazer/build.org 2013-01-15 19:48:54.000000000 +0200
++++ projects/stargazer/build 2013-01-15 19:51:13.000000000 +0200
+@@ -35,23 +35,15 @@
+ XMLRPC_FEATURES="c++2 abyss-server"
+
+
+-if [ -z "$1" ]
++if [ "$1" = "debug" ]
+ then
++ DEFS="$DEFS -DDEBUG"
++ MAKEOPTS="$MAKEOPTS -j1"
++ CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
++ DEBUG="yes"
++else
+ DEFS="$DEFS -DNDEBUG"
+- MAKEOPTS="-j1"
+ DEBUG="no"
+-else
+- if [ "$1" = "debug" ]
+- then
+- DEFS="$DEFS -DDEBUG"
+- MAKEOPTS="-j1"
+- CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
+- DEBUG="yes"
+- else
+- DEFS="$DEFS -DNDEBUG"
+- MAKEOPTS="-j1"
+- DEBUG="no"
+- fi
+ fi
+
+ CXXFLAGS="$CXXFLAGS -I/usr/local/include"
diff --git a/net-misc/stargazer/files/patches/stg-2.408-build.patch b/net-misc/stargazer/files/patches/stg-2.408-build.patch
new file mode 100644
index 000000000000..380b4cbe91f2
--- /dev/null
+++ b/net-misc/stargazer/files/patches/stg-2.408-build.patch
@@ -0,0 +1,179 @@
+--- projects/rlm_stg/configure.org 2013-01-18 18:06:17.000000000 +0200
++++ projects/rlm_stg/configure 2013-01-18 18:07:18.000000000 +0200
+@@ -34,6 +34,7 @@
+ then
+ OS=linux
+ release=""
++ ETC_DIR="./inst/linux/etc/stargazer"
+ MAKE="make"
+ fi
+
+@@ -48,6 +49,7 @@
+ 9) OS=bsd7;;
+ *) OS=unknown;;
+ esac
++ ETC_DIR="./inst/freebsd/etc/stargazer"
+ MAKE="gmake"
+ fi
+
+@@ -163,5 +165,4 @@
+ echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
+ echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
+ echo "OWNER=$OWNER" >> $CONFFILE
+-$MAKE $MAKEOPTS
+-
++echo "ETC_DIR=$ETC_DIR" >> $CONFFILE
+\ No newline at end of file
+--- projects/rscriptd/configure.org 2013-01-18 18:07:28.000000000 +0200
++++ projects/rscriptd/configure 2013-01-18 18:08:02.000000000 +0200
+@@ -34,6 +34,7 @@
+ then
+ OS=linux
+ release=""
++ ETC_DIR="./inst/linux/etc/stargazer"
+ MAKE="make"
+ fi
+
+@@ -48,6 +49,7 @@
+ 9) OS=bsd7;;
+ *) OS=unknown;;
+ esac
++ ETC_DIR="./inst/freebsd/etc/stargazer"
+ MAKE="gmake"
+ fi
+
+@@ -169,6 +171,4 @@
+ echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
+ echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
+ echo "OWNER=$OWNER" >> $CONFFILE
+-
+-$MAKE $MAKEOPTS
+-
++echo "ETC_DIR=$ETC_DIR" >> $CONFFILE
+\ No newline at end of file
+--- projects/sgauth/configure.org 2013-01-18 18:08:10.000000000 +0200
++++ projects/sgauth/configure 2013-01-18 18:08:38.000000000 +0200
+@@ -34,6 +34,7 @@
+ then
+ OS=linux
+ release=""
++ ETC_DIR="./inst/linux/etc/stargazer"
+ MAKE="make"
+ fi
+
+@@ -48,6 +49,7 @@
+ 9) OS=bsd7;;
+ *) OS=unknown;;
+ esac
++ ETC_DIR="./inst/freebsd/etc/stargazer"
+ MAKE="gmake"
+ fi
+
+@@ -167,5 +169,4 @@
+ echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
+ echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
+ echo "OWNER=$OWNER" >> $CONFFILE
+-$MAKE $MAKEOPTS
+-
++echo "ETC_DIR=$ETC_DIR" >> $CONFFILE
+\ No newline at end of file
+--- projects/sgconf/configure.org 2013-01-18 18:08:46.000000000 +0200
++++ projects/sgconf/configure 2013-01-18 18:09:44.000000000 +0200
+@@ -34,6 +34,7 @@
+ then
+ OS=linux
+ release=""
++ ETC_DIR="./inst/linux/etc/stargazer"
+ MAKE="make"
+ fi
+
+@@ -48,6 +49,7 @@
+ 9) OS=bsd7;;
+ *) OS=unknown;;
+ esac
++ ETC_DIR="./inst/freebsd/etc/stargazer"
+ MAKE="gmake"
+ fi
+
+@@ -186,6 +188,4 @@
+ echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
+ echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
+ echo "OWNER=$OWNER" >> $CONFFILE
+-
+-$MAKE $MAKEOPTS
+-
++echo "ETC_DIR=$ETC_DIR" >> $CONFFILE
+\ No newline at end of file
+--- projects/sgconf_xml/configure.org 2013-01-18 18:09:54.000000000 +0200
++++ projects/sgconf_xml/configure 2013-01-18 18:10:23.000000000 +0200
+@@ -34,6 +34,7 @@
+ then
+ OS=linux
+ release=""
++ ETC_DIR="./inst/linux/etc/stargazer"
+ MAKE="make"
+ fi
+
+@@ -48,6 +49,7 @@
+ 9) OS=bsd7;;
+ *) OS=unknown;;
+ esac
++ ETC_DIR="./inst/freebsd/etc/stargazer"
+ MAKE="gmake"
+ fi
+
+@@ -186,6 +188,4 @@
+ echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
+ echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
+ echo "OWNER=$OWNER" >> $CONFFILE
+-
+-$MAKE $MAKEOPTS
+-
++echo "ETC_DIR=$ETC_DIR" >> $CONFFILE
+\ No newline at end of file
+--- projects/sgconv/configure.org 2013-01-18 18:10:30.000000000 +0200
++++ projects/sgconv/configure 2013-01-18 18:11:09.000000000 +0200
+@@ -35,6 +35,7 @@
+ then
+ OS=linux
+ release=""
++ ETC_DIR="./inst/linux/etc/stargazer"
+ MAKE="make"
+ fi
+
+@@ -49,6 +50,7 @@
+ 9) OS=bsd7;;
+ *) OS=unknown;;
+ esac
++ ETC_DIR="./inst/freebsd/etc/stargazer"
+ MAKE="gmake"
+ fi
+
+@@ -293,8 +295,6 @@
+ echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
+ echo "OWNER=$OWNER" >> $CONFFILE
+ echo "VAR_DIR=$VAR_DIR" >> $CONFFILE
++echo "ETC_DIR=$ETC_DIR" >> $CONFFILE
+
+-mkdir -p ../stargazer/modules
+-
+-$MAKE $MAKEOPTS
+-
++mkdir -p ../stargazer/modules
+\ No newline at end of file
+--- projects/stargazer/configure.org 2013-01-18 18:11:15.000000000 +0200
++++ projects/stargazer/configure 2013-01-18 18:11:40.000000000 +0200
+@@ -404,11 +404,4 @@
+ echo "VAR_DIR=$VAR_DIR" >> $CONFFILE
+ echo "ETC_DIR=$ETC_DIR" >> $CONFFILE
+
+-mkdir -p modules
+-
+-if [ "$1" != "debug" ]
+-then
+- $MAKE $MAKEOPTS
+-else
+- echo -e "\n\n\nDebug build. Type $MAKE explicitly"
+-fi
++mkdir -p modules
+\ No newline at end of file
diff --git a/net-misc/stargazer/files/patches/stg-2.408-correct-paths.patch b/net-misc/stargazer/files/patches/stg-2.408-correct-paths.patch
new file mode 100644
index 000000000000..82698af5b6f7
--- /dev/null
+++ b/net-misc/stargazer/files/patches/stg-2.408-correct-paths.patch
@@ -0,0 +1,186 @@
+--- projects/rscriptd/rscriptd.conf.org 2013-01-08 18:19:34.000000000 +0200
++++ projects/rscriptd/rscriptd.conf 2013-01-08 18:20:52.000000000 +0200
+@@ -6,7 +6,7 @@
+ # Parameter: optional
+ # Value: file path
+ # Default: /var/log/rscriptd.log
+-LogFileName = /var/log/rscriptd.log
++LogFileName = /var/log/stargazer/rscriptd.log
+
+ # Amount of rscriptd-exec processes.
+ # These processes are responsible for the execution of scripts
+@@ -22,7 +22,7 @@
+ # Parameter: optional
+ # Value: directory path
+ # Default: /etc/rscriptd
+-ConfigDir = /etc/rscriptd
++ConfigDir = /etc/stargazer
+
+ # Defines password for the encryption exchange between
+ # Stargazer server and rscriptd.
+@@ -49,12 +49,12 @@
+ # Parameter: optional
+ # Value: file path
+ # Default: /etc/rscriptd/OnConnect
+-ScriptOnConnect = /etc/rscriptd/OnConnect
++ScriptOnConnect = /etc/stargazer/OnConnect
+
+ # Defines file which runs when user loses access
+ # Parameter: optional
+ # Value: file path
+ # Default: /etc/rscriptd/OnDisconnect
+-ScriptOnDisconnect = /etc/rscriptd/OnDisconnect
++ScriptOnDisconnect = /etc/stargazer/OnDisconnect
+
+ ################################################################################
+\ No newline at end of file
+--- projects/sgconv/sgconv.conf.org 2012-12-18 21:56:33.578221904 +0200
++++ projects/sgconv/sgconv.conf 2012-12-18 21:58:22.355217059 +0200
+@@ -18,27 +18,27 @@
+ # Working server directory, provides data on tariffs, users, administrators.
+ # Parameter: required
+ # Value: directory path
+- WorkDir = /var/stargazer
++ WorkDir = /var/lib/stargazer
+
+ # Owner, group and permissions of the files of user statistics (stat)
+ # Parameter: required
+ # Values: any, supported by OS
+- ConfOwner = root
+- ConfGroup = root
++ ConfOwner = stg
++ ConfGroup = stg
+ ConfMode = 600
+
+ # Owner, group and permissions on user configuration files (conf)
+ # Parameter: required
+ # Values: any, supported by OS
+- StatOwner = root
+- StatGroup = root
++ StatOwner = stg
++ StatGroup = stg
+ StatMode = 640
+
+ # Owner, group and permissions for user log files (log)
+ # Parameter: required
+ # Values: any, supported by OS
+- UserLogOwner = root
+- UserLogGroup = root
++ UserLogOwner = stg
++ UserLogGroup = stg
+ UserLogMode = 640
+
+ </SourceStoreModule>
+@@ -54,7 +54,7 @@
+ # Parameter: required
+ # Value: file path
+ # Default: /var/stg/stargazer.fdb
+- # database = /var/stg/stargazer.fdb
++ # database = /var/lib/stargazer/stargazer.fdb
+
+ # Database username
+ # Parameter: required
+--- projects/stargazer/inst/linux/etc/stargazer/stargazer.conf.org 2012-12-30 14:35:22.000000000 +0200
++++ projects/stargazer/inst/linux/etc/stargazer/stargazer.conf 2012-12-30 14:36:37.000000000 +0200
+@@ -6,7 +6,7 @@
+ # Parameter: required
+ # Value: file path
+ # Default: /var/log/stargazer.log
+-LogFile = /var/log/stargazer.log
++LogFile = /var/log/stargazer/stargazer.log
+
+ # PID file name
+ # Parameter: optional
+@@ -147,7 +147,7 @@
+ # Parameter: optional
+ # Value: file path
+ # Default: /var/stargazer/monitor
+-#MonitorDir=/var/stargazer/monitor
++#MonitorDir=/var/lib/stargazer/monitor
+
+ # Defines message maximum lifetime
+ # Note: 0 - unlimited
+--- projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_remote_script.conf.org 2012-12-25 14:03:49.000000000 +0200
++++ projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_remote_script.conf 2012-12-25 14:04:00.000000000 +0200
+@@ -16,7 +16,7 @@
+ # Parametr: required
+ # Values: filename
+ # Default: subnets
+- SubnetFile = subnets
++ SubnetFile = /etc/stargazer/subnets
+
+ # The password to encrypt packets between the stg-server and remote server
+ # Parameter: required
+--- projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_files.conf.org 2012-12-25 13:31:01.000000000 +0200
++++ projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_files.conf 2012-12-25 13:31:43.000000000 +0200
+@@ -5,27 +5,27 @@
+ # Working server directory, provides data on tariffs, users, administrators.
+ # Parameter: required
+ # Value: directory path
+- WorkDir = /var/stargazer
++ WorkDir = /var/lib/stargazer
+
+ # Owner, group and permissions of the files of user statistics (stat)
+ # Parameter: required
+ # Values: any, supported by OS
+- ConfOwner = root
+- ConfGroup = root
++ ConfOwner = stg
++ ConfGroup = stg
+ ConfMode = 640
+
+ # Owner, group and permissions on user configuration files (conf)
+ # Parameter: required
+ # Values: any, supported by OS
+- StatOwner = root
+- StatGroup = root
++ StatOwner = stg
++ StatGroup = stg
+ StatMode = 640
+
+ # Owner, group and permissions for user log files (log)
+ # Parameter: required
+ # Values: any, supported by OS
+- UserLogOwner = root
+- UserLogGroup = root
++ UserLogOwner = stg
++ UserLogGroup = stg
+ UserLogMode = 640
+
+ </StoreModule>
+--- projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_firebird.conf.org 2012-12-25 13:39:00.000000000 +0200
++++ projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_firebird.conf 2012-12-25 13:39:28.000000000 +0200
+@@ -9,7 +9,7 @@
+ # Parameter: required
+ # Value: file path
+ # Default: /var/stg/stargazer.fdb
+- Database = /var/stg/stargazer.fdb
++ Database = /var/lib/stargazer/stargazer.fdb
+
+ # Database username
+ # Parameter: required
+--- projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp.org 2012-12-31 11:08:26.000000000 +0200
++++ projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp 2012-12-31 11:08:41.000000000 +0200
+@@ -169,7 +169,7 @@
+ rpcServer = new xmlrpc_c::serverAbyss(
+ xmlrpc_c::serverAbyss::constrOpt()
+ .registryP(&rpcRegistry)
+- .logFileName("/var/log/stargazer_rpc.log")
++ .logFileName("/var/log/stargazer/xmlrpc.log")
+ .socketFd(fd)
+ );
+
+--- projects/stargazer/inst/var/00-base-00.sql.org 2013-01-02 16:22:28.000000000 +0200
++++ projects/stargazer/inst/var/00-base-00.sql 2013-01-02 16:22:52.000000000 +0200
+@@ -50,9 +50,9 @@
+ /*
+ * CONNECT 'localhost:/var/stg/stargazer.fdb' USER 'stg' PASSWORD '123456';
+ * DROP DATABASE;
+- *
+- * CREATE DATABASE 'localhost:/var/stg/stargazer.fdb' USER 'stg' PASSWORD '123456' DEFAULT CHARACTER SET UTF8;
+ */
++ CREATE DATABASE 'localhost:/var/lib/stargazer/stargazer.fdb' USER 'stg' PASSWORD '123456' DEFAULT CHARACTER SET UTF8;
++
+
+
+
diff --git a/net-misc/stargazer/files/patches/stg-2.408-fix-crash-on-stop.patch b/net-misc/stargazer/files/patches/stg-2.408-fix-crash-on-stop.patch
new file mode 100644
index 000000000000..367c91209be7
--- /dev/null
+++ b/net-misc/stargazer/files/patches/stg-2.408-fix-crash-on-stop.patch
@@ -0,0 +1,190 @@
+diff -Naur stg-2.408/projects/rscriptd/listener.cpp stg-2.408-patched/projects/rscriptd/listener.cpp
+--- stg-2.408/projects/rscriptd/listener.cpp 2012-02-09 12:26:59.000000000 +0200
++++ stg-2.408-patched/projects/rscriptd/listener.cpp 2013-02-11 09:04:32.000000000 +0200
+@@ -49,6 +49,8 @@
+ receiverStopped(true),
+ processorStopped(true),
+ userTimeout(0),
++ receiverThread(0),
++ processorThread(0),
+ listenSocket(0)
+ {
+ version = "rscriptd listener v.1.2";
+@@ -149,8 +151,10 @@
+ }
+ }
+
+-pthread_join(receiverThread, NULL);
+-pthread_join(processorThread, NULL);
++if (receiverThread != 0)
++ pthread_join(receiverThread, NULL);
++if (processorThread != 0)
++ pthread_join(processorThread, NULL);
+
+ pthread_mutex_destroy(&mutex);
+
+diff -Naur stg-2.408/projects/stargazer/eventloop.cpp stg-2.408-patched/projects/stargazer/eventloop.cpp
+--- stg-2.408/projects/stargazer/eventloop.cpp 2012-02-09 12:27:06.000000000 +0200
++++ stg-2.408-patched/projects/stargazer/eventloop.cpp 2013-02-11 09:03:11.000000000 +0200
+@@ -10,7 +10,7 @@
+ : ACTIONS_LIST(),
+ _running(false),
+ _stopped(true),
+- _tid(),
++ _tid(0),
+ _mutex(),
+ _condition()
+ {
+@@ -41,7 +41,8 @@
+ // Wake up thread
+ pthread_cond_signal(&_condition);
+ // Wait until thread exit
+-pthread_join(_tid, NULL);
++if (_tid != 0)
++ pthread_join(_tid, NULL);
+ return false;
+ }
+
+diff -Naur stg-2.408/projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp stg-2.408-patched/projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp
+--- stg-2.408/projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp 2012-02-09 12:27:14.000000000 +0200
++++ stg-2.408-patched/projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp 2013-02-11 09:01:34.000000000 +0200
+@@ -55,8 +55,8 @@
+ NF_CAP::NF_CAP()
+ : traffCnt(NULL),
+ settings(),
+- tidTCP(),
+- tidUDP(),
++ tidTCP(0),
++ tidUDP(0),
+ runningTCP(false),
+ runningUDP(false),
+ stoppedTCP(true),
+@@ -153,7 +153,8 @@
+ }
+ if (stoppedUDP)
+ {
+- pthread_join(tidUDP, NULL);
++ if (tidUDP != 0)
++ pthread_join(tidUDP, NULL);
+ }
+ else
+ {
+@@ -176,7 +177,8 @@
+ }
+ if (stoppedTCP)
+ {
+- pthread_join(tidTCP, NULL);
++ if (tidTCP != 0)
++ pthread_join(tidTCP, NULL);
+ }
+ else
+ {
+diff -Naur stg-2.408/projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp stg-2.408-patched/projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp
+--- stg-2.408/projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp 2012-02-09 12:27:15.000000000 +0200
++++ stg-2.408-patched/projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp 2013-02-11 09:02:05.000000000 +0200
+@@ -74,7 +74,7 @@
+ //-----------------------------------------------------------------------------
+ ETHER_CAP::ETHER_CAP()
+ : errorStr(),
+- thread(),
++ thread(0),
+ nonstop(false),
+ isRunning(false),
+ capSock(-1),
+@@ -140,7 +140,8 @@
+ }
+ else
+ {
+- pthread_join(thread, NULL);
++ if (thread != 0)
++ pthread_join(thread, NULL);
+ }
+ }
+
+diff -Naur stg-2.408/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp stg-2.408-patched/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp
+--- stg-2.408/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp 2012-02-09 12:27:15.000000000 +0200
++++ stg-2.408-patched/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp 2013-02-11 09:02:37.000000000 +0200
+@@ -58,7 +58,7 @@
+ IPQ_CAP::IPQ_CAP()
+ : ipq_h(NULL),
+ errorStr(),
+- thread(),
++ thread(0),
+ nonstop(false),
+ isRunning(false),
+ capSock(-1),
+@@ -120,7 +120,8 @@
+ }
+ else
+ {
+- pthread_join(thread, NULL);
++ if (thread != 0)
++ pthread_join(thread, NULL);
+ }
+ }
+ IPQCapClose();
+diff -Naur stg-2.408/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp stg-2.408-patched/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp
+--- stg-2.408/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp 2012-02-09 12:27:16.000000000 +0200
++++ stg-2.408-patched/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp 2013-02-11 09:00:33.000000000 +0200
+@@ -93,7 +93,7 @@
+ rpcServer(NULL),
+ running(false),
+ stopped(true),
+- tid(),
++ tid(0),
+ cookies(),
+ dayFee(0),
+ dirNames()
+@@ -201,7 +201,8 @@
+ }
+ else
+ {
+- pthread_join(tid, NULL);
++ if (tid != 0)
++ pthread_join(tid, NULL);
+ }
+
+ close(fd);
+diff -Naur stg-2.408/projects/stargazer/plugins/other/smux/smux.cpp stg-2.408-patched/projects/stargazer/plugins/other/smux/smux.cpp
+--- stg-2.408/projects/stargazer/plugins/other/smux/smux.cpp 2012-02-09 12:27:24.000000000 +0200
++++ stg-2.408-patched/projects/stargazer/plugins/other/smux/smux.cpp 2013-02-11 09:07:54.000000000 +0200
+@@ -99,7 +99,7 @@
+ errorStr(),
+ smuxSettings(),
+ settings(),
+- thread(),
++ thread(0),
+ mutex(),
+ running(false),
+ stopped(true),
+@@ -227,7 +227,7 @@
+ }
+ }
+
+-if (stopped)
++if (stopped && thread != 0)
+ pthread_join(thread, NULL);
+
+ ResetNotifiers();
+diff -Naur stg-2.408/projects/stargazer/stg_timer.cpp stg-2.408-patched/projects/stargazer/stg_timer.cpp
+--- stg-2.408/projects/stargazer/stg_timer.cpp 2012-02-09 12:27:30.000000000 +0200
++++ stg-2.408-patched/projects/stargazer/stg_timer.cpp 2013-02-11 08:58:55.000000000 +0200
+@@ -7,7 +7,7 @@
+ #include "stg/common.h"
+
+ static int nonstop;
+-static pthread_t thrStgTimer;
++static pthread_t thrStgTimer(0);
+ static bool isTimerRunning = false;
+ volatile time_t stgTime;
+
+@@ -101,7 +101,8 @@
+ void StopStgTimer()
+ {
+ nonstop = 0;
+-pthread_join(thrStgTimer, NULL); // Cleanup thread resources
++if (thrStgTimer != 0)
++ pthread_join(thrStgTimer, NULL); // Cleanup thread resources
+ printfd(__FILE__, "STG_TIMER stopped\n");
+ }
+ //-----------------------------------------------------------------------------
diff --git a/net-misc/stargazer/files/patches/stg-2.408-makefile-build-upstream.patch b/net-misc/stargazer/files/patches/stg-2.408-makefile-build-upstream.patch
new file mode 100644
index 000000000000..51d0f1f04ea6
--- /dev/null
+++ b/net-misc/stargazer/files/patches/stg-2.408-makefile-build-upstream.patch
@@ -0,0 +1,386 @@
+diff --git a/projects/convertor/Makefile b/projects/convertor/Makefile
+index efacbb6..04c00cc 100644
+--- a/projects/sgconv/Makefile
++++ b/projects/sgconv/Makefile
+@@ -58,6 +58,21 @@ clean:
+ distclean: clean
+ rm -f ../../Makefile.conf
+
++install: install-bin
++
++install-bin:
++ifeq ($(DEBUG), yes)
++ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG)
++else
++ install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG)
++endif
++ $(MAKE) -C $(DIR_PLUGINS) install
++
++uninstall: uninstall-bin
++
++uninstall-bin:
++ rm -f $(PREFIX)/usr/bin/$(PROG)
++
+ ifneq ($(MAKECMDGOALS),distclean)
+ ifneq ($(MAKECMDGOALS),clean)
+ ifneq ($(MAKECMDGOALS),uninstall)
+diff --git a/projects/convertor/build b/projects/convertor/build
+index 0144b0f..471ee62 100755
+--- a/projects/sgconv/build
++++ b/projects/sgconv/build
+@@ -20,6 +20,7 @@ DEFS="-DDEBUG"
+ MAKEOPTS="-j1"
+ CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -I/usr/local/include"
+ LDFLAGS="$LDFLAGS -L/usr/local/lib"
++DEBUG="yes"
+
+ if [ "$sys" = "Linux" ]
+ then
+@@ -251,6 +252,7 @@ fi
+
+ echo "OS=$OS" > $CONFFILE
+ echo "STG_TIME=yes" >> $CONFFILE
++echo "DEBUG=$DEBUG" >> $CONFFILE
+ echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
+ echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
+ echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
+diff --git a/projects/rlm_stg/Makefile b/projects/rlm_stg/Makefile
+index 98f5f2d..6190491 100644
+--- a/projects/rlm_stg/Makefile
++++ b/projects/rlm_stg/Makefile
+@@ -57,13 +57,17 @@ distclean: clean
+ install: install-bin
+
+ install-bin:
+- install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG)
++ifeq ($(DEBUG), yes)
++ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
++else
++ install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
++endif
+ $(MAKE) -C $(DIR_LIBSRC) install
+
+ uninstall: uninstall-bin
+
+ uninstall-bin:
+- rm -f $(PREFIX)/usr/lib/$(PROG)
++ rm -f $(PREFIX)/usr/lib/freeradius/$(PROG)
+
+ ifneq ($(MAKECMDGOALS),distclean)
+ ifneq ($(MAKECMDGOALS),clean)
+diff --git a/projects/rlm_stg/build b/projects/rlm_stg/build
+index 0145d03..3781d1b 100755
+--- a/projects/rlm_stg/build
++++ b/projects/rlm_stg/build
+@@ -19,14 +19,17 @@ OWNER=root
+ if [ -z $1 ]
+ then
+ MAKEOPTS="-j1"
++ DEBUG="no"
+ else
+ if [ "$1" = "debug" ]
+ then
+ DEFS="-DDEBUG"
+ MAKEOPTS="-j1"
+ CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
++ DEBUG="yes"
+ else
+ MAKEOPTS="-j1"
++ DEBUG="no"
+ fi
+ fi
+
+@@ -144,6 +147,7 @@ rm -f fake
+
+ echo "OS=$OS" > $CONFFILE
+ echo "STG_TIME=yes" >> $CONFFILE
++echo "DEBUG=$DEBUG" >> $CONFFILE
+ echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
+ echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
+ echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
+diff --git a/projects/rscriptd/Makefile b/projects/rscriptd/Makefile
+index 0912be0..da06b50 100644
+--- a/projects/rscriptd/Makefile
++++ b/projects/rscriptd/Makefile
+@@ -57,7 +57,11 @@ distclean: clean
+ install: install-bin install-data
+
+ install-bin:
+- install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
++ifeq ($(DEBUG), yes)
++ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
++else
++ install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
++endif
+ $(MAKE) -C $(DIR_LIBSRC) install
+
+ install-data:
+diff --git a/projects/rscriptd/build b/projects/rscriptd/build
+index 885eef7..6a7c77f 100755
+--- a/projects/rscriptd/build
++++ b/projects/rscriptd/build
+@@ -19,14 +19,17 @@ OWNER=root
+ if [ -z $1 ]
+ then
+ MAKEOPTS="-j1"
++ DEBUG="no"
+ else
+ if [ "$1" = "debug" ]
+ then
+ DEFS="-DDEBUG"
+ MAKEOPTS="-j1"
+ CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
++ DEBUG="yes"
+ else
+ MAKEOPTS="-j1"
++ DEBUG="no"
+ fi
+ fi
+
+@@ -150,6 +153,7 @@ rm -f build_check.c
+
+ echo "OS=$OS" > $CONFFILE
+ echo "STG_TIME=yes" >> $CONFFILE
++echo "DEBUG=$DEBUG" >> $CONFFILE
+ echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
+ echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
+ echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
+diff --git a/projects/sgauth/Makefile b/projects/sgauth/Makefile
+index 99cd0e4..a59371c 100644
+--- a/projects/sgauth/Makefile
++++ b/projects/sgauth/Makefile
+@@ -58,7 +58,11 @@ distclean: clean
+ install: install-bin install-data
+
+ install-bin:
+- install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
++ifeq ($(DEBUG), yes)
++ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
++else
++ install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
++endif
+ $(MAKE) -C $(DIR_LIBSRC) install
+
+ install-data:
+diff --git a/projects/sgauth/build b/projects/sgauth/build
+index ec747e2..e3ad87f 100755
+--- a/projects/sgauth/build
++++ b/projects/sgauth/build
+@@ -19,14 +19,17 @@ OWNER=root
+ if [ -z $1 ]
+ then
+ MAKEOPTS="-j1"
++ DEBUG="no"
+ else
+ if [ "$1" = "debug" ]
+ then
+ DEFS="-DDEBUG"
+ MAKEOPTS="-j1"
+ CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
++ DEBUG="yes"
+ else
+ MAKEOPTS="-j1"
++ DEBUG="no"
+ fi
+ fi
+
+@@ -148,6 +151,7 @@ rm -f build_check.c
+
+ echo "OS=$OS" > $CONFFILE
+ echo "STG_TIME=yes" >> $CONFFILE
++echo "DEBUG=$DEBUG" >> $CONFFILE
+ echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
+ echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
+ echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
+diff --git a/projects/sgconf/Makefile b/projects/sgconf/Makefile
+index 4d62bb5..297d3e2 100644
+--- a/projects/sgconf/Makefile
++++ b/projects/sgconf/Makefile
+@@ -66,7 +66,11 @@ distclean: clean
+ install: install-bin
+
+ install-bin:
+- install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
++ifeq ($(DEBUG), yes)
++ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG)
++else
++ install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG)
++endif
+ $(MAKE) -C $(DIR_LIBSRC) install
+
+ uninstall: uninstall-bin
+diff --git a/projects/sgconf/build b/projects/sgconf/build
+index 1f6c0a0..da81773 100755
+--- a/projects/sgconf/build
++++ b/projects/sgconf/build
+@@ -19,14 +19,17 @@ OWNER=root
+ if [ -z $1 ]
+ then
+ MAKEOPTS="-j1"
++ DEBUG="no"
+ else
+ if [ "$1" = "debug" ]
+ then
+ DEFS="-DDEBUG"
+ MAKEOPTS="-j1"
+ CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
++ DEBUG="yes"
+ else
+ MAKEOPTS="-j1"
++ DEBUG="no"
+ fi
+ fi
+
+@@ -166,6 +169,7 @@ fi
+
+ echo "OS=$OS" > $CONFFILE
+ echo "STG_TIME=yes" >> $CONFFILE
++echo "DEBUG=$DEBUG" >> $CONFFILE
+ echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
+ echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
+ echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
+diff --git a/projects/sgconf_xml/Makefile b/projects/sgconf_xml/Makefile
+index b7ebca0..32384e6 100644
+--- a/projects/sgconf_xml/Makefile
++++ b/projects/sgconf_xml/Makefile
+@@ -66,7 +66,11 @@ distclean: clean
+ install: install-bin install-data
+
+ install-bin:
+- install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
++ifeq ($(DEBUG), yes)
++ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG)
++else
++ install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG)
++endif
+ $(MAKE) -C $(DIR_LIBSRC) install
+
+ uninstall: uninstall-bin uninstall-data
+diff --git a/projects/sgconf_xml/build b/projects/sgconf_xml/build
+index f78e6f7..9797075 100755
+--- a/projects/sgconf_xml/build
++++ b/projects/sgconf_xml/build
+@@ -19,14 +19,17 @@ OWNER=root
+ if [ -z $1 ]
+ then
+ MAKEOPTS="-j1"
++ DEBUG="no"
+ else
+ if [ "$1" = "debug" ]
+ then
+ DEFS="-DDEBUG"
+ MAKEOPTS="-j1"
+ CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
++ DEBUG="yes"
+ else
+ MAKEOPTS="-j1"
++ DEBUG="no"
+ fi
+ fi
+
+@@ -166,6 +169,7 @@ fi
+
+ echo "OS=$OS" > $CONFFILE
+ echo "STG_TIME=yes" >> $CONFFILE
++echo "DEBUG=$DEBUG" >> $CONFFILE
+ echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
+ echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
+ echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
+diff --git a/projects/stargazer/Makefile b/projects/stargazer/Makefile
+index 44ae35e..9dfc0b5 100644
+--- a/projects/stargazer/Makefile
++++ b/projects/stargazer/Makefile
+@@ -77,7 +77,11 @@ distclean: clean
+ install: install-bin install-data
+
+ install-bin: $(PROG)
+- install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
++ifeq ($(DEBUG), yes)
++ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
++else
++ install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
++endif
+ $(MAKE) -C $(DIR_INCLUDE) install
+ $(MAKE) -C $(DIR_LIBSRC) install
+ $(MAKE) -C $(DIR_PLUGINS) install
+diff --git a/projects/stargazer/build b/projects/stargazer/build
+index c58b969..8a34c4f 100755
+--- a/projects/stargazer/build
++++ b/projects/stargazer/build
+@@ -39,15 +39,18 @@ if [ -z "$1" ]
+ then
+ DEFS="$DEFS -DNDEBUG"
+ MAKEOPTS="-j1"
++ DEBUG="no"
+ else
+ if [ "$1" = "debug" ]
+ then
+ DEFS="$DEFS -DDEBUG"
+ MAKEOPTS="-j1"
+ CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
++ DEBUG="yes"
+ else
+ DEFS="$DEFS -DNDEBUG"
+ MAKEOPTS="-j1"
++ DEBUG="no"
+ fi
+ fi
+
+@@ -391,6 +394,7 @@ fi
+
+ echo "OS=$OS" > $CONFFILE
+ echo "STG_TIME=yes" >> $CONFFILE
++echo "DEBUG=$DEBUG" >> $CONFFILE
+ echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
+ echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
+ echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
+diff --git a/projects/stargazer/plugins/Makefile.in b/projects/stargazer/plugins/Makefile.in
+index 17e10ac..70954a2 100644
+--- a/projects/stargazer/plugins/Makefile.in
++++ b/projects/stargazer/plugins/Makefile.in
+@@ -15,12 +15,12 @@ LIBS += $(addprefix -lstg,$(STGLIBS))
+
+ CXXFLAGS += -fPIC $(STGLIBS_INCS)
+ CFLAGS += -fPIC $(STGLIBS_INCS)
+-LDFLAGS += -shared -Wl,-rpath,$(PREFIX)/usr/lib/stg $(STGLIBS_LIBS)
++LDFLAGS += -shared -Wl,-rpath,$(PREFIX)/usr/lib/stg
+
+ all: $(PROG)
+
+ $(PROG): $(OBJS)
+- $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
++ $(CXX) $^ $(STGLIBS_LIBS) $(LIBS) $(LDFLAGS) -o $(PROG)
+ $(LN) -fs "`pwd`/$(PROG)" $(DIR_MOD)/$(PROG)
+
+ clean:
+@@ -28,7 +28,11 @@ clean:
+
+ install: $(PROG)
+ mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/stg
+- install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/stg/$(PROG)
++ifeq ($(DEBUG), yes)
++ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/stg/$(PROG)
++else
++ install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/stg/$(PROG)
++endif
+
+ uninstall:
+ rm -f $(PREFIX)/usr/lib/stg/$(PROG)
+diff --git a/stglibs/Makefile.in b/stglibs/Makefile.in
+index a318497..b5d1195 100644
+--- a/stglibs/Makefile.in
++++ b/stglibs/Makefile.in
+@@ -35,8 +35,11 @@ clean:
+ rm -f deps $(PROG) *.o *.a *.so tags *.*~
+
+ install: $(PROG)
+- mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/stg
+- install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/stg/$(PROG)
++ifeq ($(DEBUG), yes)
++ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/stg/$(PROG)
++else
++ install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/stg/$(PROG)
++endif
+ mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/include/stg
+ install -m $(DATA_MODE) -o $(OWNER) $(addprefix include/stg/,$(INCS)) $(PREFIX)/usr/include/stg/
+
diff --git a/net-misc/stargazer/files/patches/stg-2.408-makefile-firebird-upstream.patch b/net-misc/stargazer/files/patches/stg-2.408-makefile-firebird-upstream.patch
new file mode 100644
index 000000000000..81f46f4a3bfe
--- /dev/null
+++ b/net-misc/stargazer/files/patches/stg-2.408-makefile-firebird-upstream.patch
@@ -0,0 +1,13 @@
+--- projects/stargazer/plugins/store/firebird/Makefile.org 2013-01-04 22:50:13.000000000 +0200
++++ projects/stargazer/plugins/store/firebird/Makefile 2013-01-04 22:50:56.000000000 +0200
+@@ -22,5 +22,11 @@
+ locker \
+ crypto
+
++FB_CFLAGS = $(shell fb_config --cflags)
++FB_LDFLAGS = $(shell fb_config --libs)
++
++CXXFLAGS += $(FB_CFLAGS)
++LDFLAGS += $(FB_LDFLAGS)
++
+ include ../../Makefile.in
diff --git a/net-misc/stargazer/files/patches/stg-2.408-makefile.patch b/net-misc/stargazer/files/patches/stg-2.408-makefile.patch
new file mode 100644
index 000000000000..81772d6641fe
--- /dev/null
+++ b/net-misc/stargazer/files/patches/stg-2.408-makefile.patch
@@ -0,0 +1,203 @@
+--- projects/sgauth/Makefile.org 2013-01-05 23:47:38.000000000 +0200
++++ projects/sgauth/Makefile 2013-01-05 23:48:34.000000000 +0200
+@@ -67,8 +67,8 @@
+
+ install-data:
+ # Install etc
+- mkdir -m $(DIR_MODE) -p $(PREFIX)/etc
+- install -m $(DATA_MODE) -o $(OWNER) ./sgauth.conf $(PREFIX)/etc/sgauth.conf
++ mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/stargazer
++ install -m $(DATA_MODE) -o $(OWNER) ./sgauth.conf $(PREFIX)/etc/stargazer/sgauth.conf
+
+ uninstall: uninstall-bin uninstall-data
+
+--- projects/stargazer/Makefile.org 2013-01-05 22:53:26.000000000 +0200
++++ projects/stargazer/Makefile 2013-01-05 22:54:52.000000000 +0200
+@@ -92,30 +92,8 @@
+ mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/stargazer/conf-available.d
+ mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/stargazer/conf-enabled.d
+ install -m $(DATA_MODE) -o $(OWNER) $(ETC_DIR)/stargazer.conf $(PREFIX)/etc/stargazer/stargazer.conf
+- install -m $(DATA_MODE) -o $(OWNER) $(ETC_DIR)/conf-available.d/*.conf $(PREFIX)/etc/stargazer/conf-available.d
+- ln -sf ../conf-available.d/mod_ao.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_ao.conf
+- ln -sf ../conf-available.d/mod_ia.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_ia.conf
+- ln -sf ../conf-available.d/mod_ping.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_ping.conf
+- ln -sf ../conf-available.d/mod_sg.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_sg.conf
+- ln -sf ../conf-available.d/store_files.conf $(PREFIX)/etc/stargazer/conf-enabled.d/store_files.conf
+-
+-ifeq ($(OS),linux)
+- ln -sf ../conf-available.d/mod_cap_ether.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_cap_ether.conf
+-else
+- ln -sf ../conf-available.d/mod_cap_bpf.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_cap_bpf.conf
+-endif
+-
+ install -m $(DATA_MODE) -o $(OWNER) $(ETC_DIR)/rules $(PREFIX)/etc/stargazer/rules
+ install -m $(BIN_MODE) -o $(OWNER) $(ETC_DIR)/On* $(PREFIX)/etc/stargazer/
+-
+- # Install file db
+- mkdir -m $(DIR_MODE) -p $(PREFIX)/var/stargazer/admins
+- mkdir -m $(DIR_MODE) -p $(PREFIX)/var/stargazer/tariffs
+- mkdir -m $(DIR_MODE) -p $(PREFIX)/var/stargazer/users/test
+- install -m $(DATA_MODE) -o $(OWNER) $(VAR_DIR)/admins/admin.adm $(PREFIX)/var/stargazer/admins/admin.adm
+- install -m $(DATA_MODE) -o $(OWNER) $(VAR_DIR)/tariffs/tariff.tf $(PREFIX)/var/stargazer/tariffs/tariff.tf
+- install -m $(DATA_MODE) -o $(OWNER) $(VAR_DIR)/users/test/conf $(PREFIX)/var/stargazer/users/test/conf
+- install -m $(DATA_MODE) -o $(OWNER) $(VAR_DIR)/users/test/stat $(PREFIX)/var/stargazer/users/test/stat
+
+ uninstall: uninstall-bin uninstall-data
+
+--- projects/rscriptd/Makefile.org 2013-01-19 17:03:42.000000000 +0200
++++ projects/rscriptd/Makefile 2013-01-19 17:04:25.000000000 +0200
+@@ -65,15 +65,13 @@
+ $(MAKE) -C $(DIR_LIBSRC) install
+
+ install-data:
+- # Install etc
+- mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd
+- install -m $(DATA_MODE) -o $(OWNER) ./rscriptd.conf $(PREFIX)/etc/rscriptd/rscriptd.conf
++ install -D -m $(DATA_MODE) -o $(OWNER) ./rscriptd.conf $(PREFIX)/etc/stargazer/rscriptd.conf
+ ifeq ($(OS), linux)
+- install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
+- install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/
++ install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnConnect $(PREFIX)/etc/stargazer/
++ install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnDisconnect $(PREFIX)/etc/stargazer/
+ else
+- install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
+- install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/
++ install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnConnect $(PREFIX)/etc/stargazer/
++ install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnDisconnect $(PREFIX)/etc/stargazer/
+ endif
+
+ uninstall: uninstall-bin uninstall-data
+--- projects/rlm_stg/Makefile.org 2013-02-03 14:02:58.000000000 +0200
++++ projects/rlm_stg/Makefile 2013-02-03 14:05:43.000000000 +0200
+@@ -56,19 +56,11 @@
+ install: install-bin
+
+ install-bin:
+-ifeq ($(DEBUG), yes)
+ ifeq ($(OS), linux)
+ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
+ else
+ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/$(PROG)
+ endif
+-else
+-ifeq ($(OS), linux)
+- install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
+-else
+- install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG)
+-endif
+-endif
+ $(MAKE) -C $(DIR_LIBSRC) install
+
+ uninstall: uninstall-bin
+--- projects/rscriptd/Makefile.org 2013-02-03 14:17:01.000000000 +0200
++++ projects/rscriptd/Makefile 2013-02-03 14:17:32.000000000 +0200
+@@ -57,11 +57,7 @@
+ install: install-bin install-data
+
+ install-bin:
+-ifeq ($(DEBUG), yes)
+ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
+-else
+- install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
+-endif
+ $(MAKE) -C $(DIR_LIBSRC) install
+
+ install-data:
+--- projects/sgauth/Makefile.org 2013-02-03 14:18:37.000000000 +0200
++++ projects/sgauth/Makefile 2013-02-03 14:18:48.000000000 +0200
+@@ -58,11 +58,7 @@
+ install: install-bin install-data
+
+ install-bin:
+-ifeq ($(DEBUG), yes)
+ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
+-else
+- install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
+-endif
+ $(MAKE) -C $(DIR_LIBSRC) install
+
+ install-data:
+--- projects/sgconf/Makefile.org 2013-02-03 14:19:18.000000000 +0200
++++ projects/sgconf/Makefile 2013-02-03 14:19:28.000000000 +0200
+@@ -66,11 +66,7 @@
+ install: install-bin
+
+ install-bin:
+-ifeq ($(DEBUG), yes)
+ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG)
+-else
+- install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG)
+-endif
+ $(MAKE) -C $(DIR_LIBSRC) install
+
+ uninstall: uninstall-bin
+--- projects/sgconf_xml/Makefile.org 2013-02-03 14:19:53.000000000 +0200
++++ projects/sgconf_xml/Makefile 2013-02-03 14:19:59.000000000 +0200
+@@ -66,11 +66,7 @@
+ install: install-bin install-data
+
+ install-bin:
+-ifeq ($(DEBUG), yes)
+ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG)
+-else
+- install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG)
+-endif
+ $(MAKE) -C $(DIR_LIBSRC) install
+
+ uninstall: uninstall-bin uninstall-data
+--- projects/sgconv/Makefile.org 2013-02-03 14:20:24.000000000 +0200
++++ projects/sgconv/Makefile 2013-02-03 14:20:33.000000000 +0200
+@@ -61,11 +61,7 @@
+ install: install-bin
+
+ install-bin:
+-ifeq ($(DEBUG), yes)
+ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG)
+-else
+- install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG)
+-endif
+ $(MAKE) -C $(DIR_PLUGINS) install
+
+ uninstall: uninstall-bin
+--- projects/stargazer/Makefile.org 2013-02-03 14:20:56.000000000 +0200
++++ projects/stargazer/Makefile 2013-02-03 14:21:30.000000000 +0200
+@@ -77,11 +77,7 @@
+ install: install-bin install-data
+
+ install-bin: $(PROG)
+-ifeq ($(DEBUG), yes)
+ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
+-else
+- install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
+-endif
+ $(MAKE) -C $(DIR_INCLUDE) install
+ $(MAKE) -C $(DIR_LIBSRC) install
+ $(MAKE) -C $(DIR_PLUGINS) install
+--- stglibs/Makefile.in.org 2013-02-03 14:53:02.000000000 +0200
++++ stglibs/Makefile.in 2013-02-03 14:53:11.000000000 +0200
+@@ -35,11 +35,7 @@
+ rm -f deps $(PROG) *.o *.a *.so tags *.*~
+
+ install: $(PROG)
+-ifeq ($(DEBUG), yes)
+ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/stg/$(PROG)
+-else
+- install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/stg/$(PROG)
+-endif
+ mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/include/stg
+ install -m $(DATA_MODE) -o $(OWNER) $(addprefix include/stg/,$(INCS)) $(PREFIX)/usr/include/stg/
+
+--- projects/stargazer/plugins/Makefile.in.org 2013-02-03 15:38:41.000000000 +0200
++++ projects/stargazer/plugins/Makefile.in 2013-02-03 15:38:51.000000000 +0200
+@@ -28,11 +28,7 @@
+
+ install: $(PROG)
+ mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/stg
+-ifeq ($(DEBUG), yes)
+ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/stg/$(PROG)
+-else
+- install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/stg/$(PROG)
+-endif
+
+ uninstall:
+ rm -f $(PREFIX)/usr/lib/stg/$(PROG)
diff --git a/net-misc/stargazer/files/patches/stg-2.408-on-upstream.patch b/net-misc/stargazer/files/patches/stg-2.408-on-upstream.patch
new file mode 100644
index 000000000000..4afbb0340253
--- /dev/null
+++ b/net-misc/stargazer/files/patches/stg-2.408-on-upstream.patch
@@ -0,0 +1,151 @@
+--- projects/stargazer/inst/linux/etc/stargazer/OnChange.org 2013-01-09 14:30:32.000000000 +0200
++++ projects/stargazer/inst/linux/etc/stargazer/OnChange 2013-01-09 15:50:01.000000000 +0200
+@@ -1,8 +1,20 @@
+ #! /bin/sh
+
+-login=$1
+-param=$2
+-oldValue=$3
+-newValue=$4
++# About: This script is called when user account is changed.
++# Common Task: Notify about various events.
++# Priority: optional
+
+-#echo "User: '$login'. Parameter $param changed from '$oldValue' to '$newValue'" >> /var/stargazer/users.chg.log
+\ No newline at end of file
++# User login
++LOGIN=$1
++
++# User parameter
++PARAMETER=$2
++
++# User parameter old value
++OLDVALUE=$3
++
++# User parameter new value
++NEWVALUE=$4
++
++# Usage examples:
++#echo "User: '$LOGIN'. Parameter $PARAMETER changed from '$OLDVALUE' to '$NEWVALUE'" >> /var/stargazer/user.change.log
+\ No newline at end of file
+--- projects/stargazer/inst/linux/etc/stargazer/OnConnect.org 2013-01-09 14:39:51.000000000 +0200
++++ projects/stargazer/inst/linux/etc/stargazer/OnConnect 2013-01-09 15:11:49.000000000 +0200
+@@ -1,24 +1,23 @@
+ #! /bin/sh
+
+-#Этот скрипт вызывается в момент, когда пользователь
+-#успешно прошел авторизацию на сервере. Задача скрипта - перестроить
+-#файрвол так, что бы пользователь получил доступ в интернет
++# About: This script is called when the user successfully authenticated on the server.
++# Common Task: Rebuild firewall to allow user to access the Internet.
++# Priority: required
+
+-# Login
++# User login
+ LOGIN=$1
+
+-#user IP
++# User IP
+ IP=$2
+
+-#cash
++# User cash
+ CASH=$3
+
+-#user ID
++# User ID
+ ID=$4
+
+-#Selected dirs to connect
++# Selected DIRs (from rules file) to connect
+ DIRS=$5
+
+-
+-#echo "C `date +%Y.%m.%d-%H.%M.%S` $IP $CASH" >> /var/stargazer/users/$LOGIN/connect.log
+-
++# Usage examples:
++#echo "Connected `date +%Y.%m.%d-%H.%M.%S` $IP $CASH" >> /var/stargazer/users/$LOGIN/connect.log
+\ No newline at end of file
+--- projects/stargazer/inst/linux/etc/stargazer/OnDisconnect.org 2013-01-09 14:54:36.000000000 +0200
++++ projects/stargazer/inst/linux/etc/stargazer/OnDisconnect 2013-01-09 15:11:33.000000000 +0200
+@@ -1,24 +1,23 @@
+ #! /bin/sh
+
+-# Этот скрипт вызывается в момент, когда пользователь
+-# желает отключится от интернета или вышел таймаут у пользователя
+-# и сервер сам отключает пользователя
+-# Задача скрипта подобна задаче скрипта OnConnect - перестроить
+-# файрвол так, что бы пользователю закрыть доступ в интернет
++# About: This script is called when the user wants to disconnect or authorization timeout has passed.
++# Common task: Rebuild firewall to disallow user to access to the Internet.
++# Priority: required
+
+-# Login
++# User login
+ LOGIN=$1
+
+-#user IP
++# User IP
+ IP=$2
+
+-#cash
++# User cash
+ CASH=$3
+
+-#user ID
++# User ID
+ ID=$4
+
+-#Selected dirs to disconnect
++# Selected DIRs (from rules file) to disconnect
+ DIRS=$5
+
+-#echo "D `date +%Y.%m.%d-%H.%M.%S` $IP $CASH" >> /var/stargazer/users/$LOGIN/connect.log
++# Usage examples:
++#echo "Disconnected `date +%Y.%m.%d-%H.%M.%S` $IP $CASH" >> /var/stargazer/users/$LOGIN/connect.log
+\ No newline at end of file
+--- projects/stargazer/inst/linux/etc/stargazer/OnUserAdd.org 2013-01-09 15:01:57.000000000 +0200
++++ projects/stargazer/inst/linux/etc/stargazer/OnUserAdd 2013-01-09 15:10:55.000000000 +0200
+@@ -1,14 +1,12 @@
+ #! /bin/sh
+
+-# Использование (неиспользование) этого скрипта дело вкуса.
+-# Он не выполняет критических функций. Его задача автматизировать
+-# действия характерные при добавлении пользователя сети, например добавлекние
+-# пользователю почты
+-
+-# Login
+-login=$1
+-
+-#echo "added user $login" >> /var/stargazer/add_del.log
+-
++# About: This script is called when the user is added to the Stargazer.
++# Common task: Automate typical actions on adding user to the network,
++# such as creating email or IM account.
++# Priority: optional
+
++# User login
++LOGIN=$1
+
++# Usage examples:
++#echo "Added user $login" >> /var/stargazer/add_del.log
+\ No newline at end of file
+--- projects/stargazer/inst/linux/etc/stargazer/OnUserDel.org 2013-01-09 15:12:32.000000000 +0200
++++ projects/stargazer/inst/linux/etc/stargazer/OnUserDel 2013-01-09 15:14:10.000000000 +0200
+@@ -1,7 +1,13 @@
+ #! /bin/sh
+
+-# Login
+-login=$1
++# About: This script is called when the user is removed from the Stargazer.
++# Common task: Automate typical actions on removing user from the network,
++# such as removing email or IM account.
++# Priority: optional
+
+-#echo "deleted user $login" >> /var/stargazer/add_del.log
++# User login
++LOGIN=$1
++
++# Usage examples:
++#echo "Deleted user $LOGIN" >> /var/stargazer/add_del.log
+
diff --git a/net-misc/stargazer/files/patches/stg-2.408-radius-upstream.patch b/net-misc/stargazer/files/patches/stg-2.408-radius-upstream.patch
new file mode 100644
index 000000000000..790cc3a91e1e
--- /dev/null
+++ b/net-misc/stargazer/files/patches/stg-2.408-radius-upstream.patch
@@ -0,0 +1,31 @@
+--- projects/rlm_stg/Makefile.org 2013-01-18 16:17:18.000000000 +0200
++++ projects/rlm_stg/Makefile 2013-01-18 16:19:13.000000000 +0200
+@@ -57,16 +57,28 @@
+
+ install-bin:
+ ifeq ($(DEBUG), yes)
++ifeq ($(OS), linux)
+ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
+ else
++ install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/$(PROG)
++endif
++else
++ifeq ($(OS), linux)
+ install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
++else
++ install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG)
++endif
+ endif
+ $(MAKE) -C $(DIR_LIBSRC) install
+
+ uninstall: uninstall-bin
+
+ uninstall-bin:
++ifeq ($(OS), linux)
+ rm -f $(PREFIX)/usr/lib/freeradius/$(PROG)
++else
++ rm -f $(PREFIX)/usr/lib/$(PROG)
++endif
+
+ ifneq ($(MAKECMDGOALS),distclean)
+ ifneq ($(MAKECMDGOALS),clean)
diff --git a/net-misc/stargazer/files/patches/stg-2.408-rscriptd-upstream.patch b/net-misc/stargazer/files/patches/stg-2.408-rscriptd-upstream.patch
new file mode 100644
index 000000000000..4e97da2f80e3
--- /dev/null
+++ b/net-misc/stargazer/files/patches/stg-2.408-rscriptd-upstream.patch
@@ -0,0 +1,26 @@
+--- projects/rscriptd/Makefile.org 2013-01-18 16:22:46.000000000 +0200
++++ projects/rscriptd/Makefile 2013-01-18 16:25:08.000000000 +0200
+@@ -68,6 +68,13 @@
+ # Install etc
+ mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd
+ install -m $(DATA_MODE) -o $(OWNER) ./rscriptd.conf $(PREFIX)/etc/rscriptd/rscriptd.conf
++ifeq ($(OS), linux)
++ install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
++ install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/
++else
++ install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
++ install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/
++endif
+
+ uninstall: uninstall-bin uninstall-data
+
+@@ -77,7 +84,8 @@
+ uninstall-data:
+ # Uninstall etc
+ rm -f $(PREFIX)/etc/rscriptd/rscriptd.conf
+-
++ rm -f $(PREFIX)/etc/rscriptd/OnConnect
++ rm -f $(PREFIX)/etc/rscriptd/OnDisconnect
+
+ ifneq ($(MAKECMDGOALS),distclean)
+ ifneq ($(MAKECMDGOALS),clean)
diff --git a/net-misc/stargazer/files/patches/stg-2.408-rscriptd.conf-upstream.patch b/net-misc/stargazer/files/patches/stg-2.408-rscriptd.conf-upstream.patch
new file mode 100644
index 000000000000..21746e59e8d1
--- /dev/null
+++ b/net-misc/stargazer/files/patches/stg-2.408-rscriptd.conf-upstream.patch
@@ -0,0 +1,80 @@
+--- projects/rscriptd/rscriptd.conf.org 2013-01-12 15:44:46.000000000 +0200
++++ projects/rscriptd/rscriptd.conf 2013-01-12 15:45:44.000000000 +0200
+@@ -1,8 +1,68 @@
+-LogFileName=/var/log/rscriptd.log
+-ExecutersNum=1
+-ConfigDir=/etc/rscriptd
+-Password=123456
+-Port=9999
+-UserTimeout=60
+-ScriptOnConnect=/etc/stargazer/OnConnect
+-ScriptOnDisconnect=/etc/stargazer/OnDisconnect
++################################################################################
++# Rscriptd Configuration file #
++################################################################################
++
++# LOG file name
++# Parameter: optional
++# Value: file path
++# Default: /var/log/rscriptd.log
++LogFileName = /var/log/rscriptd.log
++
++# Amount of rscriptd-exec processes.
++# These processes are responsible for the execution of scripts
++# OnConnect and OnDisconnect.
++# Amount of processes means how many scripts can be executed simultaneously.
++# Recommend to leave 1 to avoid errors when executing scripts
++# Parameter: optional
++# Value: 1 ... 1024
++# Default: 1
++ExecutersNum = 1
++
++# Message queue identifier for the script executer.
++# It may be changed if there're a needs to run multiple copies of rscriptd.
++# Warning: If you do not understand it, do not touch this setting!
++# Parameter: optional
++# Value: 0 ... 2 ^ 32
++# Default: 5555
++# ExecMsgKey = 5555
++
++# The path to directory where config files are
++# Parameter: optional
++# Value: directory path
++# Default: /etc/rscriptd
++ConfigDir = /etc/rscriptd
++
++# Defines password for the encryption exchange between
++# Stargazer server and rscriptd.
++# Parameter: optional
++# Value: any
++# Default: 123456
++Password = 123456
++
++# Defines port number for communication between
++# Stargazer server and rscriptd.
++# Parameter: optional
++# Value: 1 ... 65535
++# Default: 9999
++Port = 9999
++
++# User timeout. If Stargazer does not respond during this time,
++# the user will be disconnected.
++# Parameter: optional
++# Values: 5 ... 600
++# Default: 60
++UserTimeout = 60
++
++# Defines file which runs when user gets access
++# Parameter: optional
++# Value: file path
++# Default: /etc/rscriptd/OnConnect
++ScriptOnConnect = /etc/rscriptd/OnConnect
++
++# Defines file which runs when user loses access
++# Parameter: optional
++# Value: file path
++# Default: /etc/rscriptd/OnDisconnect
++ScriptOnDisconnect = /etc/rscriptd/OnDisconnect
++
++################################################################################
+\ No newline at end of file
diff --git a/net-misc/stargazer/files/patches/stg-2.408-sgauth.conf-upstream.patch b/net-misc/stargazer/files/patches/stg-2.408-sgauth.conf-upstream.patch
new file mode 100644
index 000000000000..213d35fd2db7
--- /dev/null
+++ b/net-misc/stargazer/files/patches/stg-2.408-sgauth.conf-upstream.patch
@@ -0,0 +1,112 @@
+--- projects/sgauth/sgauth.conf.org 2013-01-08 15:43:09.000000000 +0200
++++ projects/sgauth/sgauth.conf 2013-01-09 13:41:53.000000000 +0200
+@@ -1,37 +1,72 @@
+-#Stargazer server ip
+-ServerName=192.168.1.2
++################################################################################
++# Sgauth Configuration file #
++################################################################################
++
++# Stargazer server
++# Parameter: required
++# Values: IP address or DNS name
++# Default:
++ServerName = 192.168.1.2
++
++# Port on which Stargazer interacts with sgauth
++# Parameter: optional
++# Value: 1 ... 65535
++# Default: 5555
++ServerPort = 5555
++
++# User's login in Stargazer
++# Parameter: required
++# Value: any
++# Default:
++Login = test
++
++# Port on which sgauth interacts with Stargazer
++# Parameter: optional
++# Value: 1 ... 65535
++# Default: 0
++LocalPort = 12345
++
++# User's password in Stargazer
++# Parameter: required
++# Value: any
++# Default:
++Password = 123456
++
++# Defines should sgauth try to reestablish connection to Stargazer
++# if it was lost
++# Parameter: optional
++# Value: yes, no
++# Default: yes
++Reconnect = yes
++
++# Defines should sgauth run as daemon
++# Parameter: optional
++# Value: yes, no
++# Default: yes
++Daemon = yes
++
++# Web-page refresh period in built-in webserver
++# Parameter: optional
++# Value: any numeric (minutes)
++# Default: 10
++RefreshPeriod = 10
++
++# Defines should sgauth use built-in webserver
++# Parameter: optional
++# Value: yes, no
++# Default: no
++DisableWeb = no
++
++# Defines address on which sgauth's built-in webserver will listen
++# Parameter: optional
++# Value: IP address or DNS name
++# Default: 127.0.0.1
++ListenWebIP = 127.0.0.1
++
++# Defines should sgauth show it process ID in process list
++# Parameter: optional
++# Value: yes, no
++# Default: no
++ShowPid = no
+
+-#Stargazer server port
+-#Default value 5555
+-ServerPort=5555
+-
+-#User's login
+-Login=test
+-
+-#
+-#
+-LocalPort=12345
+-
+-#User's password
+-Password=1234567
+-
+-#
+-#Default value yes
+-#Reconnect=no
+-
+-#
+-#Default value yes
+-#Daemon=yes
+-
+-#Refresh web page period
+-#Default value 10
+-#RefreshPeriod=10
+-
+-#
+-#Default value 127.0.0.1
+-ListenWebIP=127.0.0.1
+-
+-#Default value no
+-DisableWeb=no
+-
+-#ShowPid=no
++################################################################################
+\ No newline at end of file
diff --git a/net-misc/stargazer/files/patches/stg-2.408-sgconv-upstream.patch b/net-misc/stargazer/files/patches/stg-2.408-sgconv-upstream.patch
new file mode 100644
index 000000000000..cfce675b1287
--- /dev/null
+++ b/net-misc/stargazer/files/patches/stg-2.408-sgconv-upstream.patch
@@ -0,0 +1,40 @@
+--- projects/sgconv/Makefile.org 2013-01-08 12:07:06.000000000 +0200
++++ projects/sgconv/Makefile 2013-01-08 12:07:11.000000000 +0200
+@@ -4,7 +4,7 @@
+
+ include ../../Makefile.conf
+
+-PROG = convertor
++PROG = sgconv
+
+ SRCS = ./main.cpp \
+ ./settings_impl.cpp
+--- projects/sgconv/build.org 2012-02-09 12:26:57.000000000 +0200
++++ projects/sgconv/build 2013-01-08 12:10:02.000000000 +0200
+@@ -45,13 +45,13 @@
+ if [ "$OS" = "unknown" ]
+ then
+ echo "#############################################################################"
+- echo "# Sorry, but convertor currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #"
++ echo "# Sorry, but sgconv currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #"
+ echo "#############################################################################"
+ exit 1
+ fi
+
+ echo "#############################################################################"
+-echo " Building convertor for $sys $release"
++echo " Building sgconv for $sys $release"
+ echo "#############################################################################"
+
+ STG_LIBS="logger.lib
+--- projects/sgconv/settings_impl.h.org 2013-01-08 12:11:53.000000000 +0200
++++ projects/sgconv/settings_impl.h 2013-01-08 12:11:58.000000000 +0200
+@@ -38,7 +38,7 @@
+
+ class SETTINGS_IMPL {
+ public:
+- SETTINGS_IMPL() : confFile("./convertor.conf") {}
++ SETTINGS_IMPL() : confFile("./sgconv.conf") {}
+ SETTINGS_IMPL(const std::string & cf) : confFile(cf) {}
+ ~SETTINGS_IMPL() {}
+ int ReadSettings();
diff --git a/net-misc/stargazer/files/patches/stg-2.408-static-libs.patch b/net-misc/stargazer/files/patches/stg-2.408-static-libs.patch
new file mode 100644
index 000000000000..723d177ac79a
--- /dev/null
+++ b/net-misc/stargazer/files/patches/stg-2.408-static-libs.patch
@@ -0,0 +1,10 @@
+--- stglibs/Makefile.org 2013-01-19 18:21:57.000000000 +0200
++++ stglibs/Makefile 2013-01-19 18:24:25.000000000 +0200
+@@ -15,6 +15,6 @@
+
+ clean: all
+
+-install: all
++install:
+
+ uninstall: all
diff --git a/net-misc/stargazer/files/rscriptd b/net-misc/stargazer/files/rscriptd
new file mode 100644
index 000000000000..d8ddf44f696e
--- /dev/null
+++ b/net-misc/stargazer/files/rscriptd
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+
+DAEMON=/usr/sbin/rscriptd
+RSCRIPTD_OPTS="/etc/stargazer/rscriptd.conf"
+PIDFILE="/run/rscriptd.pid"
+
+depend() {
+ need net
+ provide rscriptd
+}
+
+start() {
+ ebegin "Starting rscriptd"
+ start-stop-daemon --start --quiet --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} -- ${RSCRIPTD_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping rscriptd"
+ start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
+ rm -f ${PIDFILE}
+ eend $?
+} \ No newline at end of file
diff --git a/net-misc/stargazer/files/sgauth b/net-misc/stargazer/files/sgauth
new file mode 100644
index 000000000000..0dec60bfa1af
--- /dev/null
+++ b/net-misc/stargazer/files/sgauth
@@ -0,0 +1,27 @@
+#!/sbin/openrc-run
+
+DAEMON=/usr/sbin/sgauth
+SGAUTH_OPTS="/etc/stargazer/sgauth.conf"
+PIDFILE="/run/sgauth.pid"
+
+depend() {
+ need net
+ provide sgauth
+}
+
+start() {
+ ebegin "Starting sgauth"
+ start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- ${SGAUTH_OPTS}
+ eend $?
+}
+
+start_post() {
+ pgrep -n $RC_SVCNAME > ${PIDFILE}
+}
+
+stop() {
+ ebegin "Stopping sgauth"
+ start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
+ rm -f ${PIDFILE}
+ eend $?
+} \ No newline at end of file
diff --git a/net-misc/stargazer/metadata.xml b/net-misc/stargazer/metadata.xml
new file mode 100644
index 000000000000..92c0c7692cce
--- /dev/null
+++ b/net-misc/stargazer/metadata.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>spiderx@spiderx.dp.ua</email>
+ <name>Vladimir Pavljuchenkov</name>
+ <description>Primary maintainer.</description>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ 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).
+ This ebuild allows you to compile it yourself depending of your needs.
+ </longdescription>
+ <use>
+ <flag name="sgconv">Enable build of utility to convert Stargazer data between storage backends.</flag>
+ <flag name="radius">Enable build of FreeRADIUS module for data access via Stargazer.</flag>
+ <flag name="rscriptd">Enable build of remote script execute daemon for Stargazer, which run scripts when receive special signal from Stargazer.</flag>
+ <flag name="sgauth">Enable build of command-line utility for authorization in Stargazer.</flag>
+ <flag name="sgconf">Enable build of command-line utility for configuring Stargazer.</flag>
+ <flag name="sgconf_xml">Enable build of command-line xml-based utility for configuring Stargazer.</flag>
+ <flag name="stargazer">Enable build of Stargazer billing system.</flag>
+ <flag name="debug">Enable extra debug codepaths, like asserts and extra output.</flag>
+ <flag name="doc">Adds extra documentation (API, doc, etc).</flag>
+ <flag name="examples">Install examples, usually source code.</flag>
+ <flag name="static-libs">Install static libraries.</flag>
+ <flag name="module_auth_always_online">Enable build of "Always Online" authentication module for Stargazer.</flag>
+ <flag name="module_auth_internet_access">Enable build of "InetAccess" authentication module for Stargazer. InetAccess is a Stargazer specific authentication protocol.</flag>
+ <flag name="module_auth_freeradius">Enable build of "Radius" authentication module for Stargazer. This module capable of using RADIUS procotol for user authentication.</flag>
+ <flag name="module_capture_ether">Enable build of "Ethernet" traffic capture module for Stargazer. This module uses RAW sockets to capture traffic.</flag>
+ <flag name="module_capture_ipq">Enable build of "IPQ" traffic capture module for Stargazer. This module uses IPQ subsystem to capture traffic.</flag>
+ <flag name="module_capture_netflow">Enable build of "NetFlow" traffic capture module for Stargazer. This module capable of receiving traffic data by NetFlow protocol.</flag>
+ <flag name="module_config_rpcconfig">Enable build of "XMLRPC" configuration module for Stargazer. This module uses XML-RPC protocol for configuring Stargazer.</flag>
+ <flag name="module_config_sgconfig">Enable build of "SGConf" configuration module for Stargazer. This module uses Stargazer specific protocol for configuring Stargazer.</flag>
+ <flag name="module_other_ping">Enable build of "Ping" module for Stargazer. This module pings connected users from time to time to ensure they are alive.</flag>
+ <flag name="module_other_remote_script">Enable build of "Remote Script" module for Stargazer. This module control rscriptd daemon over the net and makes it execute scripts in reaction to different Stargazer events.</flag>
+ <flag name="module_other_smux">Enable build of SMUX module for Stargazer. This module uses SMUX protocol to provide various information about Stargazer.</flag>
+ <flag name="module_store_files">Enable build of storage plugin for Stargazer based on plain files.</flag>
+ <flag name="module_store_firebird">Enable build of storage plugin for Stargazer, which uses Firebird database for storage.</flag>
+ <flag name="module_store_mysql">Enable build of storage plugin for Stargazer, which uses MySQL for storage.</flag>
+ <flag name="module_store_postgres">Enable build of storage plugin for Stargazer, which uses PostgreSQL for storage.</flag>
+ </use>
+ <upstream>
+ <changelog>http://stg.dp.ua/server_dl.php</changelog>
+ <doc>http://stg.dp.ua/doc.php</doc>
+ <bugs-to>mailto:faust@stg.dp.ua</bugs-to>
+ </upstream>
+</pkgmetadata>
diff --git a/net-misc/stargazer/stargazer-2.408.ebuild b/net-misc/stargazer/stargazer-2.408.ebuild
new file mode 100644
index 000000000000..112fde0575b7
--- /dev/null
+++ b/net-misc/stargazer/stargazer-2.408.ebuild
@@ -0,0 +1,558 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils linux-info multilib user
+
+DESCRIPTION="Billing system for small home and office networks"
+HOMEPAGE="http://stg.dp.ua/"
+LICENSE="GPL-2"
+
+MY_P="stg-${PV}"
+SRC_URI="http://stg.dp.ua/download/server/${PV}/${MY_P}.tar.gz"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+S="${WORKDIR}/${MY_P}"
+
+REQUIRED_USE="stargazer? ( ^^ ( module_store_files module_store_firebird module_store_mysql module_store_postgres ) )"
+
+RDEPEND="module_config_rpcconfig? ( dev-libs/xmlrpc-c[abyss] sys-libs/zlib )
+ module_config_sgconfig? ( dev-libs/expat )
+ module_store_firebird? ( >=dev-db/firebird-2.0.3.12981.0-r6 )
+ module_store_mysql? ( virtual/mysql )
+ module_store_postgres? ( dev-db/postgresql dev-libs/openssl sys-libs/zlib )
+ sgconf? ( dev-libs/expat )
+ sgconf_xml? ( dev-libs/expat )"
+
+DEPEND="${RDEPEND}
+ doc? ( dev-libs/libxslt )"
+
+PROJECTS="sgconv rlm_stg rscriptd sgauth sgconf sgconf_xml stargazer"
+
+STG_MODULES_AUTH="always_online internet_access freeradius"
+STG_MODULES_CAPTURE="ipq ether netflow"
+STG_MODULES_CONFIG="sgconfig rpcconfig"
+STG_MODULES_OTHER="ping smux remote_script"
+STG_MODULES_STORE="files firebird mysql postgres"
+
+declare -A MODULES
+MODULES=( [module_auth_always_online]="authorization\/ao:mod_ao"
+ [module_auth_internet_access]="authorization\/inetaccess:mod_ia"
+ [module_auth_freeradius]="other\/radius:mod_radius"
+ [module_capture_ipq]="capture\/ipq_linux:mod_cap_ipq"
+ [module_capture_ether]="capture\/ether_linux:mod_cap_ether"
+ [module_capture_netflow]="capture\/cap_nf:mod_cap_nf"
+ [module_config_sgconfig]="configuration\/sgconfig:mod_sg"
+ [module_config_rpcconfig]="configuration\/rpcconfig:mod_rpc"
+ [module_other_ping]="other\/ping:mod_ping"
+ [module_other_smux]="other\/smux:mod_smux"
+ [module_other_remote_script]="other\/rscript:mod_remote_script"
+ [module_store_files]="store\/files:store_files"
+ [module_store_firebird]="store\/firebird:store_firebird"
+ [module_store_mysql]="store\/mysql:store_mysql"
+ [module_store_postgres]="store\/postgresql:store_postgresql"
+)
+
+IUSE="sgconv radius rscriptd sgauth sgconf sgconf_xml stargazer debug doc examples static-libs"
+
+for module in ${STG_MODULES_AUTH} ; do IUSE="${IUSE} module_auth_${module}" ; done
+for module in ${STG_MODULES_CAPTURE} ; do IUSE="${IUSE} module_capture_${module}" ; done
+for module in ${STG_MODULES_CONFIG} ; do IUSE="${IUSE} module_config_${module}" ; done
+for module in ${STG_MODULES_OTHER} ; do IUSE="${IUSE} module_other_${module}" ; done
+for module in ${STG_MODULES_STORE} ; do IUSE="${IUSE} module_store_${module}" ; done
+
+IUSE=${IUSE/stargazer/+stargazer}
+IUSE=${IUSE/module_store_files/+module_store_files}
+
+src_prepare() {
+ # Patches already in upstream's trunk
+ # Rename convertor to sgconv to avoid possible file name collisions
+ mv "${S}"/projects/convertor/ "${S}"/projects/sgconv/ || die "Couldn't move convertor folder"
+ mv "${S}"/projects/sgconv/convertor.conf "${S}"/projects/sgconv/sgconv.conf || die "Couldn't move convertor config"
+ epatch "${FILESDIR}"/patches/stg-2.408-sgconv-upstream.patch
+
+ # Fix dependency on fbclient for module_store_firebird
+ epatch "${FILESDIR}"/patches/stg-2.408-makefile-firebird-upstream.patch
+
+ # Debug support. Install radius lib to /usr/lib/freeradius
+ epatch "${FILESDIR}"/patches/stg-2.408-makefile-build-upstream.patch
+
+ # Don't compile sgconv always with debug. Remove MAKEOPTS=-j1
+ epatch "${FILESDIR}"/patches/stg-2.408-build-upstream.patch
+
+ # Rewrite config for rscriptd
+ epatch "${FILESDIR}"/patches/stg-2.408-rscriptd.conf-upstream.patch
+
+ # Rewrite config for sgauth
+ epatch "${FILESDIR}"/patches/stg-2.408-sgauth.conf-upstream.patch
+
+ # Standardization of 'On-scripts'
+ epatch "${FILESDIR}"/patches/stg-2.408-on-upstream.patch
+
+ # FreeBSD install directory
+ epatch "${FILESDIR}"/patches/stg-2.408-radius-upstream.patch
+
+ # Install demo scripts for rscriptd
+ epatch "${FILESDIR}"/patches/stg-2.408-rscriptd-upstream.patch
+
+ # Fix crush on stop
+ epatch "${FILESDIR}"/patches/stg-2.408-fix-crash-on-stop.patch
+
+ for project in ${PROJECTS} ; do
+ # Rename build script to configure for further econf launch in every projects
+ mv "${S}"/projects/${project}/build "${S}"/projects/${project}/configure || die "Couldn't move build folder for ${project}"
+
+ # Change check for debug build
+ sed -i 's/if \[ "$1" = "debug" \]/if \[ "${10}" = "--enable-debug" \]/' "${S}"/projects/${project}/configure || die "sed for debug check failed"
+ done
+
+ # Correct working directory, user and group for sgconv.conf, store_files.conf
+ # Correct paths for rscriptd.conf, store_firebird.conf, mod_remote_scriptd.conf, stargazer.conf, rpcconfig.cpp, 00-base-00.sql
+ epatch "${FILESDIR}"/patches/stg-2.408-correct-paths.patch
+
+ # Correct target install-data for stargazer, rscriptd, sgauth, remove debug symbols stripping
+ epatch "${FILESDIR}"/patches/stg-2.408-makefile.patch
+
+ # Remove make from script (for keeping symbols), always add variable to Makefile.conf for all projects
+ epatch "${FILESDIR}"/patches/stg-2.408-build.patch
+
+ # Remove static-libs if not needed
+ use static-libs || epatch "${FILESDIR}"/patches/stg-2.408-static-libs.patch
+
+ # Define which module to compile
+ for module in ${!MODULES[@]} ; do
+ if ! use $module ; then
+ sed -i "s/${MODULES[$module]%:*}//" "${S}"/projects/stargazer/configure || die "sed for module configure failed"
+ fi
+ done
+
+ # Correct Gentoo init script provided by upstream (TODO: Remove in further releases, already fixed in upstream's trunk)
+ if use stargazer ; then
+ sed -i 's/opts/extra_commands/' "${S}"/projects/stargazer/inst/linux/etc/init.d/stargazer.gentoo || die "sed for stargazer failed"
+ fi
+
+ # Correct Gentoo init script dependencies
+ if use module_store_files ; then
+ sed -i '11d' "${S}"/projects/stargazer/inst/linux/etc/init.d/stargazer.gentoo || die "sed for module_store_files failed"
+ fi
+
+ if use module_store_firebird ; then
+ sed -i '11d;s/need net/need net firebird/' "${S}"/projects/stargazer/inst/linux/etc/init.d/stargazer.gentoo || die "sed for module_store_firebird failed"
+ fi
+
+ if use module_store_mysql ; then
+ sed -i '11d;s/need net/need net mysql/' "${S}"/projects/stargazer/inst/linux/etc/init.d/stargazer.gentoo || die "sed for module_store_mysql failed"
+ fi
+
+ if use module_store_postgres ; then
+ sed -i '11d;s/need net/need net postgresql/' "${S}"/projects/stargazer/inst/linux/etc/init.d/stargazer.gentoo || die "sed for module_store_postgres failed"
+ fi
+
+ # Check for IPQ subsystem availability
+ ( use module_capture_ipq && kernel_is ge 3 5 ) && die "IPQ subsystem is gone since Linux kernel 3.5. You can't compile module_capture_ipq with your current kernel."
+
+ epatch_user
+}
+
+src_configure() {
+ # Define local variables, strip '+' symbol for used by default USE flags
+ local USEFLAGS=(${IUSE//+})
+ local PROJECTS=($PROJECTS)
+
+ for (( i = 0 ; i < ${#PROJECTS[@]} ; i++ )) ; do
+ if use ${USEFLAGS[$i]} ; then
+ cd "${S}"/projects/${PROJECTS[$i]} || die "cd to ${PROJECTS[$i]} failed"
+ econf $(use_enable debug)
+ fi
+ done
+}
+
+src_compile() {
+ # Define local variables, strip '+' symbol for used by default USE flags
+ local USEFLAGS=(${IUSE//+})
+ local PROJECTS=($PROJECTS)
+
+ # Set jobs to 1 for debug build
+ use debug && MAKEOPTS="-j1"
+
+ # Build necessary libraries first
+ touch "${S}"/Makefile.conf
+ cd "${S}"/stglibs || die "cd to stglibs failed"
+ emake STG_LIBS="ia.lib srvconf.lib"
+
+ for (( i = 0 ; i < ${#PROJECTS[@]} ; i++ )) ; do
+ if use ${USEFLAGS[$i]} ; then
+ cd "${S}"/projects/${PROJECTS[$i]} || die "cd to ${PROJECTS[$i]} failed"
+ emake
+ fi
+ done
+
+ if use doc ; then
+ cd "${S}"/doc/xmlrpc || die "cd to doc/xmlrpc failed"
+ emake
+ fi
+}
+
+src_install() {
+ dodoc ChangeLog
+
+ if use rscriptd || use stargazer ; then
+ # Install config file for logrotate
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/logrotate stargazer
+
+ # Keeping logs directory
+ diropts -m 755 -o stg -g stg
+ keepdir /var/log/stargazer
+ if use stargazer ; then
+ diropts -m 775 -o stg -g stg
+ keepdir /var/lib/stargazer
+ fi
+ fi
+
+ if use doc ; then
+ # Install files into docs directory
+ dodoc "${S}"/projects/stargazer/inst/var/base.dia
+ dodoc "${S}"/doc/proto_client.gif
+ dodoc "${S}"/doc/proto_server.gif
+
+ # Install html documentation
+ docinto html/xmlrpc
+ dohtml -r "${S}"/doc/xmlrpc/book/
+ fi
+
+ if use examples ; then
+ # Install files into specified directory
+ insinto /usr/share/stargazer
+ doins -r "${S}"/projects/stargazer/scripts
+ doins "${S}"/doc/xmlrpc.php
+ fi
+
+ if use sgconv ; then
+ cd "${S}"/projects/sgconv || die "cd to sgconv project failed"
+
+ emake DESTDIR="${D}" PREFIX="${D}" install
+
+ # Install files into specified directory
+ insinto /etc/stargazer
+ doins "${S}"/projects/sgconv/sgconv.conf
+
+ # Install manual page
+ doman "${FILESDIR}"/mans/sgconv.1
+ fi
+
+ if use radius ; then
+ cd "${S}"/projects/rlm_stg || die "cd to rlm_stg project failed"
+
+ emake DESTDIR="${D}" PREFIX="${D}" install
+ fi
+
+ if use rscriptd ; then
+ cd "${S}"/projects/rscriptd || die "cd to rscriptd project failed"
+
+ emake DESTDIR="${D}" PREFIX="${D}" install
+
+ # Install Gentoo init script
+ doinitd "${FILESDIR}"/rscriptd
+
+ # Correct permissions for file
+ fperms 0640 /etc/stargazer/rscriptd.conf
+
+ # Install manual page
+ doman "${FILESDIR}"/mans/rscriptd.8
+ fi
+
+ if use sgauth ; then
+ cd "${S}"/projects/sgauth || die "cd to sgauth project failed"
+
+ emake DESTDIR="${D}" PREFIX="${D}" install
+
+ # Correct permissions for file
+ fperms 0640 /etc/stargazer/sgauth.conf
+
+ # Install manual page
+ doman "${FILESDIR}"/mans/sgauth.8
+ fi
+
+ if use sgconf ; then
+ cd "${S}"/projects/sgconf || die "cd to sgconf project failed"
+
+ emake DESTDIR="${D}" PREFIX="${D}" install
+
+ # Install manual page
+ doman "${FILESDIR}"/mans/sgconf.1
+ fi
+
+ if use sgconf_xml ; then
+ cd "${S}"/projects/sgconf_xml || die "cd to sgconf_xml project failed"
+
+ emake DESTDIR="${D}" PREFIX="${D}" install
+
+ # Install manual page
+ doman "${FILESDIR}"/mans/sgconf_xml.1
+ fi
+
+ if use stargazer ; then
+ cd "${S}"/projects/stargazer || die "cd to stargazer project failed"
+
+ emake DESTDIR="${D}" PREFIX="${D}" install
+
+ # Install docs
+ dodoc BUGS CHANGES README TODO
+
+ # Install and rename Gentoo init script
+ newinitd "${S}"/projects/stargazer/inst/linux/etc/init.d/stargazer.gentoo stargazer
+
+ # Install manual page
+ doman "${FILESDIR}"/mans/stargazer.8
+
+ # Install files needed for module_store_files
+ if use module_store_files ; then
+ # Install files into specified directory
+ insinto /var/lib
+ doins -r "${S}"/projects/stargazer/inst/var/stargazer
+
+ # Correct user and group for files and directories
+ fowners -R stg:stg /var/lib/stargazer
+ fi
+
+ if use module_store_firebird ; then
+ # Install files into specified directory
+ insinto /usr/share/stargazer/db/firebird
+ doins \
+ "${S}"/projects/stargazer/inst/var/00-base-00.sql \
+ "${S}"/projects/stargazer/inst/var/00-alter-01.sql
+ fi
+
+ if use module_store_mysql ; then
+ # Install file into specified directory
+ insinto /usr/share/stargazer/db/mysql
+ doins "${S}"/projects/stargazer/inst/var/00-mysql-01.sql
+ fi
+
+ if use module_store_postgres ; then
+ # Install files into specified directory
+ insinto /usr/share/stargazer/db/postgresql
+ doins \
+ "${S}"/projects/stargazer/inst/var/00-base-00.postgresql.sql \
+ "${S}"/projects/stargazer/inst/var/00-alter-01.postgresql.sql
+ fi
+
+ if use module_other_smux ; then
+ # Install files into specified directory
+ insinto /usr/share/snmp/mibs
+ doins "${S}"/projects/stargazer/plugins/other/smux/STG-MIB.mib
+ fi
+
+ if use module_other_remote_script ; then
+ # Create subnets file based on example from mod_remote_script.conf
+ grep 192 "${S}"/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_remote_script.conf | sed 's/# //' > "${D}"/etc/stargazer/subnets
+
+ # Correct permissions for file
+ fperms 0640 /etc/stargazer/subnets
+ fi
+
+ # Correct permissions for files
+ fperms 0640 \
+ /etc/stargazer/rules \
+ /etc/stargazer/stargazer.conf
+
+ # Install files into specified directory for selected modules
+ insinto /etc/stargazer/conf-available.d
+ insopts -m 0640
+
+ for module in ${!MODULES[@]} ; do
+ use $module && doins "${S}"/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/${MODULES[$module]#*:}.conf
+ done
+
+ # Create symlinks of configs for selected modules
+ for module in ${!MODULES[@]} ; do
+ use $module && dosym /etc/stargazer/conf-available.d/${MODULES[$module]#*:}.conf /etc/stargazer/conf-enabled.d/${MODULES[$module]#*:}.conf
+ done
+ fi
+
+ # Correct user and group for files and directories
+ ( use sgconv || use rscriptd || use sgauth || use stargazer ) && fowners -R stg:stg /etc/stargazer
+
+ # Put the files in the right folder to support multilib
+ if [ ! -e "${ED}"/usr/$(get_libdir) ] ; then
+ mv "${ED}"/usr/lib/ "${ED}"/usr/$(get_libdir) || die "Failed to move library directory for multilib support"
+ fi
+}
+
+pkg_setup() {
+ # Add user and group to system only when necessary
+ if use sgconv || use rscriptd || use sgauth || use stargazer ; then
+ enewgroup stg
+
+ # Add stg user to system (no home directory specified, because otherwise it will be result in stg:root ownership on it)
+ enewuser stg -1 -1 -1 stg
+ fi
+}
+
+pkg_postinst() {
+ if use sgconv ; then
+ einfo "\nSgconv:"
+ einfo "----------"
+ einfo " For further use of sgconv please edit /etc/stargazer/sgconv.conf depending on your needs."
+ fi
+
+ if use radius ; then
+ einfo "\nRadius:"
+ einfo "-------"
+ einfo " For further use of radius, emerge net-dialup/freeradius.\n"
+
+ einfo " Example config:\n"
+
+ einfo " stg {"
+ einfo " local_port = 6667"
+ einfo " server = localhost"
+ einfo " port = 6666"
+ einfo " password = 123456"
+ einfo " }\n"
+
+ einfo " You should place 'stg' into section Instantiate, Authorize."
+ einfo " In section Authentificate 'stg' should go in sub-section Auth-Type before other authentifications modules:\n"
+
+ einfo " Auth-Type PAP {"
+ einfo " stg"
+ einfo " pap"
+ einfo " }\n"
+
+ einfo " It also may be used in section Accounting and Post-Auth."
+
+ use module_auth_freeradius || einfo "\n For use RADIUS data processing you should also enable USE-flag module_auth_freeradius."
+ fi
+
+ if use rscriptd ; then
+ einfo "\nRemote Script Executer:"
+ einfo "-----------------------"
+ einfo " For further use of rscriptd please edit /etc/stargazer/rscriptd.conf depending on your needs."
+ einfo " You have to change 'Password' field at least."
+ fi
+
+ if use sgauth ; then
+ einfo "\nSgauth:"
+ einfo "-------"
+ einfo " For further use of sgauth please edit /etc/stargazer/sgauth.conf depending on your needs."
+ einfo " You have to change 'ServerName', 'Login', 'Password' fields at least."
+ fi
+
+ if use sgconf ; then
+ einfo "\nSgconf:"
+ einfo "-------"
+ use module_config_sgconfig || einfo " For further use of sgconf utility you should also enable USE-flag module_config_sgconfig."
+ fi
+
+ if use sgconf_xml ; then
+ einfo "\nSgconf_xml:"
+ einfo "-----------"
+ use module_config_rpcconfig || einfo " For further use of sgconf_xml utility you should also enable USE-flag module_config_rpcconfig."
+ fi
+
+ if use stargazer ; then
+ einfo "\nStargazer:"
+ einfo "----------"
+ einfo " Modules availability:\n"
+
+ if use module_auth_always_online ; then
+ einfo " * module_auth_always_online available."
+ fi
+
+ if use module_auth_internet_access ; then
+ einfo " * module_auth_internet_access available."
+ fi
+
+ if use module_auth_freeradius ; then
+ einfo " * module_auth_freeradius available.\n"
+ einfo " For further use of module, emerge net-dialup/freeradius.\n"
+ use radius || einfo "\n For use RADIUS data processing you should also enable use USE-flag radius."
+ fi
+
+ if use module_capture_ipq ; then
+ einfo " * module_capture_ipq available."
+ fi
+
+ if use module_capture_ether ; then
+ einfo " * module_capture_ether available."
+ fi
+
+ if use module_capture_netflow ; then
+ einfo " * module_capture_netflow available.\n"
+ einfo " For further use of module, emerge net-firewall/ipt_netflow or net-analyzer/softflowd.\n"
+ fi
+
+ if use module_config_sgconfig ; then
+ einfo " * module_config_sgconfig available."
+ fi
+
+ if use module_config_rpcconfig ; then
+ einfo " * module_config_rpcconfig available.\n"
+ einfo " KNOWN BUG: Sometimes you can't configure Stargazer through xml-based configurator,"
+ einfo " because module is not responding."
+ einfo " This bug is introduced by xmlrpc-c library. This bug proceeds very rare, but it still exists.\n"
+ fi
+
+ if use module_other_ping ; then
+ einfo " * module_other_ping available."
+ fi
+
+ if use module_other_smux ; then
+ einfo " * module_other_smux available.\n"
+ einfo " For further use of module emerge net-analyzer/net-snmp.\n"
+ fi
+
+ if use module_other_remote_script ; then
+ einfo " * module_other_remote_script available.\n"
+ einfo " Don't forget to edit /etc/stargazer/subnets file depending on your needs."
+ fi
+
+ if use module_store_files ; then
+ einfo " * module_store_files available.\n"
+ einfo " Necessary and sufficient rights to the directory /var/lib/stargazer for this backend is 0755."
+ einfo " You may fix it if needed.\n"
+ fi
+
+ if use module_store_firebird ; then
+ einfo " * module_store_firebird available.\n"
+ einfo " Necessary and sufficient rights to the directory /var/lib/stargazer for this backend is 0775."
+ einfo " Check that it was so, and fix it if needed."
+ einfo " You should add 'firebird' user to stg group:\n"
+ einfo " # usermod -a -G stg firebird\n"
+ einfo " and restart firebird:\n"
+ einfo " # /etc/init.d/firebird restart\n"
+ einfo " Stargazer DB schema for Firebird is here: /usr/share/stargazer/db/firebird"
+ einfo " For new setup you should execute 00-base-00.sql:\n"
+ einfo " # fbsql -q -i /usr/share/stargazer/db/firebird/00-base-00.sql\n"
+ einfo " For upgrade from version 2.406 you should execute 00-alter-01.sql:\n"
+ einfo " # fbsql -q -u <username> -p <password> -d <database> -i /usr/share/stargazer/db/firebird/00-alter-01.sql\n"
+ fi
+
+ if use module_store_mysql ; then
+ einfo " * module_store_mysql available.\n"
+ einfo " For upgrade from version 2.406 you should execute 00-mysql-01.sql:\n"
+ einfo " # mysql -h <hostname> -P <port> -u <username> -p <password> <database> < /usr/share/stargazer/db/mysql/00-mysql-01.sql\n"
+ fi
+
+ if use module_store_postgres ; then
+ einfo " * module_store_postgres available.\n"
+ einfo " Stargazer DB schema for PostgresSQL is here: /usr/share/stargazer/db/postgresql"
+ einfo " For new setup you should execute 00-base-00.postgresql.sql:\n"
+ einfo " # psql -h <hostname> -p <port> -U <username> -d <database> -W -f /usr/share/stargazer/db/postgresql/00-base-00.postgresql.sql\n"
+ einfo " For upgrade from version 2.406 you should execute 00-alter-01.sql:\n"
+ einfo " # psql -h <hostname> -p <port> -U <username> -d <database> -W -f /usr/share/stargazer/db/postgresql/00-alter-01.sql\n"
+ fi
+
+ einfo "\n For all storage backends:\n"
+ einfo " * Default admin login - admin, default admin password - 123456."
+ einfo " * Default subscriber login - test, default subscriber password - 123456.\n"
+ einfo "Don't run newer versions without reading their ChangeLog first,"
+ einfo "it can be found in /usr/share/doc/${PF}"
+ fi
+
+ if use debug ; then
+ ewarn "\nThis is a debug build. You should avoid to use it in production.\n"
+ fi
+}