aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-08-29 21:05:12 -0400
committerRalph Amissah <ralph@amissah.com>2014-08-29 21:05:12 -0400
commitaed8d0f1cae7debfb4b9e1858b56d18abbfc7bf5 (patch)
tree0296346dfc87f91371ed086e42231fad226ec455
parentdebian/changelog (5.6.2-1) (diff)
parentv5 v6: dp, texpdf, copyright_and_license, minor fix, used by texpdf (diff)
Merge tag 'sisu_5.6.3' into debian/sid
SiSU 5.6.3
-rw-r--r--.gitignore2
l---------Rakefile2
l---------Rantfile2
-rw-r--r--conf/sisu/rc/sisurc_by_fn.yml6
-rw-r--r--conf/sisu/rc/sisurc_by_ft.yml6
-rw-r--r--conf/sisu/rc/sisurc_by_lng.yml6
-rw-r--r--data/doc/sisu/CHANGELOG_v511
-rw-r--r--data/doc/sisu/CHANGELOG_v611
-rw-r--r--data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_fn.yml11
-rw-r--r--data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_fn_monolingual.yml29
-rw-r--r--data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_ft.yml11
-rw-r--r--data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_ft_monolingual.yml29
-rw-r--r--data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_lng.yml18
-rw-r--r--data/sisu/v5/v/version.yml6
-rw-r--r--data/sisu/v6/v/version.yml6
-rw-r--r--lib/sisu/v5/dp.rb18
-rw-r--r--lib/sisu/v5/hub.rb1
-rw-r--r--lib/sisu/v5/hub_actions.rb19
-rw-r--r--lib/sisu/v5/hub_options.rb4
-rw-r--r--lib/sisu/v5/se_programs.rb6
-rw-r--r--lib/sisu/v5/sitemaps.rb6
-rw-r--r--lib/sisu/v5/sst_to_s_xml_sax.rb4
-rw-r--r--lib/sisu/v5/texpdf.rb5
-rw-r--r--lib/sisu/v5/xhtml.rb4
-rw-r--r--lib/sisu/v5/xml_dom.rb4
-rw-r--r--lib/sisu/v5/xml_sax.rb4
-rw-r--r--lib/sisu/v6/dp.rb18
-rw-r--r--lib/sisu/v6/hub.rb1
-rw-r--r--lib/sisu/v6/hub_actions.rb19
-rw-r--r--lib/sisu/v6/hub_options.rb4
-rw-r--r--lib/sisu/v6/se_programs.rb6
-rw-r--r--lib/sisu/v6/sitemaps.rb6
-rw-r--r--lib/sisu/v6/sst_to_s_xml_sax.rb4
-rw-r--r--lib/sisu/v6/texpdf.rb5
-rw-r--r--lib/sisu/v6/xhtml.rb4
-rw-r--r--lib/sisu/v6/xml_dom.rb4
-rw-r--r--lib/sisu/v6/xml_sax.rb4
-rwxr-xr-xqi234
-rw-r--r--rbuild990
-rw-r--r--setup/qi_libs.rb521
-rw-r--r--setup/qi_libs_base.rb345
-rw-r--r--setup/rbuild646
-rw-r--r--setup/rbuild_help.rb36
-rw-r--r--setup/rbuild_libs.rb518
-rw-r--r--setup/sisu_version.rb13
l---------version1
46 files changed, 2524 insertions, 1086 deletions
diff --git a/.gitignore b/.gitignore
index 34ee93ad..5dec69fb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,5 @@
\#*
*.gem
*.gemspec
+*.qi
+*.qi.rb
diff --git a/Rakefile b/Rakefile
index 3ace5013..20d91014 120000
--- a/Rakefile
+++ b/Rakefile
@@ -1 +1 @@
-rbuild \ No newline at end of file
+setup/rbuild \ No newline at end of file
diff --git a/Rantfile b/Rantfile
index 3ace5013..20d91014 120000
--- a/Rantfile
+++ b/Rantfile
@@ -1 +1 @@
-rbuild \ No newline at end of file
+setup/rbuild \ No newline at end of file
diff --git a/conf/sisu/rc/sisurc_by_fn.yml b/conf/sisu/rc/sisurc_by_fn.yml
index dfd8e1bd..4137662d 100644
--- a/conf/sisu/rc/sisurc_by_fn.yml
+++ b/conf/sisu/rc/sisurc_by_fn.yml
@@ -148,9 +148,13 @@ program_set:
#search:
# sisu:
# flag: true
-## action: http://localhost:8081/cgi-bin/sisu_pgsql.cgi
+# action: http://www.sisudoc.org/cgi-bin/sisu_v6c_sqlite.cgi
+# action: http://localhost:8081/cgi-bin/sisu_pgsql.cgi
+# action: http://192.168.1.108/cgi-bin/sisu_pgsql.cgi
# action: http://search.sisudoc.org
# db: sisu
# title: sample search form
+
#promo: sisu_search_libre, sisu_icon, sisu, open_society, fsf, ruby
+
#omit: minitoc
diff --git a/conf/sisu/rc/sisurc_by_ft.yml b/conf/sisu/rc/sisurc_by_ft.yml
index 3b0db1d1..3ca98c61 100644
--- a/conf/sisu/rc/sisurc_by_ft.yml
+++ b/conf/sisu/rc/sisurc_by_ft.yml
@@ -148,9 +148,13 @@ program_set:
#search:
# sisu:
# flag: true
-## action: http://localhost:8081/cgi-bin/sisu_pgsql.cgi
+# action: http://www.sisudoc.org/cgi-bin/sisu_v6c_sqlite.cgi
+# action: http://localhost:8081/cgi-bin/sisu_pgsql.cgi
+# action: http://192.168.1.108/cgi-bin/sisu_pgsql.cgi
# action: http://search.sisudoc.org
# db: sisu
# title: sample search form
+
#promo: sisu_search_libre, sisu_icon, sisu, open_society, fsf, ruby
+
#omit: minitoc
diff --git a/conf/sisu/rc/sisurc_by_lng.yml b/conf/sisu/rc/sisurc_by_lng.yml
index 4b2d110e..10705fe5 100644
--- a/conf/sisu/rc/sisurc_by_lng.yml
+++ b/conf/sisu/rc/sisurc_by_lng.yml
@@ -146,9 +146,13 @@ program_set:
#search:
# sisu:
# flag: true
-## action: http://localhost:8081/cgi-bin/sisu_pgsql.cgi
+# action: http://www.sisudoc.org/cgi-bin/sisu_v6c_sqlite.cgi
+# action: http://localhost:8081/cgi-bin/sisu_pgsql.cgi
+# action: http://192.168.1.108/cgi-bin/sisu_pgsql.cgi
# action: http://search.sisudoc.org
# db: sisu
# title: sample search form
+
#promo: sisu_search_libre, sisu_icon, sisu, open_society, fsf, ruby
+
#omit: minitoc
diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5
index d1609df6..93631a50 100644
--- a/data/doc/sisu/CHANGELOG_v5
+++ b/data/doc/sisu/CHANGELOG_v5
@@ -31,6 +31,17 @@ v2 branch is removed; it is available in sisu =< 3.3.2
%% Reverse Chronological:
+%% 5.6.3.orig.tar.xz (2014-08-29:34/5)
+http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.6.3
+http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_5.6.3-1
+http://www.jus.uio.no/sisu/pkg/src/sisu_5.6.3.orig.tar.xz
+ sisu_5.6.3.orig.tar.xz
+ sisu_5.6.3-1.dsc
+
+* hub, sisu version info, when & what to report
+
+* dp, texpdf, copyright_and_license, minor fix, used by texpdf
+
%% 5.6.2.orig.tar.xz (2014-08-20:33/3)
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.6.2
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_5.6.2-1
diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6
index 7b3e3492..346332a5 100644
--- a/data/doc/sisu/CHANGELOG_v6
+++ b/data/doc/sisu/CHANGELOG_v6
@@ -21,6 +21,17 @@ v2 branch is removed; it is available in sisu =< 3.3.2
%% Reverse Chronological:
+%% 6.2.4.orig.tar.xz (2014-08-29:34/5)
+http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.2.4
+http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_6.2.4-1
+http://www.jus.uio.no/sisu/pkg/src/sisu_6.2.4.orig.tar.xz
+ sisu_6.2.4.orig.tar.xz
+ sisu_6.2.4-1.dsc
+
+* hub, sisu version info, when & what to report
+
+* dp, texpdf, copyright_and_license, minor fix, used by texpdf
+
%% 6.2.3.orig.tar.xz (2014-08-20:33/3)
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.2.3
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_6.2.3-1
diff --git a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_fn.yml b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_fn.yml
index e8d42695..09bb2d82 100644
--- a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_fn.yml
+++ b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_fn.yml
@@ -16,7 +16,8 @@
#% presentation/web directory, main path and subdirectories (most subdirectories are created automatically based on markup directory name)
#webserv:
# url_root: 'http://www.your.url' #url to document root, without dir stub
-# path: '/var/www' #either (i) / [full path from root] or (ii) ~/ [home] or (iii) ./ [pwd] or (iv) will be made from home
+# path: '/srv/www' #'/var/www' '/srv/www.sisudoc.org/web' #either (i) / [full path from root] or (ii) ~/ [home] or (iii) ./ [pwd] or (iv) will be made from home
+# url_root: 'http://www.sisudoc.org' #without dir stub, e.g. this dir would map to http://www.sisudoc.org/samples
# images: '_sisu/image'
# man: 'man'
# cgi: '/usr/local/lib/sisu-cgi'
@@ -134,8 +135,12 @@ program_set:
#search:
# sisu:
# flag: true
-## action: http://localhost:8081/cgi-bin/sisu_pgsql.cgi
+# action: http://www.sisudoc.org/cgi-bin/sisu_v6c_sqlite.cgi
+# action: http://192.168.1.108/cgi-bin/sisu_pgsql.cgi
# action: http://search.sisudoc.org
-# db: sisu
+# db: manual
# title: sample search form
+
#promo: sisu_search_libre, sisu_icon, sisu, open_society, fsf, ruby
+
+#omit: minitoc
diff --git a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_fn_monolingual.yml b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_fn_monolingual.yml
index 432885f6..ca829ac8 100644
--- a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_fn_monolingual.yml
+++ b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_fn_monolingual.yml
@@ -15,8 +15,9 @@
# #all: 'image'
#% presentation/web directory, main path and subdirectories (most subdirectories are created automatically based on markup directory name)
#webserv:
-# url_root: 'http://www.your.url' #without dir stub
-# path: '/var/www' #either (i) / [full path from root] or (ii) ~/ [home] or (iii) ./ [pwd] or (iv) will be made from home
+# url_root: 'http://www.your.url' #url to document root, without dir stub
+# path: '/srv/www' #'/var/www' '/srv/www.sisudoc.org/web' #either (i) / [full path from root] or (ii) ~/ [home] or (iii) ./ [pwd] or (iv) will be made from home
+# url_root: 'http://www.sisudoc.org' #without dir stub, e.g. this dir would map to http://www.sisudoc.org/samples
# images: '_sisu/image'
# man: 'man'
# cgi: '/usr/local/lib/sisu-cgi'
@@ -49,12 +50,16 @@ show_output_on: 'filesystem_url'
#% flag - set (non-default) processing flag shortcuts -1, -2 etc. (here adding colour and verbosity as default)
flag:
color: true # making colour default -c is toggle, and will now toggle colour off
-# default: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose'
-# i: '--digest --qrcode --text --html --epub --concordance --pdf --manifest'
-# ii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --manifest'
-# iii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest'
-# iv: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --postresql --update --manifest'
-# v: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest'
+# act0: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose'
+# act1: '--digest --text --html --manifest'
+# act2: '--digest --text --html --epub --pdf --manifest'
+# act3: '--digest --qrcode --text --html --epub --concordance --pdf --manifest'
+# act4: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --manifest'
+# act5: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --sqlite --manifest'
+# act6: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest'
+# act7: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest'
+# act8: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --manifest'
+# act9: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --source --sisupod --manifest'
#% papersize, (LaTeX/pdf) available values: A4, US_letter, book_b5, book_a5, US_legal
default:
@@ -130,8 +135,12 @@ program_set:
#search:
# sisu:
# flag: true
-## action: http://localhost:8081/cgi-bin/sisu_pgsql.cgi
+# action: http://www.sisudoc.org/cgi-bin/sisu_v6c_sqlite.cgi
+# action: http://192.168.1.108/cgi-bin/sisu_pgsql.cgi
# action: http://search.sisudoc.org
-# db: sisu
+# db: manual
# title: sample search form
+
#promo: sisu_search_libre, sisu_icon, sisu, open_society, fsf, ruby
+
+#omit: minitoc
diff --git a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_ft.yml b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_ft.yml
index b80808fc..04cd2a42 100644
--- a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_ft.yml
+++ b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_ft.yml
@@ -16,7 +16,8 @@
#% presentation/web directory, main path and subdirectories (most subdirectories are created automatically based on markup directory name)
#webserv:
# url_root: 'http://www.your.url' #url to document root, without dir stub
-# path: '/var/www' #either (i) / [full path from root] or (ii) ~/ [home] or (iii) ./ [pwd] or (iv) will be made from home
+# path: '/srv/www' #'/var/www' '/srv/www.sisudoc.org/web' #either (i) / [full path from root] or (ii) ~/ [home] or (iii) ./ [pwd] or (iv) will be made from home
+# url_root: 'http://www.sisudoc.org' #without dir stub, e.g. this dir would map to http://www.sisudoc.org/samples
# images: '_sisu/image'
# man: 'man'
# cgi: '/usr/local/lib/sisu-cgi'
@@ -134,8 +135,12 @@ program_set:
#search:
# sisu:
# flag: true
-## action: http://localhost:8081/cgi-bin/sisu_pgsql.cgi
+# action: http://www.sisudoc.org/cgi-bin/sisu_v6c_sqlite.cgi
+# action: http://192.168.1.108/cgi-bin/sisu_pgsql.cgi
# action: http://search.sisudoc.org
-# db: sisu
+# db: manual
# title: sample search form
+
#promo: sisu_search_libre, sisu_icon, sisu, open_society, fsf, ruby
+
+#omit: minitoc
diff --git a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_ft_monolingual.yml b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_ft_monolingual.yml
index 752dbd66..006eefa7 100644
--- a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_ft_monolingual.yml
+++ b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_ft_monolingual.yml
@@ -15,8 +15,9 @@
# #all: 'image'
#% presentation/web directory, main path and subdirectories (most subdirectories are created automatically based on markup directory name)
#webserv:
-# url_root: 'http://www.your.url' #without dir stub
-# path: '/var/www' #either (i) / [full path from root] or (ii) ~/ [home] or (iii) ./ [pwd] or (iv) will be made from home
+# url_root: 'http://www.your.url' #url to document root, without dir stub
+# path: '/srv/www' #'/var/www' '/srv/www.sisudoc.org/web' #either (i) / [full path from root] or (ii) ~/ [home] or (iii) ./ [pwd] or (iv) will be made from home
+# url_root: 'http://www.sisudoc.org' #without dir stub, e.g. this dir would map to http://www.sisudoc.org/samples
# images: '_sisu/image'
# man: 'man'
# cgi: '/usr/local/lib/sisu-cgi'
@@ -49,12 +50,16 @@ show_output_on: 'filesystem_url'
#% flag - set (non-default) processing flag shortcuts -1, -2 etc. (here adding colour and verbosity as default)
flag:
color: true # making colour default -c is toggle, and will now toggle colour off
-# default: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose'
-# i: '--digest --qrcode --text --html --epub --concordance --pdf --manifest'
-# ii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --manifest'
-# iii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest'
-# iv: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --postresql --update --manifest'
-# v: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest'
+# act0: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose'
+# act1: '--digest --text --html --manifest'
+# act2: '--digest --text --html --epub --pdf --manifest'
+# act3: '--digest --qrcode --text --html --epub --concordance --pdf --manifest'
+# act4: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --manifest'
+# act5: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --sqlite --manifest'
+# act6: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest'
+# act7: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest'
+# act8: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --manifest'
+# act9: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --source --sisupod --manifest'
#% papersize, (LaTeX/pdf) available values: A4, US_letter, book_b5, book_a5, US_legal
default:
@@ -130,8 +135,12 @@ program_set:
#search:
# sisu:
# flag: true
-## action: http://localhost:8081/cgi-bin/sisu_pgsql.cgi
+# action: http://www.sisudoc.org/cgi-bin/sisu_v6c_sqlite.cgi
+# action: http://192.168.1.108/cgi-bin/sisu_pgsql.cgi
# action: http://search.sisudoc.org
-# db: sisu
+# db: manual
# title: sample search form
+
#promo: sisu_search_libre, sisu_icon, sisu, open_society, fsf, ruby
+
+#omit: minitoc
diff --git a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_lng.yml b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_lng.yml
index 62fb7624..9dd3980f 100644
--- a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_lng.yml
+++ b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_lng.yml
@@ -14,9 +14,10 @@
# public: '_sisu/image'
# #all: 'image'
#% presentation/web directory, main path and subdirectories (most subdirectories are created automatically based on markup directory name)
-#webserv:
+webserv:
# url_root: 'http://www.your.url' #url to document root, without dir stub
-# path: '/var/www' #either (i) / [full path from root] or (ii) ~/ [home] or (iii) ./ [pwd] or (iv) will be made from home
+# path: '/srv/www' #'/var/www' '/srv/www.sisudoc.org/web' #either (i) / [full path from root] or (ii) ~/ [home] or (iii) ./ [pwd] or (iv) will be made from home
+# url_root: 'http://www.sisudoc.org' #without dir stub, e.g. this dir would map to http://www.sisudoc.org/samples
# images: '_sisu/image'
# man: 'man'
# cgi: '/usr/local/lib/sisu-cgi'
@@ -132,17 +133,12 @@ program_set:
#search:
# sisu:
# flag: true
-## action: http://localhost:8081/cgi-bin/sisu_pgsql.cgi
+# action: http://www.sisudoc.org/cgi-bin/sisu_v6c_sqlite.cgi
+# action: http://192.168.1.108/cgi-bin/sisu_pgsql.cgi
# action: http://search.sisudoc.org
# db: manual
# title: sample search form
+
#promo: sisu_search_libre, sisu_icon, sisu, open_society, fsf, ruby
-search:
- sisu:
- flag: true
- action: http://192.168.1.108/cgi/sisu_search.cgi
-# action: http://192.168.1.108/cgi-bin/sisu_pgsql.cgi
-# action: http://search.sisudoc.org
- db: manual
- title: sample search form
+#omit: minitoc
diff --git a/data/sisu/v5/v/version.yml b/data/sisu/v5/v/version.yml
index 59668da0..fa57b9ab 100644
--- a/data/sisu/v5/v/version.yml
+++ b/data/sisu/v5/v/version.yml
@@ -1,5 +1,5 @@
---
:project: SiSU
-:version: 5.6.2
-:date_stamp: 2014w33/3
-:date: "2014-08-20"
+:version: 5.6.3
+:date_stamp: 2014w34/5
+:date: "2014-08-29"
diff --git a/data/sisu/v6/v/version.yml b/data/sisu/v6/v/version.yml
index 5697c2df..b03690af 100644
--- a/data/sisu/v6/v/version.yml
+++ b/data/sisu/v6/v/version.yml
@@ -1,5 +1,5 @@
---
:project: SiSU
-:version: 6.2.3
-:date_stamp: 2014w33/3
-:date: "2014-08-20"
+:version: 6.2.4
+:date_stamp: 2014w34/5
+:date: "2014-08-29"
diff --git a/lib/sisu/v5/dp.rb b/lib/sisu/v5/dp.rb
index 33c6c565..00cf8525 100644
--- a/lib/sisu/v5/dp.rb
+++ b/lib/sisu/v5/dp.rb
@@ -158,9 +158,25 @@ module SiSU_Param
class MdDefault
def rights(author,date)
@author,@date=author,date
+ def assignment(author)
+ 'copyright not explicitly stated, ' \
+ + 'program "assigning" copyright to author: ' \
+ + author
+ end
def all
s=nil
if @author
+ #puts assignment(@author)
+ s ||=((@date =~/((?:1[4-9]|2[01])\d{2})/ ) \
+ ? ("Copyright (C) #{$1} #{@author}")
+ : ('Copyright (C)' + @author)) #matches years 1400 through 21\d\d
+ end
+ s
+ end
+ def copyright_and_license
+ s=nil
+ if @author
+ #puts assignment(@author)
s ||=((@date =~/((?:1[4-9]|2[01])\d{2})/ ) \
? ("Copyright (C) #{$1} #{@author}")
: ('Copyright (C)' + @author)) #matches years 1400 through 21\d\d
@@ -584,7 +600,7 @@ module SiSU_Param
' \\\\ '
end
def copyright_and_license
- s=if @h['all'] then @h['all']
+ s=if @h['copyright_and_license'] then @h['copyright_and_license']
else
s=''
if defined? copyright.text \
diff --git a/lib/sisu/v5/hub.rb b/lib/sisu/v5/hub.rb
index 68db1f13..eda98084 100644
--- a/lib/sisu/v5/hub.rb
+++ b/lib/sisu/v5/hub.rb
@@ -207,6 +207,7 @@ module SiSU
def actions_without_files
actions=SiSU_Hub_Actions::HubActions.new(@opt)
actions.report.version_info?
+ actions.report.version_dir?
actions.prepare.site?
actions.prepare.sql?
end
diff --git a/lib/sisu/v5/hub_actions.rb b/lib/sisu/v5/hub_actions.rb
index 785f507e..5f99f444 100644
--- a/lib/sisu/v5/hub_actions.rb
+++ b/lib/sisu/v5/hub_actions.rb
@@ -72,6 +72,17 @@ module SiSU_Hub_Actions
SiSU_Env::InfoAbout.new(@opt).sisu_version
end
end
+ def version_dir?
+ if @opt.act[:version_info][:set]==:on \
+ || @opt.act[:verbose][:set]==:on \
+ || @opt.act[:verbose_plus][:set]==:on \
+ || @opt.act[:maintenance][:set]==:on
+ SiSU_Screen::Ansi.new(
+ @opt.act[:color_state][:set],
+ ' ' + File.dirname(__FILE__)
+ ).grey
+ end
+ end
self
end
def prepare
@@ -853,14 +864,6 @@ module SiSU_Hub_Actions
end
def init?
SiSU_Env::InfoProcessingFlag.new
- if (@opt.act[:verbose][:set]==:on \
- || @opt.act[:verbose_plus][:set]==:on \
- || @opt.act[:maintenance][:set]==:on)
- SiSU_Screen::Ansi.new(
- @opt.act[:color_state][:set],
- ' ' + File.dirname(__FILE__)
- ).grey
- end
if @opt.act[:ao][:set]==:on \
or @opt.act[:maintenance][:set]==:on #% --maintenance, -M
env=SiSU_Env::InfoEnv.new(@opt.fns)
diff --git a/lib/sisu/v5/hub_options.rb b/lib/sisu/v5/hub_options.rb
index bc96b878..d871c9c3 100644
--- a/lib/sisu/v5/hub_options.rb
+++ b/lib/sisu/v5/hub_options.rb
@@ -316,7 +316,9 @@ module SiSU_Commandline
c,w='',''
m,f,pth,lng,lngs=[],[],[],[],[]
lng_is=''
- a=s.split(/\s+/)
+ a=(s.nil?) \
+ ? ['-v']
+ : s.split(/\s+/)
r_l=Px[:lng_lst].join('|')
a.uniq.each do |x|
if x =~/^-[a-z0-5]+/i \
diff --git a/lib/sisu/v5/se_programs.rb b/lib/sisu/v5/se_programs.rb
index 4eef1ce9..66d61036 100644
--- a/lib/sisu/v5/se_programs.rb
+++ b/lib/sisu/v5/se_programs.rb
@@ -113,8 +113,10 @@ module SiSU_Sys_Call
and locale !~/utf-?8/i
true
else
- program_ref="(not available)" unless program_found?(program)
- program_ref="(UTF-8)" if locale =~/utf-?8/i
+ program_ref="(not available)" \
+ unless program_found?(program)
+ program_ref="(UTF-8)" \
+ if locale =~/utf-?8/i
false
end
end
diff --git a/lib/sisu/v5/sitemaps.rb b/lib/sisu/v5/sitemaps.rb
index fd2d58c6..d04dd382 100644
--- a/lib/sisu/v5/sitemaps.rb
+++ b/lib/sisu/v5/sitemaps.rb
@@ -86,7 +86,8 @@ module SiSU_Sitemaps
# @file=SiSU_Env::FileOp.new(@md)
@rdf=SiSU_XML_Tags::RDF.new(@md)
@fnb_utf8_xml=@md.fnb.dup
- @trans.char_enc.utf8(@fnb_utf8_xml) if @sys.locale =~/utf-?8/i #% utf8
+ @trans.char_enc.utf8(@fnb_utf8_xml) \
+ if @sys.locale =~/utf-?8/i
output_map(sitemap)
elsif @opt.selections.str =~/--sitemaps/
@sitemap_idx_fn='sitemapindex.xml'
@@ -144,7 +145,8 @@ module SiSU_Sitemaps
WOK
sitemap_files.each do |s|
f=s.gsub(/.+?\/sitemap_([^\/]+?)\.xml$/,'\1')
- @trans.char_enc.utf8(f) if @sys.locale =~/utf-?8/i #% utf8
+ @trans.char_enc.utf8(f) \
+ if @sys.locale =~/utf-?8/i
sitemap_idx << <<WOK
<sitemap>
<loc>#{@env.path.url.remote}/#{f}/sitemap.xml</loc>
diff --git a/lib/sisu/v5/sst_to_s_xml_sax.rb b/lib/sisu/v5/sst_to_s_xml_sax.rb
index fe685983..b72868a1 100644
--- a/lib/sisu/v5/sst_to_s_xml_sax.rb
+++ b/lib/sisu/v5/sst_to_s_xml_sax.rb
@@ -395,8 +395,8 @@ WOK
dir=SiSU_Env::InfoEnv.new
@@xml[:head],@@xml[:body]=[],[]
css=SiSU_Env::CSS_Select.new(@md).xml_sax
- encoding=if @sys.locale =~/utf-?8/i; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
- else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=if @sys.locale =~/utf-?8/i then '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
end
@@xml[:open] =<<WOK
#{encoding}
diff --git a/lib/sisu/v5/texpdf.rb b/lib/sisu/v5/texpdf.rb
index c2c9dc70..e35c7ccf 100644
--- a/lib/sisu/v5/texpdf.rb
+++ b/lib/sisu/v5/texpdf.rb
@@ -448,10 +448,9 @@ module SiSU_TeX
end
if defined? @md.rights.all \
and not @md.rights.all.empty?
- rght=@md.rights #.author.dup #dup is necessary, else contents of :rights changed
- sp_char=SiSU_TeX_Pdf::SpecialCharacters.new(@md,rght.copyright.copyright_and_license)
+ sp_char=SiSU_TeX_Pdf::SpecialCharacters.new(@md,@md.rights.copyright.copyright_and_license.dup)
copymark='Copyright {\begin{small}{\copyright\end{small}} '
- #copymark='Copyright {\begin{small}^{\copyright\end{small}} '
+ #copymark='Copyright {\begin{small}^{\copyright\end{small}} '
copyright=sp_char.special_characters_safe.gsub(/\s*Copyright \(C\)/, copymark)
@@rights||="\n #{Tex[:backslash]*2}[3]\\ \\linebreak #{copyright}"
end
diff --git a/lib/sisu/v5/xhtml.rb b/lib/sisu/v5/xhtml.rb
index 14c6bfe9..138ccf6d 100644
--- a/lib/sisu/v5/xhtml.rb
+++ b/lib/sisu/v5/xhtml.rb
@@ -392,7 +392,9 @@ WOK
rdf=SiSU_XML_Tags::RDF.new(@md)
@@xml[:head],@@xml[:body]=[],[]
stylesheet=SiSU_Style::CSS_HeadInfo.new(@md,'xhtml').stylesheet
- encoding=(@sys.locale =~/utf-?8/i) ? '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' : '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=(@sys.locale =~/utf-?8/i) \
+ ? '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ : '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
@@xml[:open] =<<WOK
#{encoding}
#{stylesheet.css_head_xml}
diff --git a/lib/sisu/v5/xml_dom.rb b/lib/sisu/v5/xml_dom.rb
index fb7d3cb9..b78fb67a 100644
--- a/lib/sisu/v5/xml_dom.rb
+++ b/lib/sisu/v5/xml_dom.rb
@@ -534,8 +534,8 @@ WOK
def pre
rdf=SiSU_XML_Tags::RDF.new(@md)
stylesheet=SiSU_Style::CSS_HeadInfo.new(@md,'xml_dom').stylesheet
- encoding=if @sys.locale =~/utf-?8/i; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
- else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=if @sys.locale =~/utf-?8/i then '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
end
@@xml[:open] =<<WOK
#{encoding}
diff --git a/lib/sisu/v5/xml_sax.rb b/lib/sisu/v5/xml_sax.rb
index 69dc39a3..ea3f7175 100644
--- a/lib/sisu/v5/xml_sax.rb
+++ b/lib/sisu/v5/xml_sax.rb
@@ -430,8 +430,8 @@ WOK
rdf=SiSU_XML_Tags::RDF.new(@md)
@@xml[:head],@@xml[:body]=[],[]
stylesheet=SiSU_Style::CSS_HeadInfo.new(@md,'xml_sax').stylesheet
- encoding=if @sys.locale =~/utf-?8/i; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
- else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=if @sys.locale =~/utf-?8/i then '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
end
@@xml[:open] =<<WOK
#{encoding}
diff --git a/lib/sisu/v6/dp.rb b/lib/sisu/v6/dp.rb
index 111896d7..595cee3e 100644
--- a/lib/sisu/v6/dp.rb
+++ b/lib/sisu/v6/dp.rb
@@ -158,9 +158,25 @@ module SiSU_Param
class MdDefault
def rights(author,date)
@author,@date=author,date
+ def assignment(author)
+ 'copyright not explicitly stated, ' \
+ + 'program "assigning" copyright to author: ' \
+ + author
+ end
def all
s=nil
if @author
+ #puts assignment(@author)
+ s ||=((@date =~/((?:1[4-9]|2[01])\d{2})/ ) \
+ ? ("Copyright (C) #{$1} #{@author}")
+ : ('Copyright (C)' + @author)) #matches years 1400 through 21\d\d
+ end
+ s
+ end
+ def copyright_and_license
+ s=nil
+ if @author
+ #puts assignment(@author)
s ||=((@date =~/((?:1[4-9]|2[01])\d{2})/ ) \
? ("Copyright (C) #{$1} #{@author}")
: ('Copyright (C)' + @author)) #matches years 1400 through 21\d\d
@@ -584,7 +600,7 @@ module SiSU_Param
' \\\\ '
end
def copyright_and_license
- s=if @h['all'] then @h['all']
+ s=if @h['copyright_and_license'] then @h['copyright_and_license']
else
s=''
if defined? copyright.text \
diff --git a/lib/sisu/v6/hub.rb b/lib/sisu/v6/hub.rb
index cd66bc17..2558a9db 100644
--- a/lib/sisu/v6/hub.rb
+++ b/lib/sisu/v6/hub.rb
@@ -207,6 +207,7 @@ module SiSU
def actions_without_files
actions=SiSU_Hub_Actions::HubActions.new(@opt)
actions.report.version_info?
+ actions.report.version_dir?
actions.prepare.site?
actions.prepare.sql?
end
diff --git a/lib/sisu/v6/hub_actions.rb b/lib/sisu/v6/hub_actions.rb
index 2be0304b..54d0ccd2 100644
--- a/lib/sisu/v6/hub_actions.rb
+++ b/lib/sisu/v6/hub_actions.rb
@@ -72,6 +72,17 @@ module SiSU_Hub_Actions
SiSU_Env::InfoAbout.new(@opt).sisu_version
end
end
+ def version_dir?
+ if @opt.act[:version_info][:set]==:on \
+ || @opt.act[:verbose][:set]==:on \
+ || @opt.act[:verbose_plus][:set]==:on \
+ || @opt.act[:maintenance][:set]==:on
+ SiSU_Screen::Ansi.new(
+ @opt.act[:color_state][:set],
+ ' ' + File.dirname(__FILE__)
+ ).grey
+ end
+ end
self
end
def prepare
@@ -853,14 +864,6 @@ module SiSU_Hub_Actions
end
def init?
SiSU_Env::InfoProcessingFlag.new
- if (@opt.act[:verbose][:set]==:on \
- || @opt.act[:verbose_plus][:set]==:on \
- || @opt.act[:maintenance][:set]==:on)
- SiSU_Screen::Ansi.new(
- @opt.act[:color_state][:set],
- ' ' + File.dirname(__FILE__)
- ).grey
- end
if @opt.act[:ao][:set]==:on \
or @opt.act[:maintenance][:set]==:on #% --maintenance, -M
env=SiSU_Env::InfoEnv.new(@opt.fns)
diff --git a/lib/sisu/v6/hub_options.rb b/lib/sisu/v6/hub_options.rb
index 5625963b..336f0d93 100644
--- a/lib/sisu/v6/hub_options.rb
+++ b/lib/sisu/v6/hub_options.rb
@@ -316,7 +316,9 @@ module SiSU_Commandline
c,w='',''
m,f,pth,lng,lngs=[],[],[],[],[]
lng_is=''
- a=s.split(/\s+/)
+ a=(s.nil?) \
+ ? ['-v']
+ : s.split(/\s+/)
r_l=Px[:lng_lst].join('|')
a.uniq.each do |x|
if x =~/^-[a-z0-5]+/i \
diff --git a/lib/sisu/v6/se_programs.rb b/lib/sisu/v6/se_programs.rb
index 448ac98e..646878d4 100644
--- a/lib/sisu/v6/se_programs.rb
+++ b/lib/sisu/v6/se_programs.rb
@@ -113,8 +113,10 @@ module SiSU_Sys_Call
and locale !~/utf-?8/i
true
else
- program_ref="(not available)" unless program_found?(program)
- program_ref="(UTF-8)" if locale =~/utf-?8/i
+ program_ref="(not available)" \
+ unless program_found?(program)
+ program_ref="(UTF-8)" \
+ if locale =~/utf-?8/i
false
end
end
diff --git a/lib/sisu/v6/sitemaps.rb b/lib/sisu/v6/sitemaps.rb
index 1b2cabef..ad9e5951 100644
--- a/lib/sisu/v6/sitemaps.rb
+++ b/lib/sisu/v6/sitemaps.rb
@@ -86,7 +86,8 @@ module SiSU_Sitemaps
# @file=SiSU_Env::FileOp.new(@md)
@rdf=SiSU_XML_Tags::RDF.new(@md)
@fnb_utf8_xml=@md.fnb.dup
- @trans.char_enc.utf8(@fnb_utf8_xml) if @sys.locale =~/utf-?8/i #% utf8
+ @trans.char_enc.utf8(@fnb_utf8_xml) \
+ if @sys.locale =~/utf-?8/i
output_map(sitemap)
elsif @opt.selections.str =~/--sitemaps/
@sitemap_idx_fn='sitemapindex.xml'
@@ -144,7 +145,8 @@ module SiSU_Sitemaps
WOK
sitemap_files.each do |s|
f=s.gsub(/.+?\/sitemap_([^\/]+?)\.xml$/,'\1')
- @trans.char_enc.utf8(f) if @sys.locale =~/utf-?8/i #% utf8
+ @trans.char_enc.utf8(f) \
+ if @sys.locale =~/utf-?8/i
sitemap_idx << <<WOK
<sitemap>
<loc>#{@env.path.url.remote}/#{f}/sitemap.xml</loc>
diff --git a/lib/sisu/v6/sst_to_s_xml_sax.rb b/lib/sisu/v6/sst_to_s_xml_sax.rb
index 0be6ffa0..a780e810 100644
--- a/lib/sisu/v6/sst_to_s_xml_sax.rb
+++ b/lib/sisu/v6/sst_to_s_xml_sax.rb
@@ -395,8 +395,8 @@ WOK
dir=SiSU_Env::InfoEnv.new
@@xml[:head],@@xml[:body]=[],[]
css=SiSU_Env::CSS_Select.new(@md).xml_sax
- encoding=if @sys.locale =~/utf-?8/i; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
- else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=if @sys.locale =~/utf-?8/i then '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
end
@@xml[:open] =<<WOK
#{encoding}
diff --git a/lib/sisu/v6/texpdf.rb b/lib/sisu/v6/texpdf.rb
index 10bfa961..57eab29d 100644
--- a/lib/sisu/v6/texpdf.rb
+++ b/lib/sisu/v6/texpdf.rb
@@ -448,10 +448,9 @@ module SiSU_TeX
end
if defined? @md.rights.all \
and not @md.rights.all.empty?
- rght=@md.rights #.author.dup #dup is necessary, else contents of :rights changed
- sp_char=SiSU_TeX_Pdf::SpecialCharacters.new(@md,rght.copyright.copyright_and_license)
+ sp_char=SiSU_TeX_Pdf::SpecialCharacters.new(@md,@md.rights.copyright.copyright_and_license.dup)
copymark='Copyright {\begin{small}{\copyright\end{small}} '
- #copymark='Copyright {\begin{small}^{\copyright\end{small}} '
+ #copymark='Copyright {\begin{small}^{\copyright\end{small}} '
copyright=sp_char.special_characters_safe.gsub(/\s*Copyright \(C\)/, copymark)
@@rights||="\n #{Tex[:backslash]*2}[3]\\ \\linebreak #{copyright}"
end
diff --git a/lib/sisu/v6/xhtml.rb b/lib/sisu/v6/xhtml.rb
index 409a2b6c..17f3a335 100644
--- a/lib/sisu/v6/xhtml.rb
+++ b/lib/sisu/v6/xhtml.rb
@@ -392,7 +392,9 @@ WOK
rdf=SiSU_XML_Tags::RDF.new(@md)
@@xml[:head],@@xml[:body]=[],[]
stylesheet=SiSU_Style::CSS_HeadInfo.new(@md,'xhtml').stylesheet
- encoding=(@sys.locale =~/utf-?8/i) ? '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' : '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=(@sys.locale =~/utf-?8/i) \
+ ? '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ : '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
@@xml[:open] =<<WOK
#{encoding}
#{stylesheet.css_head_xml}
diff --git a/lib/sisu/v6/xml_dom.rb b/lib/sisu/v6/xml_dom.rb
index 1285a1cc..60141195 100644
--- a/lib/sisu/v6/xml_dom.rb
+++ b/lib/sisu/v6/xml_dom.rb
@@ -534,8 +534,8 @@ WOK
def pre
rdf=SiSU_XML_Tags::RDF.new(@md)
stylesheet=SiSU_Style::CSS_HeadInfo.new(@md,'xml_dom').stylesheet
- encoding=if @sys.locale =~/utf-?8/i; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
- else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=if @sys.locale =~/utf-?8/i then '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
end
@@xml[:open] =<<WOK
#{encoding}
diff --git a/lib/sisu/v6/xml_sax.rb b/lib/sisu/v6/xml_sax.rb
index d595e4a4..9555d2de 100644
--- a/lib/sisu/v6/xml_sax.rb
+++ b/lib/sisu/v6/xml_sax.rb
@@ -430,8 +430,8 @@ WOK
rdf=SiSU_XML_Tags::RDF.new(@md)
@@xml[:head],@@xml[:body]=[],[]
stylesheet=SiSU_Style::CSS_HeadInfo.new(@md,'xml_sax').stylesheet
- encoding=if @sys.locale =~/utf-?8/i; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
- else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=if @sys.locale =~/utf-?8/i then '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
end
@@xml[:open] =<<WOK
#{encoding}
diff --git a/qi b/qi
new file mode 100755
index 00000000..27516a67
--- /dev/null
+++ b/qi
@@ -0,0 +1,234 @@
+#!/usr/bin/env ruby
+=begin
+ Common Rakefile, Rantfile installer for SiSU
+ softlink Rakefile and Rantfile to this file
+
+ * Homepage: <http://www.jus.uio.no/sisu/SiSU>
+ <http://search.sisudoc.org>
+ * Download: <http://www.jus.uio.no/sisu/download>
+
+ Copyright (C) 2007 Ralph Amissah
+
+ * License: LGPL - GNU Lesser General Public License
+ [same license as Rant provided within the Rant package]
+
+ * Ralph Amissah <ralph@amissah.com>
+ Ralph Amissah <ralph.amissah@gmail.com>
+
+ Rake is a Ruby build program by Jim Weirich
+ * Rake may be downloaded and installed from:
+ <http://rake.rubyforge.org/>
+
+ Rant is a Ruby build program by Stefan Lang
+ * Rant may be downloaded and installed from:
+ <http://make.rubyforge.org/>
+
+ Notes on use:
+ [if rake is preferred and installed]
+ rake -T
+ [if rant is preferred and installed]
+ rant -T
+
+ SiSU can also be Setup/Installation using:
+ * Minero Aoki's setup.rb, provided along with SiSU, or
+
+=end
+#%% produce a makefile suitable for the target platform
+#require 'mkmf'
+#create_makefile("sisu")
+#% manual settings, edit/update as required (note current default settings are obtained from sisu version yml file)
+begin
+ require 'thor'
+rescue LoadError
+ puts 'thor (package ruby-thor) not found'
+end
+require_relative 'setup/sisu_version' # setup/sisu_version.rb
+ include SiSUversion
+require_relative 'setup/qi_libs' # setup/qi_libs.rb
+require 'find'
+require 'fileutils'
+ include FileUtils
+require 'pathname'
+require 'rbconfig.rb'
+require 'yaml'
+module SiSUconf
+ class Configure < Thor
+ class_option :verbose, :type => :boolean
+ desc 'setup --all --bin --lib --conf --data --alt',
+ 'setup sisu'
+ options \
+ :all => :boolean,
+ :bin => :boolean,
+ :lib => :boolean,
+ :conf => :boolean,
+ :data => :boolean,
+ :share => :boolean,
+ :man => :boolean,
+ :vim => :boolean,
+ :alt => :boolean
+ def setup
+ unless options.length >= 1 \
+ and not (options[:bin] \
+ or options[:lib] \
+ or options[:conf] \
+ or options[:data] \
+ or options[:share] \
+ or options[:man] \
+ or options[:vim])
+ puts 'setup --all --bin --lib --conf --data --share --man --vim'
+ end
+ if not options[:alt]
+ if options[:all] \
+ or options[:bin]
+ exclude_files=['sisugem']
+ Install.setup_find_create('bin',Project_details.dir.bin,exclude_files) \
+ if File.directory?('bin')
+ end
+ if options[:all] \
+ or options[:lib]
+ Install.setup_find_create('lib',Project_details.dir.lib) \
+ if File.directory?('lib')
+ end
+ if options[:all] \
+ or options[:conf]
+ Install.setup_find_create('conf',Project_details.dir.conf) \
+ if File.directory?('conf')
+ end
+ if options[:all] \
+ or options[:data]
+ Install.setup_find_create('data',Project_details.dir.data) \
+ if File.directory?('data')
+ end
+ if options[:all] \
+ or options[:share]
+ Install.setup_find_create('data/sisu',Project_details.dir.share) \
+ if File.directory?('data/sisu')
+ end
+ if options[:all] \
+ or options[:man]
+ Install.setup_find_create('man',Project_details.dir.man) \
+ if File.directory?('man')
+ end
+ if options[:all] \
+ or options[:vim]
+ Install.setup_find_create('data/vim',Project_details.dir.vim) \
+ if File.directory?('data/vim')
+ end
+ else
+ if options[:all] \
+ or options[:bin]
+ Install.setup_find_cp_r('bin',Project_details.dir.bin) \
+ if File.directory?('bin')
+ end
+ if options[:all] \
+ or options[:bin]
+ Install.setup_find_cp_r('lib',Project_details.dir.lib) \
+ if File.directory?('lib')
+ end
+ if options[:all] \
+ or options[:conf]
+ Install.setup_find_cp_r('conf',Project_details.dir.conf) \
+ if File.directory?('conf')
+ end
+ if options[:all] \
+ or options[:data]
+ Install.setup_find_cp_r('data',Project_details.dir.data) \
+ if File.directory?('data')
+ end
+ if options[:all] \
+ or options[:share]
+ Install.setup_find_cp_r('data/sisu',Project_details.dir.share) \
+ if File.directory?('data/sisu') #
+ end
+ if options[:all] \
+ or options[:man]
+ Install.setup_find_cp_r('man',Project_details.dir.man) \
+ if File.directory?('man')
+ end
+ #if options[:all] \
+ #or options[:vim]
+ # Install.setup_find_cp_r('data/vim',"#{Project_details.dir.data}/vim") \
+ # if File.directory?('data/vim')
+ #end
+ end
+ end
+ desc 'gem --create --build --install --stable --unstable',
+ 'gem create build and install'
+ options \
+ :stable => :boolean,
+ :unstable => :boolean,
+ :create => :boolean,
+ :build => :boolean,
+ :install => :boolean
+ def gem
+ if options[:unstable]
+ if options[:create]
+ Gemspecs::Current.create_unstable
+ #Gemspecs::Next.create_unstable
+ puts 'created gemspec, version: unstable' \
+ if options[:verbose]
+ end
+ if options[:build]
+ Gemspecs::Current.build_unstable
+ #Gemspecs::Next.build_unstable
+ puts 'built gem, version: unstable' \
+ if options[:verbose]
+ end
+ if options[:install]
+ Gemspecs::Current.install_unstable
+ #Gemspecs::Next.install_unstable
+ puts 'installed gem, version: unstable' \
+ if options[:verbose]
+ end
+ end
+ if options[:stable] \
+ or not options[:unstable]
+ if options[:create]
+ Gemspecs::Current.create_stable
+ #Gemspecs::Current.create_unstable
+ puts 'created gemspec, version: stable' \
+ if options[:verbose]
+ end
+ if options[:build]
+ Gemspecs::Current.build_stable
+ #Gemspecs::Next.build_stable
+ puts 'built gem, version: stable' \
+ if options[:verbose]
+ end
+ if options[:install]
+ Gemspecs::Current.install_stable
+ #Gemspecs::Next.install_stable
+ puts 'installed gem, version: stable' \
+ if options[:verbose]
+ end
+ end
+ if options.length < 2
+ system("#{$called_as} help gem")
+ end
+ end
+ desc 'pkg',
+ 'package maintenance tasks, of no general interest (maintainer specific for package maintainer\'s convenience)'
+ options \
+ :update_version=> :boolean,
+ :tip => :boolean
+ def pkg
+ if options[:tip]
+ Package.sequence
+ end
+ if options[:update_version]
+ Version_info::Update.update_stable
+ Version_info::Update.update_unstable
+ end
+ if options.length == 0
+ system("#{$called_as} help pkg")
+ system("#{$called_as} pkg --tip")
+ end
+ end
+ end
+end
+begin
+ $called_as,$argv=$0,$*
+ SiSUconf::Configure.start(ARGV)
+rescue
+end
+__END__
diff --git a/rbuild b/rbuild
deleted file mode 100644
index 261c5256..00000000
--- a/rbuild
+++ /dev/null
@@ -1,990 +0,0 @@
-#!/usr/bin/env ruby
-=begin
- Common Rakefile, Rantfile installer for SiSU
- softlink Rakefile and Rantfile to this file
-
- * Homepage: <http://www.jus.uio.no/sisu/SiSU>
- <http://search.sisudoc.org>
- * Download: <http://www.jus.uio.no/sisu/download>
-
- Copyright (C) 2007 Ralph Amissah
-
- * License: LGPL - GNU Lesser General Public License
- [same license as Rant provided within the Rant package]
-
- * Ralph Amissah <ralph@amissah.com>
- Ralph Amissah <ralph.amissah@gmail.com>
-
- Rake is a Ruby build program by Jim Weirich
- * Rake may be downloaded and installed from:
- <http://rake.rubyforge.org/>
-
- Rant is a Ruby build program by Stefan Lang
- * Rant may be downloaded and installed from:
- <http://make.rubyforge.org/>
-
- Notes on use:
- [if rake is preferred and installed]
- rake -T
- [if rant is preferred and installed]
- rant -T
-
- SiSU can also be Setup/Installation using:
- * Minero Aoki's setup.rb, provided along with SiSU, or
-
-=end
-#%% produce a makefile suitable for the target platform
-#require 'mkmf'
-#create_makefile("sisu")
-#% manual settings, edit/update as required (note current default settings are obtained from sisu version yml file)
-SiSU_version_next_stable = '5.6.2' #% set version stable current
-SiSU_version_next_unstable = '6.2.3' #% set version unstable dev
-#% rake file
-SiSU_version_generic_next_stable = '5.4.x'
-SiSU_version_generic_next_unstable = '6.0.x'
-SiSU_version_dir_stable = 'v5'
-SiSU_version_dir_unstable = 'v6'
-require 'find'
-require 'fileutils'
-#require 'ftools'
-require 'rbconfig.rb'
-require 'yaml'
-include FileUtils
-module Project_details
- def self.name
- 'SiSU'
- end
- def self.rake_rant
- "Rakefile/Rantfile for the installation/setup of #{name}"
- end
- def self.platform_notice
- "[#{name} is for Linux/Unix Platforms]"
- end
- def self.env
- RbConfig::CONFIG
- end
- def self.host
- env['host']
- end
- def self.dir
- def self.proj
- Project_details.name.downcase
- end
- def self.arch
- env['archdir']
- end
- def self.sitearch
- env['sitearchdir']
- end
- def self.bin
- env['bindir']
- end
- def self.lib
- env['sitelibdir']
- end
- def self.data
- env['datadir']
- end
- def self.share
- "#{env['datadir']}/sisu"
- end
- def self.conf
- env['sysconfdir']
- end
- def self.man
- env['mandir']
- end
- def self.vim
- "#{env['datadir']}/sisu/vim"
- end
- def self.out
- "#{env['localstatedir']}/#{proj}"
- end
- def self.rubylib
- env['LIBRUBYARG_SHARED']
- end
- def self.pwd
- Dir.pwd #ENV['PWD']
- end
- self
- end
- def self.version
- stamp={}
- v="#{dir.pwd}/conf/sisu/version.yml"
- if File.exist?(v)
- stamp=YAML::load(File::open(v))
- stamp[:version]
- else ''
- end
- end
- def self.system_info
- ##{Project_details.platform_notice}
- puts <<-WOK
- Host
- host: #{Project_details.host}
- arch: #{Project_details.dir.arch}
- sitearch: #{Project_details.dir.sitearch}
- Directories for installation
- bin: #{Project_details.dir.bin}
- lib (site-ruby): #{Project_details.dir.lib}/#{Project_details.dir.proj}/v*
- conf [etc]: #{Project_details.dir.conf}/#{Project_details.dir.proj}
- data (odf, shared images): #{Project_details.dir.share}
- vim (vim syntax, highlighting, ftplugin): #{Project_details.dir.data}/sisu/vim
- data (README, version_manifest): #{Project_details.dir.data}/doc/#{Project_details.dir.proj}
- man (manual pages): #{Project_details.dir.man}
- output: #{Project_details.dir.out}
- processing: #{Project_details.dir.out}/processing
- www: #{Project_details.dir.out}/www
- rubylib: #{Project_details.dir.rubylib}
-
- WOK
- end
- def self.gem_env
- system("gem env")
- end
-end
-module Utils
- def self.answer?(ask)
- resp='redo'
- print ask + " ['yes', 'no' or 'quit']: "
- resp=File.new('/dev/tty').gets.strip #resp=gets.strip
- if resp == 'yes' then true
- elsif resp == 'no' then false
- elsif resp =~/^quit|exit$/ then exit
- else puts "[please type: 'yes', 'no' or 'quit']"
- answer?(ask)
- end
- end
- def self.default_notice
- ans= %{#{Project_details.rake_rant}
- Information on alternative actions is available using:
- [if rake (or rant) is installed:]
- "rake help" or "rake -T" (or "rant help" or "rant -T")
- Default action selected - "install #{Project_details.name}" proceed? }
- resp=answer?(ans)
- exit unless resp
- end
- def self.chmod_file(place)
- if place =~/\/bin/; File.chmod(0755,place)
- else File.chmod(0644,place)
- end
- end
- def self.chmod_util(place)
- if place =~/\/bin/; chmod(0755,place)
- else chmod(0644,place)
- end
- end
- def self.system_date
- `date "+%Y-%m-%d"`.strip
- end
- def self.system_date_stamp
- `date "+%Yw%W/%u"`.strip
- end
- def self.program_found?(prog)
- found=`which #{prog}` #`whereis #{make}`
- (found =~/bin\/#{prog}\b/) ? :true : :false
- end
-end
-module Install
- #%% using a directory and its mapping
- def self.setup_find_create(dir_get,dir_put,exclude_files=['']) #primary,
- begin
- Find.find("#{Project_details.dir.pwd}/#{dir_get}") do |f|
- stub=f.scan(/#{Project_details.dir.pwd}\/#{dir_get}\/(\S+)/).join
- place="#{dir_put}/#{stub}"
- action=case
- when File.file?(f)
- unless f =~/#{exclude_files.inspect}/
- cp(f,place)
- Utils.chmod_file(place)
- "-> #{dir_put}/"
- end
- when File.directory?(f)
- FileUtils.mkpath(place) unless FileTest.directory?(place)
- "./#{dir_get}/"
- else '?'
- end
- puts "#{action}#{stub}"
- end
- rescue
- puts "\n\n<< are you root? required for install >>"
- end
- end
- def self.setup_find_cp_r(dir_get,dir_put) #secondary, using recursive copy
- Find.find("#{Project_details.dir.pwd}/#{dir_get}") do |f|
- stub=f.scan(/#{Project_details.dir.pwd}\/#{dir_get}\/(\S+)/).join
- place="#{dir_put}/#{stub}"
- case
- when File.file?(f)
- cp_r(f,place)
- Utils.chmod_util(place)
- when File.directory?(f)
- mkdir(place) unless FileTest.directory?(place)
- end
- end
- end
-end
-module Version_info
- def self.contents(vi)
- <<-WOK
----
-:project: #{vi[:project]}
-:version: #{vi[:version]}
-:date_stamp: #{vi[:date_stamp]}
-:date: "#{vi[:date]}"
- WOK
- end
- module Current
- def self.yml_file_path(version)
- "data/sisu/#{version}/v/version.yml"
- end
- def self.settings(file)
- v="#{Dir.pwd}/#{file}"
- if File.exist?(v)
- YAML::load(File::open(v))
- else ''
- end
- end
- def self.file_stable
- yml_file_path(SiSU_version_dir_stable)
- end
- def self.file_unstable
- yml_file_path(SiSU_version_dir_unstable)
- end
- def self.setting_stable
- settings(file_stable)
- end
- def self.setting_unstable
- settings(file_unstable)
- end
- def self.content_stable
- Version_info.contents(setting_stable)
- end
- def self.content_unstable
- Version_info.contents(setting_unstable)
- end
- end
- module Next
- def self.settings(v)
- {
- project: "#{Project_details.name}",
- version: "#{v}",
- date: "#{Utils.system_date}",
- date_stamp: "#{Utils.system_date_stamp}",
- }
- end
- def self.setting_stable
- settings(SiSU_version_next_stable)
- end
- def self.setting_unstable
- settings(SiSU_version_next_unstable)
- end
- def self.content_stable
- Version_info.contents(setting_stable)
- end
- def self.content_unstable
- Version_info.contents(setting_unstable)
- end
- end
- module Update
- def self.version_info_update_commit(filename,vi_hash_current,vi_content_current,vi_hash_next,vi_content_next)
- ans=%{update #{Project_details.name.downcase} version info replacing:
- #{vi_hash_current.sort}
-with:
- #{vi_hash_next.sort}
-
-#{vi_content_current} becoming:
-#{vi_content_next}
-proceed? }
- resp=Utils.answer?(ans)
- if resp
- fn="#{Dir.pwd}/#{filename}"
- if File.writable?("#{Dir.pwd}/.")
- file_version=File.new(fn,'w+')
- file_version << vi_content_next
- file_version.close
- else
- puts %{*WARN* is the file or directory writable? could not create #{filename}}
- end
- end
- end
- def self.update_stable
- version_info_update_commit(Version_info::Current.file_stable,Version_info::Current.setting_stable,Version_info::Current.content_stable,Version_info::Next.setting_stable,Version_info::Next.content_stable)
- end
- def self.update_unstable
- version_info_update_commit(Version_info::Current.file_unstable,Version_info::Current.setting_unstable,Version_info::Current.content_unstable,Version_info::Next.setting_unstable,Version_info::Next.content_unstable)
- end
- def self.changelog_header(vi)
- <<-WOK
-%% #{vi[:version]}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')})
-http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_#{vi[:version]}
-http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_#{vi[:version]}-1
-http://www.jus.uio.no/sisu/pkg/src/sisu_#{vi[:version]}.orig.tar.xz
- sisu_#{vi[:version]}.orig.tar.xz
- sisu_#{vi[:version]}-1.dsc
- WOK
- end
- def self.changelog_header_stable
- changelog_header(Version_info::Current.setting_stable)
- end
- def self.changelog_header_unstable
- changelog_header(Version_info::Current.setting_unstable)
- end
- end
- self
-end
-module GitExtractTaggedVersionBuild
- def upstream
- system(%{ git checkout upstream })
- end
- def self.git_tagged_versions(vb=nil)
- if vb.tag
- v=if vb.tag =~/sisu_[0-9](?:\.[0-9]){0,2}$/ then vb.tag
- elsif vb.tag =~/^[0-9](?:\.[0-9]){0,2}$/ then 'sisu_' + vb.tag
- else 'sisu_'
- end
- system(%{ git tag -l | ag --nocolor '^#{v}' })
- end
- end
- def self.git_checkout_and_build_version(vb)
- begin
- ver=if vb.tag =~/sisu_[0-9]\.[0-9]+\.[0-9]+/ then vb.tag
- elsif vb.tag =~/^[0-9]\.[0-9]+\.[0-9]+/ then 'sisu_' + vb.tag
- else vb.branch
- end
- install_branch=case vb.branch
- when /^(?:stable|unstable)$/
- "gem_create_build_install_#{vb.branch}"
- when /^(?:all)/
- 'gem_create_build_install'
- else
- 'gem_create_build_install_stable'
- end
- commands =<<-WOK
- git checkout #{ver} &&
- rake #{install_branch};
- WOK
- puts commands
- system(commands)
- ensure
- system(%{
- git checkout upstream
- })
- end
- end
-end
-module Gemspecs
- def self.info(vi)
- puts <<-WOK
---
-name: #{vi[:project].downcase}
-version: #{vi[:version]}
-date: #{vi[:date]}
-summary: #{vi[:project]}
- WOK
- end
- def self.contents(vi,version)
- <<-WOK
-Gem::Specification.new do |s|
- s.name = '#{vi[:project].downcase}'
- s.version = '#{vi[:version]}'
- s.date = '#{vi[:date]}'
- s.summary = '#{vi[:project]}'
- s.description = '#{Project_details.name} gem'
- s.authors = ["Ralph Amissah"]
- s.email = 'ralph.amissah@gmail.com'
- s.files = Dir['lib/#{Project_details.name.downcase}/#{version}/*.rb'] +
- Dir['data/#{Project_details.name.downcase}/#{version}/v/version.yml'] +
- Dir['data/#{Project_details.name.downcase}/image/*'] +
- Dir['bin/#{Project_details.name.downcase}gem'] +
- Dir['bin/#{Project_details.name.downcase}']
- s.license = 'GPL3'
- s.executables << '#{Project_details.name.downcase}gem' << '#{Project_details.name.downcase}'
-end
- WOK
- end
- def self.create(filename,gemspec)
- fn="#{Dir.pwd}/#{filename}.gemspec"
- if File.writable?("#{Dir.pwd}/.")
- file_sisu_gemspec=File.new(fn,'w+')
- file_sisu_gemspec << gemspec
- file_sisu_gemspec.close
- else
- puts %{*WARN* is the file or directory writable? could not create #{filename}}
- end
- end
- def self.build(fn)
- system(%{ gem build #{fn}.gemspec })
- end
- def self.install(fn)
- system(%{
- sudo gem install --no-document --verbose #{fn}.gem
- })
- end
- module Current
- def self.filename_stable
- "#{Project_details.name.downcase}-#{Version_info::Current.setting_stable[:version]}"
- end
- def self.filename_unstable
- "#{Project_details.name.downcase}-#{Version_info::Current.setting_unstable[:version]}"
- end
- def self.info_stable
- Gemspecs.info(Version_info::Current.setting_stable)
- end
- def self.info_unstable
- Gemspecs.info(Version_info::Current.setting_unstable)
- end
- def self.current_stable
- Gemspecs.contents(Version_info::Current.setting_stable,SiSU_version_dir_stable)
- end
- def self.current_unstable
- Gemspecs.contents(Version_info::Current.setting_unstable,SiSU_version_dir_unstable)
- end
- def self.create_stable
- Gemspecs.create(filename_stable,current_stable)
- Gemspecs.create("#{Project_details.name.downcase}-stable",current_stable)
- end
- def self.create_unstable
- Gemspecs.create(filename_unstable,current_unstable)
- Gemspecs.create("#{Project_details.name.downcase}-unstable",current_unstable)
- end
- def self.build_stable
- Gemspecs.build(filename_stable)
- end
- def self.build_unstable
- Gemspecs.build(filename_unstable)
- end
- def self.install_stable
- Gemspecs.install(filename_stable)
- end
- def self.install_unstable
- Gemspecs.install(filename_unstable)
- end
- end
- module Next
- def self.filename_stable
- "#{Project_details.name.downcase}-#{Version_info::Next.setting_stable[:version]}"
- end
- def self.filename_unstable
- "#{Project_details.name.downcase}-#{Version_info::Next.setting_unstable[:version]}"
- end
- def self.setting_stable
- Gemspecs.contents(Version_info::Next.setting_stable,SiSU_version_dir_stable)
- end
- def self.setting_unstable
- Gemspecs.contents(Version_info::Next.setting_unstable,SiSU_version_dir_unstable)
- end
- def self.create_stable
- Gemspecs.create(filename_stable,setting_stable)
- end
- def self.create_unstable
- Gemspecs.create(filename_unstable,setting_unstable)
- end
- def self.build_stable
- Gemspecs.build(filename_stable)
- end
- def self.build_unstable
- Gemspecs.build(filename_unstable)
- end
- def self.install_stable
- Gemspecs.install(filename_stable)
- end
- def self.install_unstable
- Gemspecs.install(filename_unstable)
- end
- end
-end
-module Help
- def self.project_help
- puts <<WOK
-
-#{Project_details.name}
- #{Project_details.rake_rant}
- #{Project_details.platform_notice}
-
-Commands quick start list
- #{Project_details.name} Rake/Rant Help: (Rakefile or Rantfile)
- rake (rake -T or rant -T) # a task list, (generated by Rake or Rant) for more complete and up to date help
-
- Quick start install and remove project #{Project_details.name}, as root:
- rake setup # install #{Project_details.name}
- rake resetup # reinstall #{Project_details.name}
- rake remove_package # clobber/remove #{Project_details.name}, all versions
- alternatively to install as a gem:
- rake gem_create_build_install # create gemspec; build gem, &; install gem, for #{Project_details.name}
-
- NOTE: these install options DO NOT setup #{Project_details.name} dependencies for:
- LaTeX(XeTeX) pdf output; or
- databases (postgresql or sqlite3) for #{Project_details.name} search
- should you wish to produce outputs that depend on them
- (on Debian for example this is the work of the debian installer)
-
-WOK
- end
- def self.tasks(make='rake')
- begin
- system("#{make} -T")
- rescue
- puts 'is either rake or rant installed?'
- end
- end
-end
-#% tasks
-desc "show rake/rant tasks for sisu install, and sisu gem (create spec, build &) install"
- task :default => [:note_sources,:tasks,:note_installation] #[:default_notice,:setup_base]
-desc "Setup/Install #{Project_details.name}"
- task :setup_project=> [:setup_bin_,:setup_lib_,:setup_conf_,:setup_share_,:setup_data_,:setup_man_,:setup_vim_,:src_note]
- task :project=> [:setup_project]
-desc "Setup/Install #{Project_details.name}"
- task :setup=> [:setup_bin_, :setup_lib_,:setup_conf_,:setup_share_,:setup_data_] #, :help]
-desc "Setup/Install #{Project_details.name}: bin, lib and conf (no data)"
- task :setup_base=> [:setup_bin_,:setup_lib_,:setup_conf_,:setup_share_,:setup_man_,:setup_vim_,:note_sources]
- task :base=> [:setup_base]
-desc "Setup/Install #{Project_details.name}: bin, lib, conf & data"
- task :setup_with_data=> [:setup_base,:setup_data]
-desc "check package version"
- task :sisuversion => [:sisu_version]
- task :version => [:sisu_version]
-#desc "set package version"
- task :sisuversionset => [:sisu_version_set,:changelog_headers]
-desc "check gemspec info"
- task :gem_spec => [:gemspec_info]
-desc "create sisu v_stable gemspec"
- task :gem_create_spec_stable => [:gemspecs_stable_create_default_version]
- task :gem5cs => [:gem_create_spec_stable]
- task :gem5createspecs => [:gemspecs_stable_create_default_version]
-desc "create sisu v_unstable gemspec"
- task :gem_create_spec_unstable => [:gemspecs_unstable_create_default_version]
- task :gem6cs => [:gem_create_spec_unstable]
- task :gem6createspecs => [:gemspecs_unstable_create_default_version]
-desc "create gemspec"
- task :gem_create_spec => [:gemspecs_create_default_version]
- task :gemcs => [:gemspecs_create_default_version]
- task :gemc => [:gemspecs_create_default_version]
- task :gemspecscreate => [:gemspecs_create_default_version]
-#---
-desc "build gem"
- task :gem_build => [:gem_build_]
- task :gemb => [:gem_build]
- task :gembuild => [:gem_build]
-desc "build sisu v_stable gem"
- task :gem_build_stable => [:gem_stable_build]
- task :gem5b => [:gem_build_stable]
- task :gem5build => [:gem_build_stable]
-desc "build sisu v_unstable gem"
- task :gem_build_unstable => [:gem_unstable_build]
- task :gem6b => [:gem_build_unstable]
- task :gem6build => [:gem_build_unstable]
-#---
-desc "create, build & install sisu v_stable gem"
- task :gem_create_build_install_stable => [:gemspecs_stable_create_default_version,:gem_stable_build,:gem_stable_install]
- task :gem5cbi => [:gem_create_build_install_stable]
-desc "create, build & install sisu v_unstable gem"
- task :gem_create_build_install_unstable => [:gemspecs_unstable_create_default_version,:gem_unstable_build,:gem_unstable_install]
- task :gem6cbi => [:gem_create_build_install_unstable]
-desc "create, build & install sisu v_stable & v_unstable gem"
- task :gem_create_build_install => [:gemspecs_create_default_version,:gem_build_,:gem_install_]
- task :gemcbi => [:gem_create_build_install]
-#---
-desc "install gem"
- task :gem_install => [:gem_install_]
- task :gemi => [:gem_install]
- task :geminstall => [:gem_install]
-desc "build & install sisu v_stable gem"
- task :gem_build_install_stable => [:gem_stable_build,:gem_install_]
- task :gem5bi => [:gem_build_install_stable]
-desc "build & install sisu v_unstable gem"
- task :gem_build_install_unstable => [:gem_unstable_build,:gem_install_]
- task :gem6bi => [:gem_build_install_unstable]
-desc "build & install gem"
- task :gem_build_install => [:gem_build,:gem_install_]
- task :gembi => [:gem_build_install]
-#-- manually set next version
-#desc "create sisu v_stable gemspec, manually set next version"
- task :gem5csn => [:gemspecs_stable_create_next_version]
-#desc "create sisu v_unstable gemspec, manually set next version"
- task :gem6csn => [:gemspecs_unstable_create_next_version]
-#desc "create gemspec, manually set next version"
- task :gemcsn => [:gemspecs_create_next_version]
- task :gemcn => [:gemspecs_create_next_version]
-#desc "build gem, manually set next version"
- task :gembn => [:gem_build_next_version]
-#desc "build sisu v_stable gem, manually set next version"
- task :gem5bn => [:gem_stable_build_next_version]
-#desc "build sisu v_unstable gem, manually set next version"
- task :gem6bn => [:gem_unstable_build_next_version]
-#desc "install gem, manually set next version"
- task :gemin => [:gem_install_next_version]
-#desc "build & install sisu v_stable gem, manually set next version"
- task :gem5bin => [:gem_stable_build_next_version,:gem_install_next_version]
-#desc "build & install sisu v_unstable gem, manually set next version"
- task :gem6bin => [:gem_unstable_build_next_version,:gem_install_next_version]
-#desc "build & install gem, manually set next version"
- task :gembin => [:gem_build_next_version,:gem_install_next_version]
-#desc "create, build & install sisu v_stable gem, manually set next version"
- task :gem5cbin => [:gemspecs_stable_create_next_version,:gem_stable_build_next_version,:gem_stable_install_next_version]
-#desc "create, build & install sisu v_unstable gem, manually set next version"
- task :gem6cbin => [:gemspecs_unstable_create_next_version,:gem_unstable_build_next_version,:gem_unstable_install_next_version]
-#desc "create, build & install sisu v_stable & v_unstable gem, manually set next version"
- task :gemcbin => [:gemspecs_create_next_version,:gem_build_next_version,:gem_install_next_version]
-#---
-#desc "check changelog headers"
- task :changelogheaders => [:changelog_headers]
- task :dev => [:note_developer]
- task :developer_note => [:note_developer]
-if File.directory?('bin')
- desc "Setup #{Project_details.name} bin only, synonym :bin"
- task :setup_bin => [:setup_bin_]
- task :bin => [:setup_bin]
-end
-if File.directory?('lib')
- desc "Setup #{Project_details.name} lib only, synonym :lib"
- task :setup_lib => [:setup_lib_]
- task :lib => [:setup_lib]
-end
-if File.directory?('conf')
- desc "Setup #{Project_details.name} conf only, synonyms :conf & :etc"
- task :setup_conf => [:setup_conf_]
- task :conf => [:setup_conf]
- task :setup_etc => [:setup_conf]
- task :etc => [:setup_conf]
-end
-if File.directory?('data')
- desc "Setup #{Project_details.name} data only, synonyms :data & :examples"
- task :setup_data => [:setup_data_]
- task :data => [:setup_data]
- task :setup_examples => [:setup_data]
- task :examples => [:setup_data]
-end
-if File.directory?('data/sisu')
- #desc "Setup #{Project_details.name} shared data only (odf & shared images)"
- task :setup_share => [:setup_share_]
- task :share => [:setup_share]
-end
-if File.directory?('man')
- desc "Setup #{Project_details.name} man pages only, synonyms :man"
- task :setup_man => [:setup_man_]
- task :man => [:setup_man]
-end
-if File.directory?('data/vim')
- desc "Setup #{Project_details.name} vim config files only, synonyms :vim"
- task :setup_vim => [:setup_vim_]
- task :vim => [:setup_vim]
-end
-desc "Remove #{Project_details.name} (all versions)"
- task :remove_package => [:remove_bin, :remove_lib, :remove_conf]
-if File.directory?('bin')
- #desc "Remove #{Project_details.name} bin only"
- task :remove_bin => [:remove_bin]
-end
-if File.directory?('lib')
- #desc "Remove #{Project_details.name} lib only"
- task :remove_lib => [:remove_lib]
-end
-if File.directory?('conf')
- #desc "Remove #{Project_details.name} conf only"
- task :remove_conf => [:remove_conf]
-end
-desc "Re-setup #{Project_details.name}, synonym :reinstall"
- task :resetup => [:remove, :setup]
- task :reinstall => [:remove, :setup]
-#desc "Re-setup #{Project_details.name}: bin, lib, conf (ignore data), synonym :reinstall"
- task :resetup_base => [:remove, :setup_base_]
- task :reinstall_base => [:remove, :setup_base_]
-if File.directory?('bin')
- #desc "Re-setup #{Project_details.name} bin, synonym :reinstall"
- task :resetup_bin => [:remove_bin, :setup_bin_]
- task :reinstall_bin => [:remove_bin, :setup_bin_]
-end
-if File.directory?('lib')
- #desc "Re-setup #{Project_details.name} lib, synonym :reinstall_lib"
- task :resetup_lib => [:remove_lib, :setup_lib_]
- task :reinstall_lib => [:remove_lib, :setup_lib_]
-end
-if File.directory?('conf')
- #desc "Re-setup #{Project_details.name} conf, synonyms :reinstall_conf & :resetup_etc"
- task :resetup_conf => [:remove_conf, :setup_conf_]
- task :reinstall_conf => [:remove_conf, :setup_conf_]
- task :resetup_etc => [:remove_conf, :setup_conf_]
- task :reinstall_etc => [:remove_conf, :setup_conf_]
-end
-if File.directory?('data/sisu')
- #desc "Re-setup #{Project_details.name} shared data, (odf & images)"
- task :resetup_share => [:remove_share, :setup_share_]
- task :reinstall_share => [:remove_share, :setup_share_]
-end
-if File.directory?('man')
- #desc "Re-setup #{Project_details.name} man, synonym :reinstall_man"
- task :resetup_man => [:remove_man, :setup_man_]
- task :reinstall_man => [:remove_man, :setup_man_]
-end
-desc 'Setup Note'
- task :setup_note => [:help]
-desc "System information used by #{Project_details.name}"
- task :system => [:system_info,:project_help,:note_sources]
-desc "show all system info available - parameters found"
- task :system_param => [:system_param_]
-desc "Gem environment information used ruby gems for #{Project_details.name}"
- task :gem_env => [:gem_env_]
-desc 'Help'
- task :help => [:project_help,:system_info,:tasks]
-#desc "Setup/Install #{Project_details.name} (uses filelist)"
- task :install => [:default_notice,:project]
- task :install_bin => [:setup_bin_]
-#desc "search for a version tag e.g. 'tag[5.6.0]'"
- task :tag, [:tag] do |t, args|
- args.with_defaults(:tag => Version_info::Next.setting_stable[:version])
- puts "Check for Version Tag: #{args.tag}"
- print "Version Tag: "
- GitExtractTaggedVersionBuild::git_tagged_versions(args)
- end
-#desc "build and install a specific git tagged version of sisu, e.g. 'build[5.6.0]'"
- task :build, [:tag, :branch] => :done do |t, args|
- args.with_defaults(:tag => '5.6.0', :branch => 'stable')
- puts "Version Tag: #{args.tag}"
- puts "Branch: #{args.branch}"
- GitExtractTaggedVersionBuild::git_tagged_versions(args.tag)
- ans= <<-WOK
- Gem Install SiSU Version
- WOK
- resp=Utils.answer?(ans)
- exit unless resp
- GitExtractTaggedVersionBuild::git_checkout_and_build_version(args)
- end
- task :done do
- puts 'done'
- end
- #%% setup/install tasks
-task :rant_independence do #notice
- resp=''
- while resp.length < 4
- resp='sisu-install' #default name install
- print %{#{Project_details.rake_rant}
- Create a rant dependency independent file
- provide filename default name is "install"
- [Warning, will overwrite file of name provided
- provide name or "quit" to exit]: }
- exit if resp =~/^(?:n|quit|exit)$/
- end
- remove='y' #remove='n'
- if remove =~/y/
- system("rant-import --force --auto #{resp};
- chmod 755 #{resp}
- ")
- else #puts "#{resp} not replaced"
- end
-end
-
-task :default_notice do #notice
- Utils.default_notice
-end
-task :default2 do #secondary
- setup_find_cp_r('bin',Project_details.dir.bin) if File.directory?('bin')
- setup_find_cp_r('lib',Project_details.dir.lib) if File.directory?('lib')
- setup_find_cp_r('conf',Project_details.dir.conf) if File.directory?('conf')
- setup_find_cp_r('data/sisu',Project_details.dir.share) if File.directory?('data/sisu') #
- setup_find_cp_r('data',Project_details.dir.data) if File.directory?('data')
- setup_find_cp_r('data/vim',"#{Project_details.dir.data}/vim") if File.directory?('data/vim')
- setup_find_cp_r('man',Project_details.dir.man) if File.directory?('man')
-end
-task :setup_bin_ do
- exclude_files=['sisugem']
- Install.setup_find_create('bin',Project_details.dir.bin,exclude_files) if File.directory?('bin')
-end
-task :setup_lib_ do
- Install.setup_find_create('lib',Project_details.dir.lib) if File.directory?('lib')
-end
-task :setup_conf_ do
- Install.setup_find_create('conf',Project_details.dir.conf) if File.directory?('conf')
-end
-task :setup_share_ do
- Install.setup_find_create('data/sisu',Project_details.dir.share) if File.directory?('data/sisu')
-end
-task :setup_data_ do
- Install.setup_find_create('data',Project_details.dir.data) if File.directory?('data')
-end
-task :setup_man_ do
- Install.setup_find_create('man',Project_details.dir.man) if File.directory?('man')
- Install.setup_find_create('man.deb/man',Project_details.dir.man) if File.directory?('man.deb/man')
-end
-task :setup_vim_ do
- Install.setup_find_create('data/vim',Project_details.dir.vim) if File.directory?('data/vim')
-end
-task :gemspec_info do
- Gemspecs.info_stable
- Gemspecs.info_unstable
-end
-task :gemspecs_stable_create_default_version do
- Gemspecs::Current.create_stable
-end
-task :gemspecs_unstable_create_default_version do
- Gemspecs::Current.create_unstable
-end
-task :gemspecs_create_default_version do
- Gemspecs::Current.create_stable
- Gemspecs::Current.create_unstable
-end
-task :gemspecs_stable_create_next_version do
- Gemspecs::Next.create_stable
-end
-task :gemspecs_unstable_create_next_version do
- Gemspecs::Next.create_unstable
-end
-task :gemspecs_create_next_version do
- Gemspecs::Next.create_stable
- Gemspecs::Next.create_unstable
-end
-task :gem_stable_build do
- Gemspecs::Current.build_stable
-end
-task :gem_unstable_build do
- Gemspecs::Current.build_unstable
-end
-task :gem_build_ do
- Gemspecs::Current.build_stable
- Gemspecs::Current.build_unstable
-end
-task :gem_stable_build_next_version do
- Gemspecs::Next.build_stable
-end
-task :gem_unstable_build_next_version do
- Gemspecs::Next.build_unstable
-end
-task :gem_build_next_version do
- Gemspecs::Next.build_stable
- Gemspecs::Next.build_unstable
-end
-task :gem_stable_install do
- Gemspecs::Current.install_stable
-end
-task :gem_unstable_install do
- Gemspecs::Current.install_unstable
-end
-task :gem_install_ do
- Gemspecs::Current.install_stable
- Gemspecs::Current.install_unstable
-end
-task :gem_stable_install_next_version do
- Gemspecs::Next.install_stable
-end
-task :gem_unstable_install_next_version do
- Gemspecs::Next.install_unstable
-end
-task :gem_install_next_version do
- Gemspecs::Next.install_stable
- Gemspecs::Next.install_unstable
-end
-task :changelog_headers do
- puts '---'
- puts Version_info::Update.changelog_header_stable
- puts '---'
- puts Version_info::Update.changelog_header_unstable
-end
-task :sisu_version do
- puts Version_info::Next.setting_stable
- puts Version_info::Next.setting_unstable
- puts '---'
- puts Version_info::Current.setting_stable[:project]
- puts Version_info::Current.setting_stable[:version]
- puts Version_info::Current.setting_stable[:date]
- puts Version_info::Current.setting_stable[:date_stamp]
- puts '---'
- puts Version_info::Current.setting_unstable[:project]
- puts Version_info::Current.setting_unstable[:version]
- puts Version_info::Current.setting_unstable[:date]
- puts Version_info::Current.setting_unstable[:date_stamp]
-end
-task :sisu_version_set do
- Version_info::Update.update_stable
- Version_info::Update.update_unstable
-end
- #%% post install
- #%% clobber/remove tasks
-task :remove_bin do
- rm_r "#{Project_details.dir.bin}/#{Project_details.dir.proj}" if FileTest.file?("#{Project_details.dir.bin}/#{Project_details.dir.proj}")
-end
-task :remove_lib do
- rm_r "#{Project_details.dir.lib}/#{Project_details.dir.proj}" if FileTest.directory?("#{Project_details.dir.lib}/#{Project_details.dir.proj}")
-end
-task :remove_conf do
- rm_r "#{Project_details.dir.conf}/#{Project_details.dir.proj}" if FileTest.directory?("#{Project_details.dir.conf}/#{Project_details.dir.proj}")
-end
-task :remove_man do
- rm_r "#{Project_details.dir.man}/**/#{Project_details.dir.proj}" if FileTest.directory?("#{Project_details.dir.man}/man1/#{Project_details.dir.proj}")
-end
-task :remove_version do
- rm_r "#{Project_details.dir.bin}/#{Project_details.dir.proj}" if FileTest.file?("#{Project_details.dir.bin}/#{Project_details.dir.proj}")
- rm_r "#{Project_details.dir.lib}/#{Project_details.dir.proj}/#{Project_details.version}" if FileTest.directory?("#{Project_details.dir.lib}/#{Project_details.dir.proj}/#{Project_details.version}")
- rm_r "#{Project_details.dir.conf}/#{Project_details.dir.proj} if FileTest.directory?("#{Project_details.dir.conf}/#{Project_details.dir.proj}")
-end
-task :remove_package do
- rm_r "#{Project_details.dir.bin}/#{Project_details.dir.proj}" if FileTest.file?("#{Project_details.dir.bin}/#{Project_details.dir.proj}")
- rm_r "#{Project_details.dir.lib}/#{Project_details.dir.proj}" if FileTest.directory?("#{Project_details.dir.lib}/#{Project_details.dir.proj}")
- rm_r "#{Project_details.dir.conf}/#{Project_details.dir.proj}" if FileTest.directory?("#{Project_details.dir.conf}/#{Project_details.dir.proj}")
-end
-task :note_sources do
- puts <<-WOK
-
- SiSU project:
- <http://sisudoc.org>
- <http://www.jus.uio.no/sisu>
- sisu source code is available at:
- <http://sources.sisudoc.org>
- <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary>
- sisu markup samples are provided/packaged separately as sisu-markup-samples:
- <http://sources.sisudoc.org/gitweb/?p=doc/sisu-markup-samples.git;a=summary>
- WOK
-end
-task :note_installation do
- puts <<-WOK
- alternative 0: distribution install, rather than this Rakefile
- a distribution install pulls in the many dependencies used by sisu after
- initial processing to generate and store output, significant amongst these are
- XeTeX & databases (sqlite3 and postgresql)
-
- alternative 1: gem install, you need to:
- create the gemspec; build the gem (from the gemspec); install the gem
- which can be done with the single command:
- rake gem_create_build_install # (to build and install sisu v5 & sisu v6, alias gemcbi)
- separate gems are made/installed for sisu v5 & sisu v6 contained in source:
- rake gem_create_build_install_stable # (to build and install sisu v5, alias gem5cbi)
- rake gem_create_build_install_unstable # (to build and install sisu v6, alias gem6cbi)
- for individual steps (create, build, install) see rake options, rake -T
- to specify sisu version for sisu installed via gem
- sisu _#{Version_info::Current.setting_stable[:version]}_ --version
- sisu _#{Version_info::Current.setting_unstable[:version]}_ --version
- to uninstall sisu installed via gem
- sudo gem uninstall --verbose sisu
- WOK
-end
-task :note_developer do
- puts <<-WOK
-
- changelogheaders
-
- sisuversion
- sisuversionset
-
- gemcsn gem5csn gem6csn
- gembn gem5bn gem6bn
- gemin gem5in gem6in
- gembin gem5bin gem6bin
- gemcbin gem5cbin gem6cbin
- WOK
-end
- #%% help & system info
-task :system_info do
- Project_details.system_info
-end
-task :system_param_ do
- Project_details.env.each {|c| puts c.inspect }
-end
-task :gem_env_ do
- Project_details.gem_env
-end
-task :project_help do
- Help.project_help
-end
-task :tasks do
- Help.tasks
-end
diff --git a/setup/qi_libs.rb b/setup/qi_libs.rb
new file mode 100644
index 00000000..1778be6b
--- /dev/null
+++ b/setup/qi_libs.rb
@@ -0,0 +1,521 @@
+require_relative 'qi_libs_base'
+module Project_details
+ require_relative 'sisu_version'
+ include SiSUversion
+ def self.name
+ 'SiSU'
+ end
+ def self.thor
+ "ruby-thor files for the installation/setup of #{name}"
+ end
+ def self.platform_notice
+ "[#{name} is for Linux/Unix Platforms]"
+ end
+ def self.env
+ RbConfig::CONFIG
+ end
+ def self.host
+ env['host']
+ end
+ def self.dir
+ def self.proj
+ Project_details.name.downcase
+ end
+ def self.arch
+ env['archdir']
+ end
+ def self.sitearch
+ env['sitearchdir']
+ end
+ def self.bin
+ env['bindir']
+ end
+ def self.lib
+ env['sitelibdir']
+ end
+ def self.data
+ env['datadir']
+ end
+ def self.share
+ "#{env['datadir']}/sisu"
+ end
+ def self.conf
+ env['sysconfdir']
+ end
+ def self.man
+ env['mandir']
+ end
+ def self.vim
+ "#{env['datadir']}/sisu/vim"
+ end
+ def self.out
+ "#{env['localstatedir']}/#{proj}"
+ end
+ def self.rubylib
+ env['LIBRUBYARG_SHARED']
+ end
+ def self.pwd
+ Dir.pwd #ENV['PWD']
+ end
+ self
+ end
+ def self.version
+ stamp={}
+ v="#{dir.pwd}/conf/sisu/version.yml"
+ if File.exist?(v)
+ stamp=YAML::load(File::open(v))
+ stamp[:version]
+ else ''
+ end
+ end
+ def self.system_info
+ ##{Project_details.platform_notice}
+ puts <<-WOK
+ Host
+ host: #{Project_details.host}
+ arch: #{Project_details.dir.arch}
+ sitearch: #{Project_details.dir.sitearch}
+ Directories for installation
+ bin: #{Project_details.dir.bin}
+ lib (site-ruby): #{Project_details.dir.lib}/#{Project_details.dir.proj}/v*
+ conf [etc]: #{Project_details.dir.conf}/#{Project_details.dir.proj}
+ data (odf, shared images): #{Project_details.dir.share}
+ vim (vim syntax, highlighting, ftplugin): #{Project_details.dir.data}/sisu/vim
+ data (README, version_manifest): #{Project_details.dir.data}/doc/#{Project_details.dir.proj}
+ man (manual pages): #{Project_details.dir.man}
+ output: #{Project_details.dir.out}
+ processing: #{Project_details.dir.out}/processing
+ www: #{Project_details.dir.out}/www
+ rubylib: #{Project_details.dir.rubylib}
+
+ WOK
+ end
+ def self.gem_env
+ system("gem env")
+ end
+end
+module Utils
+ def self.answer?(ask)
+ resp='redo'
+ print ask + " ['yes', 'no' or 'quit']: "
+ resp=File.new('/dev/tty').gets.strip #resp=gets.strip
+ if resp == 'yes' then true
+ elsif resp == 'no' then false
+ elsif resp =~/^quit|exit$/ then exit
+ else puts "[please type: 'yes', 'no' or 'quit']"
+ answer?(ask)
+ end
+ end
+ def self.default_notice # local help not implemented description incorrect
+ ans= %{#{Project_details.thor}
+ Information on alternative actions is available using:
+ [if ruby-thor is installed:]
+ "#{$called_as} help")
+ Default action selected - "install #{Project_details.name}" proceed? }
+ resp=answer?(ans)
+ exit unless resp
+ end
+ def self.chmod_file(place)
+ if place =~/\/bin/; File.chmod(0755,place)
+ else File.chmod(0644,place)
+ end
+ end
+ def self.chmod_util(place)
+ if place =~/\/bin/; chmod(0755,place)
+ else chmod(0644,place)
+ end
+ end
+ def self.system_date
+ `date "+%Y-%m-%d"`.strip
+ end
+ def self.system_date_stamp
+ `date "+%Yw%W/%u"`.strip
+ end
+ def self.program_found?(prog)
+ found=`which #{prog}` #`whereis #{make}`
+ (found =~/bin\/#{prog}\b/) ? :true : :false
+ end
+end
+module Install
+ #%% using a directory and its mapping
+ def self.setup_find_create(dir_get,dir_put,exclude_files=['']) #primary,
+ begin
+ Find.find("#{Project_details.dir.pwd}/#{dir_get}") do |f|
+ stub=f.scan(/#{Project_details.dir.pwd}\/#{dir_get}\/(\S+)/).join
+ place="#{dir_put}/#{stub}"
+ action=case
+ when File.file?(f)
+ unless f =~/#{exclude_files.inspect}/
+ cp(f,place)
+ Utils.chmod_file(place)
+ "-> #{dir_put}/"
+ end
+ when File.directory?(f)
+ FileUtils.mkpath(place) \
+ unless FileTest.directory?(place)
+ "./#{dir_get}/"
+ else '?'
+ end
+ puts "#{action}#{stub}"
+ end
+ rescue
+ puts "\n\n[ are you root? required for install ]"
+ end
+ end
+ def self.setup_find_cp_r(dir_get,dir_put) #secondary, using recursive copy
+ begin
+ Find.find("#{Project_details.dir.pwd}/#{dir_get}") do |f|
+ stub=f.scan(/#{Project_details.dir.pwd}\/#{dir_get}\/(\S+)/).join
+ place="#{dir_put}/#{stub}"
+ case
+ when File.file?(f)
+ cp_r(f,place)
+ Utils.chmod_util(place)
+ when File.directory?(f)
+ mkdir(place) \
+ unless FileTest.directory?(place)
+ end
+ end
+ rescue
+ puts "\n\n[ are you root? required for install ]"
+ end
+ end
+end
+module Version_info
+ def self.contents(vi)
+ <<-WOK
+---
+:project: #{vi[:project]}
+:version: #{vi[:version]}
+:date_stamp: #{vi[:date_stamp]}
+:date: "#{vi[:date]}"
+ WOK
+ end
+ module Current
+ def self.yml_file_path(version)
+ "data/sisu/#{version}/v/version.yml"
+ end
+ def self.settings(file)
+ v="#{Dir.pwd}/#{file}"
+ if File.exist?(v)
+ YAML::load(File::open(v))
+ else ''
+ end
+ end
+ def self.file_stable
+ yml_file_path(SiSU_version_dir_stable)
+ end
+ def self.file_unstable
+ yml_file_path(SiSU_version_dir_unstable)
+ end
+ def self.setting_stable
+ settings(file_stable)
+ end
+ def self.setting_unstable
+ settings(file_unstable)
+ end
+ def self.content_stable
+ Version_info.contents(setting_stable)
+ end
+ def self.content_unstable
+ Version_info.contents(setting_unstable)
+ end
+ end
+ module Next
+ def self.settings(v)
+ {
+ project: "#{Project_details.name}",
+ version: "#{v}",
+ date: "#{Utils.system_date}",
+ date_stamp: "#{Utils.system_date_stamp}",
+ }
+ end
+ def self.setting_stable
+ settings(SiSU_version_next_stable)
+ end
+ def self.setting_unstable
+ settings(SiSU_version_next_unstable)
+ end
+ def self.content_stable
+ Version_info.contents(setting_stable)
+ end
+ def self.content_unstable
+ Version_info.contents(setting_unstable)
+ end
+ end
+ module Update
+ def self.version_info_update_commit(filename,vi_hash_current,vi_content_current,vi_hash_next,vi_content_next)
+ ans=%{update #{Project_details.name.downcase} version info replacing:
+ #{vi_hash_current.sort}
+with:
+ #{vi_hash_next.sort}
+
+#{vi_content_current} becoming:
+#{vi_content_next}
+proceed? }
+ resp=Utils.answer?(ans)
+ if resp
+ fn="#{Dir.pwd}/#{filename}"
+ if File.writable?("#{Dir.pwd}/.")
+ file_version=File.new(fn,'w+')
+ file_version << vi_content_next
+ file_version.close
+ else
+ puts %{*WARN* is the file or directory writable? could not create #{filename}}
+ end
+ end
+ end
+ def self.update_stable
+ version_info_update_commit(
+ Version_info::Current.file_stable,
+ Version_info::Current.setting_stable,
+ Version_info::Current.content_stable,
+ Version_info::Next.setting_stable,
+ Version_info::Next.content_stable
+ )
+ end
+ def self.update_unstable
+ version_info_update_commit(
+ Version_info::Current.file_unstable,
+ Version_info::Current.setting_unstable,
+ Version_info::Current.content_unstable,
+ Version_info::Next.setting_unstable,
+ Version_info::Next.content_unstable
+ )
+ end
+ def self.changelog_header(vi)
+ <<-WOK
+%% #{vi[:version]}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')})
+http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_#{vi[:version]}
+http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_#{vi[:version]}-1
+http://www.jus.uio.no/sisu/pkg/src/sisu_#{vi[:version]}.orig.tar.xz
+ sisu_#{vi[:version]}.orig.tar.xz
+ sisu_#{vi[:version]}-1.dsc
+ WOK
+ end
+ def self.changelog_header_stable
+ changelog_header(Version_info::Current.setting_stable)
+ end
+ def self.changelog_header_unstable
+ changelog_header(Version_info::Current.setting_unstable)
+ end
+ end
+ self
+end
+module GitExtractTaggedVersionBuild
+ def upstream
+ system(%{ git checkout upstream })
+ end
+ def self.git_tagged_versions(tag=nil)
+ if tag
+ v=if tag =~/sisu_[0-9](?:\.[0-9]){0,2}$/ then tag
+ elsif tag =~/^[0-9](?:\.[0-9]){0,2}$/ then 'sisu_' + tag
+ else 'sisu_'
+ end
+ system(%{ git tag -l | ag --nocolor '^#{v}' })
+ end
+ end
+ def self.git_checkout_and_build_and_install_version(tag,options)
+ begin
+ ver=if tag =~/sisu_[0-9]\.[0-9]+\.[0-9]+/ then tag
+ elsif tag =~/^[0-9]\.[0-9]+\.[0-9]+/ then 'sisu_' + tag
+ else branch
+ end
+ stable=options[:stable] ? '--stable ' : ''
+ unstable=options[:unstable] ? '--unstable ' : ''
+ create=options[:create] ? '--create ' : ''
+ build=options[:build] ? '--build ' : ''
+ install=options[:install] ? '--install ' : ''
+ commands =<<-WOK
+ git checkout #{ver} &&
+ #{$called_as} gem #{ver} #{stable}#{unstable}#{create}#{build}#{install};
+ WOK
+ puts commands
+ begin
+ system(commands)
+ rescue # shell error not caught by ruby, using rake
+ #install_branches=[]
+ #install_branches << 'gem_create_build_stable' \
+ # if options[:stable]
+ #install_branches << 'gem_create_build_unstable' \
+ # if options[:unstable]
+ #commands =%{git checkout #{ver} && }
+ #install_branches.each do |install_branch|
+ # commands += %{rake #{install_branch};}
+ #end
+ #puts commands
+ #system(commands)
+ end
+ rescue
+ ensure
+ system(%{
+ git checkout upstream
+ })
+ end
+ end
+end
+module Gemspecs
+ def self.info(vi)
+ puts <<-WOK
+--
+name: #{vi[:project].downcase}
+version: #{vi[:version]}
+date: #{vi[:date]}
+summary: #{vi[:project]}
+ WOK
+ end
+ def self.contents(vi,version)
+ <<-WOK
+Gem::Specification.new do |s|
+ s.name = '#{vi[:project].downcase}'
+ s.version = '#{vi[:version]}'
+ s.date = '#{vi[:date]}'
+ s.summary = '#{vi[:project]}'
+ s.description = '#{Project_details.name} gem'
+ s.authors = ["Ralph Amissah"]
+ s.email = 'ralph.amissah@gmail.com'
+ s.files = Dir['lib/#{Project_details.name.downcase}/#{version}/*.rb'] +
+ Dir['data/#{Project_details.name.downcase}/#{version}/v/version.yml'] +
+ Dir['data/#{Project_details.name.downcase}/image/*'] +
+ Dir['bin/#{Project_details.name.downcase}gem'] +
+ Dir['bin/#{Project_details.name.downcase}']
+ s.license = 'GPL3'
+ s.executables << '#{Project_details.name.downcase}gem' << '#{Project_details.name.downcase}'
+end
+ WOK
+ end
+ def self.create(filename,gemspec)
+ fn="#{Dir.pwd}/#{filename}.gemspec"
+ if File.writable?("#{Dir.pwd}/.")
+ file_sisu_gemspec=File.new(fn,'w+')
+ file_sisu_gemspec << gemspec
+ file_sisu_gemspec.close
+ else
+ puts %{*WARN* is the file or directory writable? could not create #{filename}}
+ end
+ end
+ def self.build(fn)
+ system(%{ gem build #{fn}.gemspec })
+ end
+ def self.install(fn)
+ system(%{
+ sudo gem install --no-document --verbose #{fn}.gem
+ })
+ end
+ module Current
+ def self.filename_stable
+ Project_details.name.downcase \
+ + '-' \
+ + Version_info::Current.setting_stable[:version]
+ end
+ def self.filename_unstable
+ Project_details.name.downcase \
+ + '-' \
+ + Version_info::Current.setting_unstable[:version]
+ end
+ def self.info_stable
+ Gemspecs.info(Version_info::Current.setting_stable)
+ end
+ def self.info_unstable
+ Gemspecs.info(Version_info::Current.setting_unstable)
+ end
+ def self.current_stable
+ Gemspecs.contents(
+ Version_info::Current.setting_stable,
+ SiSU_version_dir_stable
+ )
+ end
+ def self.current_unstable
+ Gemspecs.contents(
+ Version_info::Current.setting_unstable,
+ SiSU_version_dir_unstable
+ )
+ end
+ def self.create_stable
+ Gemspecs.create(filename_stable,current_stable)
+ Gemspecs.create(
+ "#{Project_details.name.downcase}-stable",
+ current_stable
+ )
+ end
+ def self.create_unstable
+ Gemspecs.create(filename_unstable,current_unstable)
+ Gemspecs.create(
+ "#{Project_details.name.downcase}-unstable",
+ current_unstable
+ )
+ end
+ def self.build_stable
+ Gemspecs.build(filename_stable)
+ end
+ def self.build_unstable
+ Gemspecs.build(filename_unstable)
+ end
+ def self.install_stable
+ Gemspecs.install(filename_stable)
+ end
+ def self.install_unstable
+ Gemspecs.install(filename_unstable)
+ end
+ end
+ module Next
+ def self.filename_stable
+ Project_details.name.downcase \
+ + '-' \
+ + Version_info::Next.setting_stable[:version]
+ end
+ def self.filename_unstable
+ Project_details.name.downcase \
+ + '-' \
+ + Version_info::Next.setting_unstable[:version]
+ end
+ def self.setting_stable
+ Gemspecs.contents(
+ Version_info::Next.setting_stable,
+ SiSU_version_dir_stable
+ )
+ end
+ def self.setting_unstable
+ Gemspecs.contents(
+ Version_info::Next.setting_unstable,
+ SiSU_version_dir_unstable
+ )
+ end
+ def self.create_stable
+ Gemspecs.create(filename_stable,setting_stable)
+ end
+ def self.create_unstable
+ Gemspecs.create(filename_unstable,setting_unstable)
+ end
+ def self.build_stable
+ Gemspecs.build(filename_stable)
+ end
+ def self.build_unstable
+ Gemspecs.build(filename_unstable)
+ end
+ def self.install_stable
+ Gemspecs.install(filename_stable)
+ end
+ def self.install_unstable
+ Gemspecs.install(filename_unstable)
+ end
+ end
+end
+module Package
+ def self.sequence
+ puts <<-WOK
+ --update-version # update package version
+ # not included:
+ # --tag # git tags upstream version
+ # --merge # git merge upstream tag into debian/sid
+ # --dch # dch create and edit
+ # --dch-commit # dch commit
+ # --build # git-buildpackage
+ # --git_push # git push changes
+ # --dput # dput package
+ # --reprepro_update # reprepro update
+ # --reprepro_push # reprepro rsync changes
+ WOK
+ end
+end
+
diff --git a/setup/qi_libs_base.rb b/setup/qi_libs_base.rb
new file mode 100644
index 00000000..cd411d63
--- /dev/null
+++ b/setup/qi_libs_base.rb
@@ -0,0 +1,345 @@
+module Project_details
+ require_relative 'sisu_version'
+ include SiSUversion
+ def self.name
+ 'SiSU'
+ end
+ def self.thor
+ "ruby-thor files for the installation/setup of #{name}"
+ end
+ def self.platform_notice
+ "[#{name} is for Linux/Unix Platforms]"
+ end
+ def self.env
+ RbConfig::CONFIG
+ end
+ def self.host
+ env['host']
+ end
+ def self.dir
+ def self.proj
+ Project_details.name.downcase
+ end
+ def self.arch
+ env['archdir']
+ end
+ def self.sitearch
+ env['sitearchdir']
+ end
+ def self.bin
+ env['bindir']
+ end
+ def self.lib
+ env['sitelibdir']
+ end
+ def self.data
+ env['datadir']
+ end
+ def self.share
+ "#{env['datadir']}/sisu"
+ end
+ def self.conf
+ env['sysconfdir']
+ end
+ def self.man
+ env['mandir']
+ end
+ def self.vim
+ "#{env['datadir']}/sisu/vim"
+ end
+ def self.out
+ "#{env['localstatedir']}/#{proj}"
+ end
+ def self.rubylib
+ env['LIBRUBYARG_SHARED']
+ end
+ def self.pwd
+ Dir.pwd #ENV['PWD']
+ end
+ self
+ end
+ def self.version
+ stamp={}
+ v="#{dir.pwd}/conf/sisu/version.yml"
+ if File.exist?(v)
+ stamp=YAML::load(File::open(v))
+ stamp[:version]
+ else ''
+ end
+ end
+ def self.system_info
+ ##{Project_details.platform_notice}
+ puts <<-WOK
+ Host
+ host: #{Project_details.host}
+ arch: #{Project_details.dir.arch}
+ sitearch: #{Project_details.dir.sitearch}
+ Directories for installation
+ bin: #{Project_details.dir.bin}
+ lib (site-ruby): #{Project_details.dir.lib}/#{Project_details.dir.proj}/v*
+ conf [etc]: #{Project_details.dir.conf}/#{Project_details.dir.proj}
+ data (odf, shared images): #{Project_details.dir.share}
+ vim (vim syntax, highlighting, ftplugin): #{Project_details.dir.data}/sisu/vim
+ data (README, version_manifest): #{Project_details.dir.data}/doc/#{Project_details.dir.proj}
+ man (manual pages): #{Project_details.dir.man}
+ output: #{Project_details.dir.out}
+ processing: #{Project_details.dir.out}/processing
+ www: #{Project_details.dir.out}/www
+ rubylib: #{Project_details.dir.rubylib}
+
+ WOK
+ end
+end
+module Utils
+ def self.answer?(ask)
+ resp='redo'
+ print ask + " ['yes', 'no' or 'quit']: "
+ resp=File.new('/dev/tty').gets.strip #resp=gets.strip
+ if resp == 'yes' then true
+ elsif resp == 'no' then false
+ elsif resp =~/^quit|exit$/ then exit
+ else puts "[please type: 'yes', 'no' or 'quit']"
+ answer?(ask)
+ end
+ end
+ def self.default_notice # local help not implemented description incorrect
+ ans= %{#{Project_details.thor}
+ Information on alternative actions is available using:
+ [if ruby-thor is installed:]
+ "#{$called_as} help")
+ Default action selected - "install #{Project_details.name}" proceed? }
+ resp=answer?(ans)
+ exit unless resp
+ end
+ def self.chmod_file(place)
+ if place =~/\/bin/; File.chmod(0755,place)
+ else File.chmod(0644,place)
+ end
+ end
+ def self.chmod_util(place)
+ if place =~/\/bin/; chmod(0755,place)
+ else chmod(0644,place)
+ end
+ end
+ def self.system_date
+ `date "+%Y-%m-%d"`.strip
+ end
+ def self.system_date_stamp
+ `date "+%Yw%W/%u"`.strip
+ end
+ def self.program_found?(prog)
+ found=`which #{prog}` #`whereis #{make}`
+ (found =~/bin\/#{prog}\b/) ? :true : :false
+ end
+end
+module Version_info
+ def self.contents(vi)
+ <<-WOK
+---
+:project: #{vi[:project]}
+:version: #{vi[:version]}
+:date_stamp: #{vi[:date_stamp]}
+:date: "#{vi[:date]}"
+ WOK
+ end
+ module Current
+ def self.yml_file_path(version)
+ "data/sisu/#{version}/v/version.yml"
+ end
+ def self.settings(file)
+ v="#{Dir.pwd}/#{file}"
+ if File.exist?(v)
+ YAML::load(File::open(v))
+ else ''
+ end
+ end
+ def self.file_stable
+ yml_file_path(SiSU_version_dir_stable)
+ end
+ def self.file_unstable
+ yml_file_path(SiSU_version_dir_unstable)
+ end
+ def self.setting_stable
+ settings(file_stable)
+ end
+ def self.setting_unstable
+ settings(file_unstable)
+ end
+ def self.content_stable
+ Version_info.contents(setting_stable)
+ end
+ def self.content_unstable
+ Version_info.contents(setting_unstable)
+ end
+ end
+ module Next
+ def self.settings(v)
+ {
+ project: "#{Project_details.name}",
+ version: "#{v}",
+ date: "#{Utils.system_date}",
+ date_stamp: "#{Utils.system_date_stamp}",
+ }
+ end
+ def self.setting_stable
+ settings(SiSU_version_next_stable)
+ end
+ def self.setting_unstable
+ settings(SiSU_version_next_unstable)
+ end
+ def self.content_stable
+ Version_info.contents(setting_stable)
+ end
+ def self.content_unstable
+ Version_info.contents(setting_unstable)
+ end
+ end
+ module Update
+ def self.version_info_update_commit(filename,vi_hash_current,vi_content_current,vi_hash_next,vi_content_next)
+ ans=%{update #{Project_details.name.downcase} version info replacing:
+ #{vi_hash_current.sort}
+with:
+ #{vi_hash_next.sort}
+
+#{vi_content_current} becoming:
+#{vi_content_next}
+proceed? }
+ resp=Utils.answer?(ans)
+ if resp
+ fn="#{Dir.pwd}/#{filename}"
+ if File.writable?("#{Dir.pwd}/.")
+ file_version=File.new(fn,'w+')
+ file_version << vi_content_next
+ file_version.close
+ else
+ puts %{*WARN* is the file or directory writable? could not create #{filename}}
+ end
+ end
+ end
+ def self.update_stable
+ version_info_update_commit(
+ Version_info::Current.file_stable,
+ Version_info::Current.setting_stable,
+ Version_info::Current.content_stable,
+ Version_info::Next.setting_stable,
+ Version_info::Next.content_stable
+ )
+ end
+ def self.update_unstable
+ version_info_update_commit(
+ Version_info::Current.file_unstable,
+ Version_info::Current.setting_unstable,
+ Version_info::Current.content_unstable,
+ Version_info::Next.setting_unstable,
+ Version_info::Next.content_unstable
+ )
+ end
+ def self.changelog_header(vi)
+ <<-WOK
+%% #{vi[:version]}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')})
+http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_#{vi[:version]}
+http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_#{vi[:version]}-1
+http://www.jus.uio.no/sisu/pkg/src/sisu_#{vi[:version]}.orig.tar.xz
+ sisu_#{vi[:version]}.orig.tar.xz
+ sisu_#{vi[:version]}-1.dsc
+ WOK
+ end
+ def self.changelog_header_stable
+ changelog_header(Version_info::Current.setting_stable)
+ end
+ def self.changelog_header_unstable
+ changelog_header(Version_info::Current.setting_unstable)
+ end
+ end
+ self
+end
+module Package
+ def self.sequence
+ puts <<-WOK
+ --update-version # update package version
+ --tag # git tags upstream version
+ --merge # git merge upstream tag into debian/sid
+ --dch # dch create and edit
+ --dch-commit # dch commit
+ --build # git-buildpackage
+ --git_push # git push changes
+ --dput # dput package
+ --reprepro_update # reprepro update
+ --reprepro_push # reprepro rsync changes
+ WOK
+ end
+ def self.tag_upstream_and_merge_into_debian_sid
+ system(%{
+ git tag -a sisu_#{SiSU_VERSION} -m"SiSU #{SiSU_VERSION}" &&
+ git checkout debian/sid &&
+ git merge sisu_#{SiSU_VERSION}
+ })
+
+ end
+ def self.tag_upstream
+ system(%{
+ git tag -a sisu_#{SiSU_VERSION} -m"SiSU #{SiSU_VERSION}"
+ })
+ end
+ def self.merge_into_debian_sid
+ system(%{
+ git checkout debian/sid &&
+ git merge sisu_#{SiSU_VERSION}
+ })
+ end
+ def self.debian_changelog_create
+ if File.directory?('./debian')
+ system(%{
+ git-dch -R -N #{SiSU_VERSION}-1 --full
+ })
+ else puts 'not in git branch: debian/sid ?'
+ end
+ end
+ def self.debian_changelog_commit
+ system(%{
+ git commit -a -m"debian/changelog (#{SiSU_VERSION}-1)"
+ })
+ end
+ def self.debian_package_build
+ system(%{
+ git-buildpackage --git-upstream-tag=sisu_%(version)s --git-debian-tag=debian/sisu_%(version)s --git-tag --git-keyid=#{Dev::GPGpubKey}
+ })
+ end
+ def self.debian_package_dput
+ #system(%{
+ # dput -s sisu_#{SiSU_VERSION}-1_amd64.changes
+ #})
+ system(%{
+ dput sisu_#{SiSU_VERSION}-1_amd64.changes
+ })
+ end
+ def self.debian_package_push
+ system(%{
+ git push --all &&
+ git push --tags
+ })
+ end
+ def self.reqprepro_update
+ dir_repo=Pathname.new(
+ "#{Dir.home}/grotto/repo/deb.repo/debian/rep"
+ )
+ dir_build=Pathname.new(
+ "#{Dir.home}/grotto/repo/git.repo/code/builds/sisu_#{SiSU_VERSION}-1_amd64.changes"
+ )
+ system(%{
+ cd #{dir_repo.dirname} &&
+ reprepro -Vb . include unstable #{dir_build}
+ cd -
+ })
+ end
+ def self.reprepro_push
+ dir_repo=Pathname.new(
+ "#{Dir.home}/grotto/repo/deb.repo/debian/rep"
+ )
+ system(%{
+ cd #{dir_repo} &&
+ rsync -av --delete-after {dists,pool} sisudoc:/srv/www/sisu/archive/. &&
+ rsync -av --delete-after {dists,pool} ralpha@uio:./sisu/archive/.
+ })
+ end
+end
diff --git a/setup/rbuild b/setup/rbuild
new file mode 100644
index 00000000..315f3a34
--- /dev/null
+++ b/setup/rbuild
@@ -0,0 +1,646 @@
+#!/usr/bin/env ruby
+=begin
+ Common Rakefile, Rantfile installer for SiSU
+ softlink Rakefile and Rantfile to this file
+
+ * Homepage: <http://www.jus.uio.no/sisu/SiSU>
+ <http://search.sisudoc.org>
+ * Download: <http://www.jus.uio.no/sisu/download>
+
+ Copyright (C) 2007 Ralph Amissah
+
+ * License: LGPL - GNU Lesser General Public License
+ [same license as Rant provided within the Rant package]
+
+ * Ralph Amissah <ralph@amissah.com>
+ Ralph Amissah <ralph.amissah@gmail.com>
+
+ Rake is a Ruby build program by Jim Weirich
+ * Rake may be downloaded and installed from:
+ <http://rake.rubyforge.org/>
+
+ Rant is a Ruby build program by Stefan Lang
+ * Rant may be downloaded and installed from:
+ <http://make.rubyforge.org/>
+
+ Notes on use:
+ [if rake is preferred and installed]
+ rake -T
+ [if rant is preferred and installed]
+ rant -T
+
+ SiSU can also be Setup/Installation using:
+ * Minero Aoki's setup.rb, provided along with SiSU, or
+
+=end
+#%% produce a makefile suitable for the target platform
+#require 'mkmf'
+#create_makefile("sisu")
+#% manual settings, edit/update as required (note current default settings are obtained from sisu version yml file)
+require 'find'
+require 'fileutils'
+#require 'ftools'
+require 'rbconfig.rb'
+require 'yaml'
+include FileUtils
+require_relative 'sisu_version' # sisu_version.rb
+ include SiSUversion
+require_relative 'rbuild_libs' # rbuild_libs.rb
+ include Project_details
+ include Utils
+ include Version_info
+ include Gemspecs
+ include GitExtractTaggedVersionBuild
+require_relative 'rbuild_help' # rbuild_help.rb
+ include Help
+#% tasks
+desc "show rake/rant tasks for sisu install, and sisu gem (create spec, build &) install"
+task :default =>
+ [:note_sources,:tasks,:note_installation] #[:default_notice,:setup_base]
+desc "Setup/Install #{Project_details.name}"
+task :setup_project=>
+ [:setup_bin_,:setup_lib_,:setup_conf_,:setup_share_,:setup_data_,:setup_man_,:setup_vim_,:src_note]
+task :project=> \
+ [:setup_project]
+desc "Setup/Install #{Project_details.name}"
+task :setup=>
+ [:setup_bin_, :setup_lib_,:setup_conf_,:setup_share_,:setup_data_] #, :help]
+desc "Setup/Install #{Project_details.name}: bin, lib and conf (no data)"
+task :setup_base=>
+ [:setup_bin_,:setup_lib_,:setup_conf_,:setup_share_,:setup_man_,:setup_vim_,:note_sources]
+task :base=>
+ [:setup_base]
+desc "Setup/Install #{Project_details.name}: bin, lib, conf & data"
+task :setup_with_data=>
+ [:setup_base,:setup_data]
+desc "check package version"
+task :sisuversion =>
+ [:sisu_version]
+task :version =>
+ [:sisu_version]
+#desc "set package version"
+task :sisuversionset =>
+ [:sisu_version_set,:changelog_headers]
+desc "check gemspec info"
+task :gem_spec =>
+ [:gemspec_info]
+desc "create sisu v_stable gemspec"
+task :gem_create_spec_stable =>
+ [:gemspecs_stable_create_default_version]
+task :gem5cs =>
+ [:gem_create_spec_stable]
+task :gem5createspecs =>
+ [:gemspecs_stable_create_default_version]
+desc "create sisu v_unstable gemspec"
+task :gem_create_spec_unstable =>
+ [:gemspecs_unstable_create_default_version]
+task :gem6cs =>
+ [:gem_create_spec_unstable]
+task :gem6createspecs =>
+ [:gemspecs_unstable_create_default_version]
+desc "create gemspec"
+task :gem_create_spec =>
+ [:gemspecs_create_default_version]
+task :gemcs =>
+ [:gemspecs_create_default_version]
+task :gemc =>
+ [:gemspecs_create_default_version]
+task :gemspecscreate =>
+ [:gemspecs_create_default_version]
+#---
+desc "build gem"
+task :gem_build =>
+ [:gem_build_]
+task :gemb =>
+ [:gem_build]
+task :gembuild =>
+ [:gem_build]
+desc "build sisu v_stable gem"
+task :gem_build_stable =>
+ [:gem_stable_build]
+task :gem5b =>
+ [:gem_build_stable]
+task :gem5build =>
+ [:gem_build_stable]
+desc "build sisu v_unstable gem"
+task :gem_build_unstable =>
+ [:gem_unstable_build]
+task :gem6b =>
+ [:gem_build_unstable]
+task :gem6build =>
+ [:gem_build_unstable]
+#---
+desc "create, build & install sisu v_stable gem"
+ task :gem_create_build_install_stable =>
+ [:gemspecs_stable_create_default_version,:gem_stable_build,:gem_stable_install]
+task :gem5cbi =>
+ [:gem_create_build_install_stable]
+desc "create, build & install sisu v_unstable gem"
+task :gem_create_build_install_unstable =>
+ [:gemspecs_unstable_create_default_version,:gem_unstable_build,:gem_unstable_install]
+task :gem6cbi =>
+ [:gem_create_build_install_unstable]
+desc "create, build & install sisu v_stable & v_unstable gem"
+task :gem_create_build_install =>
+ [:gemspecs_create_default_version,:gem_build_,:gem_install_]
+task :gemcbi =>
+ [:gem_create_build_install]
+#---
+desc "install gem"
+task :gem_install =>
+ [:gem_install_]
+task :gemi =>
+ [:gem_install]
+task :geminstall =>
+ [:gem_install]
+desc "build & install sisu v_stable gem"
+task :gem_build_install_stable =>
+ [:gem_stable_build,:gem_install_]
+task :gem5bi =>
+ [:gem_build_install_stable]
+desc "build & install sisu v_unstable gem"
+task :gem_build_install_unstable =>
+ [:gem_unstable_build,:gem_install_]
+task :gem6bi =>
+ [:gem_build_install_unstable]
+desc "build & install gem"
+task :gem_build_install =>
+ [:gem_build,:gem_install_]
+task :gembi =>
+ [:gem_build_install]
+#-- manually set next version
+#desc "create sisu v_stable gemspec, manually set next version"
+task :gem5csn =>
+ [:gemspecs_stable_create_next_version]
+#desc "create sisu v_unstable gemspec, manually set next version"
+task :gem6csn =>
+ [:gemspecs_unstable_create_next_version]
+#desc "create gemspec, manually set next version"
+task :gemcsn =>
+ [:gemspecs_create_next_version]
+task :gemcn =>
+ [:gemspecs_create_next_version]
+#desc "build gem, manually set next version"
+task :gembn =>
+ [:gem_build_next_version]
+#desc "build sisu v_stable gem, manually set next version"
+task :gem5bn =>
+ [:gem_stable_build_next_version]
+#desc "build sisu v_unstable gem, manually set next version"
+task :gem6bn =>
+ [:gem_unstable_build_next_version]
+#desc "install gem, manually set next version"
+task :gemin =>
+ [:gem_install_next_version]
+#desc "build & install sisu v_stable gem, manually set next version"
+task :gem5bin =>
+ [:gem_stable_build_next_version,:gem_install_next_version]
+#desc "build & install sisu v_unstable gem, manually set next version"
+task :gem6bin =>
+ [:gem_unstable_build_next_version,:gem_install_next_version]
+#desc "build & install gem, manually set next version"
+task :gembin =>
+ [:gem_build_next_version,:gem_install_next_version]
+#desc "create, build & install sisu v_stable gem, manually set next version"
+task :gem5cbin =>
+ [:gemspecs_stable_create_next_version,:gem_stable_build_next_version,:gem_stable_install_next_version]
+#desc "create, build & install sisu v_unstable gem, manually set next version"
+task :gem6cbin =>
+ [:gemspecs_unstable_create_next_version,:gem_unstable_build_next_version,:gem_unstable_install_next_version]
+#desc "create, build & install sisu v_stable & v_unstable gem, manually set next version"
+task :gemcbin =>
+ [:gemspecs_create_next_version,:gem_build_next_version,:gem_install_next_version]
+#---
+#desc "check changelog headers"
+task :changelogheaders =>
+ [:changelog_headers]
+task :dev =>
+ [:note_developer]
+task :developer_note =>
+ [:note_developer]
+if File.directory?('bin')
+ desc "Setup #{Project_details.name} bin only, synonym :bin"
+ task :setup_bin =>
+ [:setup_bin_]
+ task :bin =>
+ [:setup_bin]
+end
+if File.directory?('lib')
+ desc "Setup #{Project_details.name} lib only, synonym :lib"
+ task :setup_lib =>
+ [:setup_lib_]
+ task :lib =>
+ [:setup_lib]
+end
+if File.directory?('conf')
+ desc "Setup #{Project_details.name} conf only, synonyms :conf & :etc"
+ task :setup_conf =>
+ [:setup_conf_]
+ task :conf =>
+ [:setup_conf]
+ task :setup_etc =>
+ [:setup_conf]
+ task :etc =>
+ [:setup_conf]
+end
+if File.directory?('data')
+ desc "Setup #{Project_details.name} data only, synonyms :data & :examples"
+ task :setup_data =>
+ [:setup_data_]
+ task :data =>
+ [:setup_data]
+ task :setup_examples =>
+ [:setup_data]
+ task :examples =>
+ [:setup_data]
+end
+if File.directory?('data/sisu')
+ #desc "Setup #{Project_details.name} shared data only (odf & shared images)"
+ task :setup_share =>
+ [:setup_share_]
+ task :share =>
+ [:setup_share]
+end
+if File.directory?('man')
+ desc "Setup #{Project_details.name} man pages only, synonyms :man"
+ task :setup_man =>
+ [:setup_man_]
+ task :man =>
+ [:setup_man]
+end
+if File.directory?('data/vim')
+ desc "Setup #{Project_details.name} vim config files only, synonyms :vim"
+ task :setup_vim =>
+ [:setup_vim_]
+ task :vim =>
+ [:setup_vim]
+end
+desc "Remove #{Project_details.name} (all versions)"
+task :remove_package =>
+ [:remove_bin, :remove_lib, :remove_conf]
+if File.directory?('bin')
+ #desc "Remove #{Project_details.name} bin only"
+ task :remove_bin =>
+ [:remove_bin]
+end
+if File.directory?('lib')
+ #desc "Remove #{Project_details.name} lib only"
+ task :remove_lib =>
+ [:remove_lib]
+end
+if File.directory?('conf')
+ #desc "Remove #{Project_details.name} conf only"
+ task :remove_conf =>
+ [:remove_conf]
+end
+desc "Re-setup #{Project_details.name}, synonym :reinstall"
+task :resetup =>
+ [:remove, :setup]
+task :reinstall =>
+ [:remove, :setup]
+#desc "Re-setup #{Project_details.name}: bin, lib, conf (ignore data), synonym :reinstall"
+task :resetup_base =>
+ [:remove, :setup_base_]
+task :reinstall_base =>
+ [:remove, :setup_base_]
+if File.directory?('bin')
+ #desc "Re-setup #{Project_details.name} bin, synonym :reinstall"
+ task :resetup_bin =>
+ [:remove_bin, :setup_bin_]
+ task :reinstall_bin =>
+ [:remove_bin, :setup_bin_]
+end
+if File.directory?('lib')
+ #desc "Re-setup #{Project_details.name} lib, synonym :reinstall_lib"
+ task :resetup_lib =>
+ [:remove_lib, :setup_lib_]
+ task :reinstall_lib =>
+ [:remove_lib, :setup_lib_]
+end
+if File.directory?('conf')
+ #desc "Re-setup #{Project_details.name} conf, synonyms :reinstall_conf & :resetup_etc"
+ task :resetup_conf =>
+ [:remove_conf, :setup_conf_]
+ task :reinstall_conf =>
+ [:remove_conf, :setup_conf_]
+ task :resetup_etc =>
+ [:remove_conf, :setup_conf_]
+ task :reinstall_etc =>
+ [:remove_conf, :setup_conf_]
+end
+if File.directory?('data/sisu')
+ #desc "Re-setup #{Project_details.name} shared data, (odf & images)"
+ task :resetup_share =>
+ [:remove_share, :setup_share_]
+ task :reinstall_share =>
+ [:remove_share, :setup_share_]
+end
+if File.directory?('man')
+ #desc "Re-setup #{Project_details.name} man, synonym :reinstall_man"
+ task :resetup_man =>
+ [:remove_man, :setup_man_]
+ task :reinstall_man =>
+ [:remove_man, :setup_man_]
+end
+desc 'Setup Note'
+task :setup_note =>
+ [:help]
+desc "System information used by #{Project_details.name}"
+task :system =>
+ [:system_info,:project_help,:note_sources]
+desc "show all system info available - parameters found"
+task :system_param =>
+ [:system_param_]
+desc "Gem environment information used ruby gems for #{Project_details.name}"
+task :gem_env =>
+ [:gem_env_]
+desc 'Help'
+task :help =>
+ [:project_help,:system_info,:tasks]
+#desc "Setup/Install #{Project_details.name} (uses filelist)"
+task :install =>
+ [:default_notice,:project]
+task :install_bin =>
+ [:setup_bin_]
+#desc "search for a version tag e.g. 'tag[5.6.0]'"
+task :tag, [:tag] do |t, args|
+ args.with_defaults(:tag => Version_info::Next.setting_stable[:version])
+ puts "Check for Version Tag: #{args.tag}"
+ print "Version Tag: "
+ GitExtractTaggedVersionBuild::git_tagged_versions(args)
+end
+#desc "build and install a specific git tagged version of sisu, e.g. 'build[5.6.0]'"
+task :build, [:tag, :branch] => :done do |t, args|
+ args.with_defaults(:tag => '5.6.0', :branch => 'stable')
+ puts "Version Tag: #{args.tag}"
+ puts "Branch: #{args.branch}"
+ GitExtractTaggedVersionBuild::git_tagged_versions(args.tag)
+ ans= <<-WOK
+Gem Install SiSU Version
+ WOK
+ resp=Utils.answer?(ans)
+ exit unless resp
+ GitExtractTaggedVersionBuild::git_checkout_and_build_version(args)
+end
+task :done do
+ puts 'done'
+end
+ #%% setup/install tasks
+task :rant_independence do #notice
+ resp=''
+ while resp.length < 4
+ resp='sisu-install' #default name install
+ print %{#{Project_details.rake_rant}
+ Create a rant dependency independent file
+ provide filename default name is "install"
+ [Warning, will overwrite file of name provided
+ provide name or "quit" to exit]: }
+ exit if resp =~/^(?:n|quit|exit)$/
+ end
+ remove='y' #remove='n'
+ if remove =~/y/
+ system("rant-import --force --auto #{resp};
+ chmod 755 #{resp}
+ ")
+ else #puts "#{resp} not replaced"
+ end
+end
+
+task :default_notice do #notice
+ Utils.default_notice
+end
+task :default2 do #secondary
+ setup_find_cp_r('bin',Project_details.dir.bin) \
+ if File.directory?('bin')
+ setup_find_cp_r('lib',Project_details.dir.lib) \
+ if File.directory?('lib')
+ setup_find_cp_r('conf',Project_details.dir.conf) \
+ if File.directory?('conf')
+ setup_find_cp_r('data/sisu',Project_details.dir.share) \
+ if File.directory?('data/sisu') #
+ setup_find_cp_r('data',Project_details.dir.data) \
+ if File.directory?('data')
+ setup_find_cp_r('data/vim',"#{Project_details.dir.data}/vim") \
+ if File.directory?('data/vim')
+ setup_find_cp_r('man',Project_details.dir.man) \
+ if File.directory?('man')
+end
+task :setup_bin_ do
+ exclude_files=['sisugem']
+ Install.setup_find_create('bin',Project_details.dir.bin,exclude_files) \
+ if File.directory?('bin')
+end
+task :setup_lib_ do
+ Install.setup_find_create('lib',Project_details.dir.lib) \
+ if File.directory?('lib')
+end
+task :setup_conf_ do
+ Install.setup_find_create('conf',Project_details.dir.conf) \
+ if File.directory?('conf')
+end
+task :setup_share_ do
+ Install.setup_find_create('data/sisu',Project_details.dir.share) \
+ if File.directory?('data/sisu')
+end
+task :setup_data_ do
+ Install.setup_find_create('data',Project_details.dir.data) \
+ if File.directory?('data')
+end
+task :setup_man_ do
+ Install.setup_find_create('man',Project_details.dir.man) \
+ if File.directory?('man')
+ Install.setup_find_create('man.deb/man',Project_details.dir.man) \
+ if File.directory?('man.deb/man')
+end
+task :setup_vim_ do
+ Install.setup_find_create('data/vim',Project_details.dir.vim) \
+ if File.directory?('data/vim')
+end
+task :gemspec_info do
+ Gemspecs.info_stable
+ Gemspecs.info_unstable
+end
+task :gemspecs_stable_create_default_version do
+ Gemspecs::Current.create_stable
+end
+task :gemspecs_unstable_create_default_version do
+ Gemspecs::Current.create_unstable
+end
+task :gemspecs_create_default_version do
+ Gemspecs::Current.create_stable
+ Gemspecs::Current.create_unstable
+end
+task :gemspecs_stable_create_next_version do
+ Gemspecs::Next.create_stable
+end
+task :gemspecs_unstable_create_next_version do
+ Gemspecs::Next.create_unstable
+end
+task :gemspecs_create_next_version do
+ Gemspecs::Next.create_stable
+ Gemspecs::Next.create_unstable
+end
+task :gem_stable_build do
+ Gemspecs::Current.build_stable
+end
+task :gem_unstable_build do
+ Gemspecs::Current.build_unstable
+end
+task :gem_build_ do
+ Gemspecs::Current.build_stable
+ Gemspecs::Current.build_unstable
+end
+task :gem_stable_build_next_version do
+ Gemspecs::Next.build_stable
+end
+task :gem_unstable_build_next_version do
+ Gemspecs::Next.build_unstable
+end
+task :gem_build_next_version do
+ Gemspecs::Next.build_stable
+ Gemspecs::Next.build_unstable
+end
+task :gem_stable_install do
+ Gemspecs::Current.install_stable
+end
+task :gem_unstable_install do
+ Gemspecs::Current.install_unstable
+end
+task :gem_install_ do
+ Gemspecs::Current.install_stable
+ Gemspecs::Current.install_unstable
+end
+task :gem_stable_install_next_version do
+ Gemspecs::Next.install_stable
+end
+task :gem_unstable_install_next_version do
+ Gemspecs::Next.install_unstable
+end
+task :gem_install_next_version do
+ Gemspecs::Next.install_stable
+ Gemspecs::Next.install_unstable
+end
+task :changelog_headers do
+ puts '---'
+ puts Version_info::Update.changelog_header_stable
+ puts '---'
+ puts Version_info::Update.changelog_header_unstable
+end
+task :sisu_version do
+ puts Version_info::Next.setting_stable
+ puts Version_info::Next.setting_unstable
+ puts '---'
+ puts Version_info::Current.setting_stable[:project]
+ puts Version_info::Current.setting_stable[:version]
+ puts Version_info::Current.setting_stable[:date]
+ puts Version_info::Current.setting_stable[:date_stamp]
+ puts '---'
+ puts Version_info::Current.setting_unstable[:project]
+ puts Version_info::Current.setting_unstable[:version]
+ puts Version_info::Current.setting_unstable[:date]
+ puts Version_info::Current.setting_unstable[:date_stamp]
+end
+task :sisu_version_set do
+ Version_info::Update.update_stable
+ Version_info::Update.update_unstable
+end
+ #%% post install
+ #%% clobber/remove tasks
+task :remove_bin do
+ rm_r "#{Project_details.dir.bin}/#{Project_details.dir.proj}" \
+ if FileTest.file?("#{Project_details.dir.bin}/#{Project_details.dir.proj}")
+end
+task :remove_lib do
+ rm_r "#{Project_details.dir.lib}/#{Project_details.dir.proj}" \
+ if FileTest.directory?("#{Project_details.dir.lib}/#{Project_details.dir.proj}")
+end
+task :remove_conf do
+ rm_r "#{Project_details.dir.conf}/#{Project_details.dir.proj}" \
+ if FileTest.directory?("#{Project_details.dir.conf}/#{Project_details.dir.proj}")
+end
+task :remove_man do
+ rm_r "#{Project_details.dir.man}/**/#{Project_details.dir.proj}" \
+ if FileTest.directory?("#{Project_details.dir.man}/man1/#{Project_details.dir.proj}")
+end
+task :remove_version do
+ rm_r "#{Project_details.dir.bin}/#{Project_details.dir.proj}" \
+ if FileTest.file?("#{Project_details.dir.bin}/#{Project_details.dir.proj}")
+ rm_r "#{Project_details.dir.lib}/#{Project_details.dir.proj}/#{Project_details.version}" \
+ if FileTest.directory?("#{Project_details.dir.lib}/#{Project_details.dir.proj}/#{Project_details.version}")
+ rm_r "#{Project_details.dir.conf}/#{Project_details.dir.proj} \
+ if FileTest.directory?("#{Project_details.dir.conf}/#{Project_details.dir.proj}")
+end
+task :remove_package do
+ rm_r "#{Project_details.dir.bin}/#{Project_details.dir.proj}" \
+ if FileTest.file?("#{Project_details.dir.bin}/#{Project_details.dir.proj}")
+ rm_r "#{Project_details.dir.lib}/#{Project_details.dir.proj}" \
+ if FileTest.directory?("#{Project_details.dir.lib}/#{Project_details.dir.proj}")
+ rm_r "#{Project_details.dir.conf}/#{Project_details.dir.proj}" \
+ if FileTest.directory?("#{Project_details.dir.conf}/#{Project_details.dir.proj}")
+end
+task :note_sources do
+ puts <<-WOK
+
+ SiSU project:
+ <http://sisudoc.org>
+ <http://www.jus.uio.no/sisu>
+ sisu source code is available at:
+ <http://sources.sisudoc.org>
+ <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary>
+ sisu markup samples are provided/packaged separately as sisu-markup-samples:
+ <http://sources.sisudoc.org/gitweb/?p=doc/sisu-markup-samples.git;a=summary>
+ WOK
+end
+task :note_installation do
+ puts <<-WOK
+ alternative 0: distribution install, rather than this Rakefile
+ a distribution install pulls in the many dependencies used by sisu after
+ initial processing to generate and store output, significant amongst these are
+ XeTeX & databases (sqlite3 and postgresql)
+
+ alternative 1: gem install, you need to:
+ create the gemspec; build the gem (from the gemspec); install the gem
+ which can be done with the single command:
+ rake gem_create_build_install # (to build and install sisu v5 & sisu v6, alias gemcbi)
+ separate gems are made/installed for sisu v5 & sisu v6 contained in source:
+ rake gem_create_build_install_stable # (to build and install sisu v5, alias gem5cbi)
+ rake gem_create_build_install_unstable # (to build and install sisu v6, alias gem6cbi)
+ for individual steps (create, build, install) see rake options, rake -T
+ to specify sisu version for sisu installed via gem
+ sisu _#{Version_info::Current.setting_stable[:version]}_ --version
+ sisu _#{Version_info::Current.setting_unstable[:version]}_ --version
+ to uninstall sisu installed via gem
+ sudo gem uninstall --verbose sisu
+ WOK
+end
+task :note_developer do
+ puts <<-WOK
+
+ changelogheaders
+
+ sisuversion
+ sisuversionset
+
+ gemcsn gem5csn gem6csn
+ gembn gem5bn gem6bn
+ gemin gem5in gem6in
+ gembin gem5bin gem6bin
+ gemcbin gem5cbin gem6cbin
+ WOK
+end
+ #%% help & system info
+task :system_info do
+ Project_details.system_info
+end
+task :system_param_ do
+ Project_details.env.each {|c| puts c.inspect }
+end
+task :gem_env_ do
+ Project_details.gem_env
+end
+task :project_help do
+ Help.project_help
+end
+task :tasks do
+ Help.tasks
+end
diff --git a/setup/rbuild_help.rb b/setup/rbuild_help.rb
new file mode 100644
index 00000000..fc56c2fa
--- /dev/null
+++ b/setup/rbuild_help.rb
@@ -0,0 +1,36 @@
+module Help
+ def self.project_help
+ puts <<WOK
+
+#{Project_details.name}
+ #{Project_details.rake_rant}
+ #{Project_details.platform_notice}
+
+Commands quick start list
+ #{Project_details.name} Rake/Rant Help: (Rakefile or Rantfile)
+ rake (rake -T or rant -T) # a task list, (generated by Rake or Rant) for more complete and up to date help
+
+ Quick start install and remove project #{Project_details.name}, as root:
+ rake setup # install #{Project_details.name}
+ rake resetup # reinstall #{Project_details.name}
+ rake remove_package # clobber/remove #{Project_details.name}, all versions
+ alternatively to install as a gem:
+ rake gem_create_build_install # create gemspec; build gem, &; install gem, for #{Project_details.name}
+
+ NOTE: these install options DO NOT setup #{Project_details.name} dependencies for:
+ LaTeX(XeTeX) pdf output; or
+ databases (postgresql or sqlite3) for #{Project_details.name} search
+ should you wish to produce outputs that depend on them
+ (on Debian for example this is the work of the debian installer)
+
+WOK
+ end
+ def self.tasks(make='rake')
+ begin
+ system("#{make} -T")
+ rescue
+ puts 'is either rake or rant installed?'
+ end
+ end
+end
+
diff --git a/setup/rbuild_libs.rb b/setup/rbuild_libs.rb
new file mode 100644
index 00000000..5f4b8b0e
--- /dev/null
+++ b/setup/rbuild_libs.rb
@@ -0,0 +1,518 @@
+module Project_details
+ require_relative 'sisu_version'
+ include SiSUversion
+ def self.name
+ 'SiSU'
+ end
+ def self.thor
+ "ruby-thor files for the installation/setup of #{name}"
+ end
+ def self.platform_notice
+ "[#{name} is for Linux/Unix Platforms]"
+ end
+ def self.env
+ RbConfig::CONFIG
+ end
+ def self.host
+ env['host']
+ end
+ def self.dir
+ def self.proj
+ Project_details.name.downcase
+ end
+ def self.arch
+ env['archdir']
+ end
+ def self.sitearch
+ env['sitearchdir']
+ end
+ def self.bin
+ env['bindir']
+ end
+ def self.lib
+ env['sitelibdir']
+ end
+ def self.data
+ env['datadir']
+ end
+ def self.share
+ "#{env['datadir']}/sisu"
+ end
+ def self.conf
+ env['sysconfdir']
+ end
+ def self.man
+ env['mandir']
+ end
+ def self.vim
+ "#{env['datadir']}/sisu/vim"
+ end
+ def self.out
+ "#{env['localstatedir']}/#{proj}"
+ end
+ def self.rubylib
+ env['LIBRUBYARG_SHARED']
+ end
+ def self.pwd
+ Dir.pwd #ENV['PWD']
+ end
+ self
+ end
+ def self.version
+ stamp={}
+ v="#{dir.pwd}/conf/sisu/version.yml"
+ if File.exist?(v)
+ stamp=YAML::load(File::open(v))
+ stamp[:version]
+ else ''
+ end
+ end
+ def self.system_info
+ ##{Project_details.platform_notice}
+ puts <<-WOK
+ Host
+ host: #{Project_details.host}
+ arch: #{Project_details.dir.arch}
+ sitearch: #{Project_details.dir.sitearch}
+ Directories for installation
+ bin: #{Project_details.dir.bin}
+ lib (site-ruby): #{Project_details.dir.lib}/#{Project_details.dir.proj}/v*
+ conf [etc]: #{Project_details.dir.conf}/#{Project_details.dir.proj}
+ data (odf, shared images): #{Project_details.dir.share}
+ vim (vim syntax, highlighting, ftplugin): #{Project_details.dir.data}/sisu/vim
+ data (README, version_manifest): #{Project_details.dir.data}/doc/#{Project_details.dir.proj}
+ man (manual pages): #{Project_details.dir.man}
+ output: #{Project_details.dir.out}
+ processing: #{Project_details.dir.out}/processing
+ www: #{Project_details.dir.out}/www
+ rubylib: #{Project_details.dir.rubylib}
+
+ WOK
+ end
+ def self.gem_env
+ system("gem env")
+ end
+end
+module Utils
+ def self.answer?(ask)
+ resp='redo'
+ print ask + " ['yes', 'no' or 'quit']: "
+ resp=File.new('/dev/tty').gets.strip #resp=gets.strip
+ if resp == 'yes' then true
+ elsif resp == 'no' then false
+ elsif resp =~/^quit|exit$/ then exit
+ else puts "[please type: 'yes', 'no' or 'quit']"
+ answer?(ask)
+ end
+ end
+ def self.default_notice # local help not implemented description incorrect
+ ans= %{#{Project_details.thor}
+ Information on alternative actions is available using:
+ [if ruby-thor is installed:]
+ "rake help")
+ Default action selected - "install #{Project_details.name}" proceed? }
+ resp=answer?(ans)
+ exit unless resp
+ end
+ def self.chmod_file(place)
+ if place =~/\/bin/; File.chmod(0755,place)
+ else File.chmod(0644,place)
+ end
+ end
+ def self.chmod_util(place)
+ if place =~/\/bin/; chmod(0755,place)
+ else chmod(0644,place)
+ end
+ end
+ def self.system_date
+ `date "+%Y-%m-%d"`.strip
+ end
+ def self.system_date_stamp
+ `date "+%Yw%W/%u"`.strip
+ end
+ def self.program_found?(prog)
+ found=`which #{prog}` #`whereis #{make}`
+ (found =~/bin\/#{prog}\b/) ? :true : :false
+ end
+end
+module Install
+ #%% using a directory and its mapping
+ def self.setup_find_create(dir_get,dir_put,exclude_files=['']) #primary,
+ begin
+ Find.find("#{Project_details.dir.pwd}/#{dir_get}") do |f|
+ stub=f.scan(/#{Project_details.dir.pwd}\/#{dir_get}\/(\S+)/).join
+ place="#{dir_put}/#{stub}"
+ action=case
+ when File.file?(f)
+ unless f =~/#{exclude_files.inspect}/
+ cp(f,place)
+ Utils.chmod_file(place)
+ "-> #{dir_put}/"
+ end
+ when File.directory?(f)
+ FileUtils.mkpath(place) \
+ unless FileTest.directory?(place)
+ "./#{dir_get}/"
+ else '?'
+ end
+ puts "#{action}#{stub}"
+ end
+ rescue
+ puts "\n\n<< are you root? required for install >>"
+ end
+ end
+ def self.setup_find_cp_r(dir_get,dir_put) #secondary, using recursive copy
+ begin
+ Find.find("#{Project_details.dir.pwd}/#{dir_get}") do |f|
+ stub=f.scan(/#{Project_details.dir.pwd}\/#{dir_get}\/(\S+)/).join
+ place="#{dir_put}/#{stub}"
+ case
+ when File.file?(f)
+ cp_r(f,place)
+ Utils.chmod_util(place)
+ when File.directory?(f)
+ mkdir(place) \
+ unless FileTest.directory?(place)
+ end
+ end
+ rescue
+ puts "\n\n<< are you root? required for install >>"
+ end
+ end
+end
+module Version_info
+ def self.contents(vi)
+ <<-WOK
+---
+:project: #{vi[:project]}
+:version: #{vi[:version]}
+:date_stamp: #{vi[:date_stamp]}
+:date: "#{vi[:date]}"
+ WOK
+ end
+ module Current
+ def self.yml_file_path(version)
+ "data/sisu/#{version}/v/version.yml"
+ end
+ def self.settings(file)
+ v="#{Dir.pwd}/#{file}"
+ if File.exist?(v)
+ YAML::load(File::open(v))
+ else ''
+ end
+ end
+ def self.file_stable
+ yml_file_path(SiSU_version_dir_stable)
+ end
+ def self.file_unstable
+ yml_file_path(SiSU_version_dir_unstable)
+ end
+ def self.setting_stable
+ settings(file_stable)
+ end
+ def self.setting_unstable
+ settings(file_unstable)
+ end
+ def self.content_stable
+ Version_info.contents(setting_stable)
+ end
+ def self.content_unstable
+ Version_info.contents(setting_unstable)
+ end
+ end
+ module Next
+ def self.settings(v)
+ {
+ project: "#{Project_details.name}",
+ version: "#{v}",
+ date: "#{Utils.system_date}",
+ date_stamp: "#{Utils.system_date_stamp}",
+ }
+ end
+ def self.setting_stable
+ settings(SiSU_version_next_stable)
+ end
+ def self.setting_unstable
+ settings(SiSU_version_next_unstable)
+ end
+ def self.content_stable
+ Version_info.contents(setting_stable)
+ end
+ def self.content_unstable
+ Version_info.contents(setting_unstable)
+ end
+ end
+ module Update
+ def self.version_info_update_commit(filename,vi_hash_current,vi_content_current,vi_hash_next,vi_content_next)
+ ans=%{update #{Project_details.name.downcase} version info replacing:
+ #{vi_hash_current.sort}
+with:
+ #{vi_hash_next.sort}
+
+#{vi_content_current} becoming:
+#{vi_content_next}
+proceed? }
+ resp=Utils.answer?(ans)
+ if resp
+ fn="#{Dir.pwd}/#{filename}"
+ if File.writable?("#{Dir.pwd}/.")
+ file_version=File.new(fn,'w+')
+ file_version << vi_content_next
+ file_version.close
+ else
+ puts %{*WARN* is the file or directory writable? could not create #{filename}}
+ end
+ end
+ end
+ def self.update_stable
+ version_info_update_commit(
+ Version_info::Current.file_stable,
+ Version_info::Current.setting_stable,
+ Version_info::Current.content_stable,
+ Version_info::Next.setting_stable,
+ Version_info::Next.content_stable
+ )
+ end
+ def self.update_unstable
+ version_info_update_commit(
+ Version_info::Current.file_unstable,
+ Version_info::Current.setting_unstable,
+ Version_info::Current.content_unstable,
+ Version_info::Next.setting_unstable,
+ Version_info::Next.content_unstable
+ )
+ end
+ def self.changelog_header(vi)
+ <<-WOK
+%% #{vi[:version]}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')})
+http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_#{vi[:version]}
+http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_#{vi[:version]}-1
+http://www.jus.uio.no/sisu/pkg/src/sisu_#{vi[:version]}.orig.tar.xz
+ sisu_#{vi[:version]}.orig.tar.xz
+ sisu_#{vi[:version]}-1.dsc
+ WOK
+ end
+ def self.changelog_header_stable
+ changelog_header(Version_info::Current.setting_stable)
+ end
+ def self.changelog_header_unstable
+ changelog_header(Version_info::Current.setting_unstable)
+ end
+ end
+ self
+end
+module GitExtractTaggedVersionBuild
+ def upstream
+ system(%{ git checkout upstream })
+ end
+ def self.git_tagged_versions(vb=nil)
+ if vb.tag
+ v=if vb.tag =~/sisu_[0-9](?:\.[0-9]){0,2}$/ then vb.tag
+ elsif vb.tag =~/^[0-9](?:\.[0-9]){0,2}$/ then 'sisu_' + vb.tag
+ else 'sisu_'
+ end
+ system(%{ git tag -l | ag --nocolor '^#{v}' })
+ end
+ end
+ def self.git_checkout_and_build_version(vb)
+ begin
+ ver=if vb.tag =~/sisu_[0-9]\.[0-9]+\.[0-9]+/ then vb.tag
+ elsif vb.tag =~/^[0-9]\.[0-9]+\.[0-9]+/ then 'sisu_' + vb.tag
+ else vb.branch
+ end
+ install_branch=case vb.branch
+ when /^(?:stable|unstable)$/
+ "gem_create_build_#{vb.branch}"
+ when /^(?:all)/
+ 'gem_create_build'
+ else
+ 'gem_create_build_stable'
+ #'gem_create_build_install_stable'
+ end
+ commands =<<-WOK
+ git checkout #{ver} &&
+ rake #{install_branch};
+ WOK
+ puts commands
+ system(commands)
+ ensure
+ system(%{
+ git checkout upstream
+ })
+ end
+ end
+ def self.git_checkout_and_build_and_install_version(vb)
+ begin
+ ver=if vb.tag =~/sisu_[0-9]\.[0-9]+\.[0-9]+/ then vb.tag
+ elsif vb.tag =~/^[0-9]\.[0-9]+\.[0-9]+/ then 'sisu_' + vb.tag
+ else vb.branch
+ end
+ install_branch=case vb.branch
+ when /^(?:stable|unstable)$/
+ "gem_create_build_install_#{vb.branch}"
+ when /^(?:all)/
+ 'gem_create_build_install'
+ else
+ 'gem_create_build_install_stable'
+ end
+ commands =<<-WOK
+ git checkout #{ver} &&
+ rake #{install_branch};
+ WOK
+ puts commands
+ system(commands)
+ ensure
+ system(%{
+ git checkout upstream
+ })
+ end
+ end
+end
+module Gemspecs
+ def self.info(vi)
+ puts <<-WOK
+--
+name: #{vi[:project].downcase}
+version: #{vi[:version]}
+date: #{vi[:date]}
+summary: #{vi[:project]}
+ WOK
+ end
+ def self.contents(vi,version)
+ <<-WOK
+Gem::Specification.new do |s|
+ s.name = '#{vi[:project].downcase}'
+ s.version = '#{vi[:version]}'
+ s.date = '#{vi[:date]}'
+ s.summary = '#{vi[:project]}'
+ s.description = '#{Project_details.name} gem'
+ s.authors = ["Ralph Amissah"]
+ s.email = 'ralph.amissah@gmail.com'
+ s.files = Dir['lib/#{Project_details.name.downcase}/#{version}/*.rb'] +
+ Dir['data/#{Project_details.name.downcase}/#{version}/v/version.yml'] +
+ Dir['data/#{Project_details.name.downcase}/image/*'] +
+ Dir['bin/#{Project_details.name.downcase}gem'] +
+ Dir['bin/#{Project_details.name.downcase}']
+ s.license = 'GPL3'
+ s.executables << '#{Project_details.name.downcase}gem' << '#{Project_details.name.downcase}'
+end
+ WOK
+ end
+ def self.create(filename,gemspec)
+ fn="#{Dir.pwd}/#{filename}.gemspec"
+ if File.writable?("#{Dir.pwd}/.")
+ file_sisu_gemspec=File.new(fn,'w+')
+ file_sisu_gemspec << gemspec
+ file_sisu_gemspec.close
+ else
+ puts %{*WARN* is the file or directory writable? could not create #{filename}}
+ end
+ end
+ def self.build(fn)
+ system(%{ gem build #{fn}.gemspec })
+ end
+ def self.install(fn)
+ system(%{
+ sudo gem install --no-document --verbose #{fn}.gem
+ })
+ end
+ module Current
+ def self.filename_stable
+ Project_details.name.downcase \
+ + '-' \
+ + Version_info::Current.setting_stable[:version]
+ end
+ def self.filename_unstable
+ Project_details.name.downcase \
+ + '-' \
+ + Version_info::Current.setting_unstable[:version]
+ end
+ def self.info_stable
+ Gemspecs.info(Version_info::Current.setting_stable)
+ end
+ def self.info_unstable
+ Gemspecs.info(Version_info::Current.setting_unstable)
+ end
+ def self.current_stable
+ Gemspecs.contents(
+ Version_info::Current.setting_stable,
+ SiSU_version_dir_stable
+ )
+ end
+ def self.current_unstable
+ Gemspecs.contents(
+ Version_info::Current.setting_unstable,
+ SiSU_version_dir_unstable
+ )
+ end
+ def self.create_stable
+ Gemspecs.create(filename_stable,current_stable)
+ Gemspecs.create(
+ "#{Project_details.name.downcase}-stable",
+ current_stable
+ )
+ end
+ def self.create_unstable
+ Gemspecs.create(filename_unstable,current_unstable)
+ Gemspecs.create(
+ "#{Project_details.name.downcase}-unstable",
+ current_unstable
+ )
+ end
+ def self.build_stable
+ Gemspecs.build(filename_stable)
+ end
+ def self.build_unstable
+ Gemspecs.build(filename_unstable)
+ end
+ def self.install_stable
+ Gemspecs.install(filename_stable)
+ end
+ def self.install_unstable
+ Gemspecs.install(filename_unstable)
+ end
+ end
+ module Next
+ def self.filename_stable
+ Project_details.name.downcase \
+ + '-' \
+ + Version_info::Next.setting_stable[:version]
+ end
+ def self.filename_unstable
+ Project_details.name.downcase \
+ + '-' \
+ + Version_info::Next.setting_unstable[:version]
+ end
+ def self.setting_stable
+ Gemspecs.contents(
+ Version_info::Next.setting_stable,
+ SiSU_version_dir_stable
+ )
+ end
+ def self.setting_unstable
+ Gemspecs.contents(
+ Version_info::Next.setting_unstable,
+ SiSU_version_dir_unstable
+ )
+ end
+ def self.create_stable
+ Gemspecs.create(filename_stable,setting_stable)
+ end
+ def self.create_unstable
+ Gemspecs.create(filename_unstable,setting_unstable)
+ end
+ def self.build_stable
+ Gemspecs.build(filename_stable)
+ end
+ def self.build_unstable
+ Gemspecs.build(filename_unstable)
+ end
+ def self.install_stable
+ Gemspecs.install(filename_stable)
+ end
+ def self.install_unstable
+ Gemspecs.install(filename_unstable)
+ end
+ end
+end
+
diff --git a/setup/sisu_version.rb b/setup/sisu_version.rb
new file mode 100644
index 00000000..1cb8adb9
--- /dev/null
+++ b/setup/sisu_version.rb
@@ -0,0 +1,13 @@
+#% constants
+module SiSUversion
+ SiSU_version_next_stable = '5.6.3' #% set version stable current
+ SiSU_version_next_unstable = '6.2.4' #% set version unstable dev
+ #% qi quick install file
+ SiSU_version_generic_next_stable = '5.4.x'
+ SiSU_version_generic_next_unstable = '6.0.x'
+ SiSU_version_dir_stable = 'v5'
+ SiSU_version_dir_unstable = 'v6'
+end
+module Dev
+ GPGpubKey = '1BB4B289'
+end
diff --git a/version b/version
new file mode 120000
index 00000000..8502093a
--- /dev/null
+++ b/version
@@ -0,0 +1 @@
+setup/sisu_version.rb \ No newline at end of file