Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
slapos
Commits
a0000542
Commit
a0000542
authored
Dec 05, 2012
by
Viktor Horvath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makefile separation: instantiation
parent
37670e11
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
25 deletions
+41
-25
slapos/recipe/mioga/instantiate.py
slapos/recipe/mioga/instantiate.py
+19
-12
software/mioga/instance-apacheperl.cfg
software/mioga/instance-apacheperl.cfg
+5
-1
software/mioga/mioga-patch
software/mioga/mioga-patch
+14
-11
software/mioga/software.cfg
software/mioga/software.cfg
+3
-1
No files found.
slapos/recipe/mioga/instantiate.py
View file @
a0000542
...
@@ -53,15 +53,27 @@ class Recipe(GenericBaseRecipe):
...
@@ -53,15 +53,27 @@ class Recipe(GenericBaseRecipe):
def
update
(
self
):
def
update
(
self
):
self
.
instantiate
(
False
)
self
.
instantiate
(
False
)
def
rsync_dir
(
self
,
src
,
target
):
if
os
.
path
.
isdir
(
src
)
and
not
src
.
endswith
(
'/'
):
src
+=
'/'
cmd
=
subprocess
.
Popen
(
self
.
options
[
'rsync_bin'
]
+
'/rsync -a --specials '
+
src
+
' '
+
target
,
env
=
os
.
environ
,
shell
=
True
)
cmd
.
communicate
()
def
instantiate
(
self
,
isNewInstall
):
def
instantiate
(
self
,
isNewInstall
):
# Copy the build/ and var/lib/Mioga2 folders into the instance
# Copy the build/ and var/lib/Mioga2 folders into the instance
mioga_location
=
self
.
options
[
'mioga_location'
]
mioga_location
=
self
.
options
[
'mioga_location'
]
var_dir
=
self
.
options
[
'var_directory'
]
var_dir
=
self
.
options
[
'var_directory'
]
if
not
os
.
path
.
exists
(
var_dir
):
self
.
rsync_dir
(
os
.
path
.
join
(
mioga_location
,
'var'
),
var_dir
)
shutil
.
copytree
(
os
.
path
.
join
(
mioga_location
,
'var'
),
var_dir
,
True
)
buildinst_dir
=
self
.
options
[
'buildinst_directory'
]
self
.
rsync_dir
(
self
.
options
[
'mioga_buildinst'
],
buildinst_dir
)
former_directory
=
os
.
getcwd
()
former_directory
=
os
.
getcwd
()
os
.
chdir
(
self
.
options
[
'mioga_buildinst'
]
)
os
.
chdir
(
buildinst_dir
)
vardir
=
self
.
options
[
'var_directory'
]
vardir
=
self
.
options
[
'var_directory'
]
mioga_base
=
os
.
path
.
join
(
vardir
,
'lib'
,
'Mioga2'
)
mioga_base
=
os
.
path
.
join
(
vardir
,
'lib'
,
'Mioga2'
)
...
@@ -87,11 +99,8 @@ class Recipe(GenericBaseRecipe):
...
@@ -87,11 +99,8 @@ class Recipe(GenericBaseRecipe):
fm
.
save
()
fm
.
save
()
# Ensure no old data is kept
# Ensure no old data is kept
self
.
removeIfExisting
(
'config.mk'
)
self
.
removeIfExisting
(
'config.mk'
)
if
os
.
path
.
isdir
(
'web/conf/apache'
):
# if os.path.isdir('web/conf/apache'):
shutil
.
rmtree
(
'web/conf/apache'
)
# shutil.rmtree('web/conf/apache')
for
key
in
self
.
options
.
keys
():
print
"Found option: "
+
key
environ
=
os
.
environ
environ
=
os
.
environ
environ
[
'PATH'
]
=
':'
.
join
([
self
.
options
[
'perl_bin'
],
# priority!
environ
[
'PATH'
]
=
':'
.
join
([
self
.
options
[
'perl_bin'
],
# priority!
...
@@ -100,6 +109,7 @@ class Recipe(GenericBaseRecipe):
...
@@ -100,6 +109,7 @@ class Recipe(GenericBaseRecipe):
self
.
options
[
'libxslt_bin'
],
self
.
options
[
'libxslt_bin'
],
self
.
options
[
'libxml2_bin'
],
self
.
options
[
'libxml2_bin'
],
self
.
options
[
'postgres_bin'
],
self
.
options
[
'postgres_bin'
],
self
.
options
[
'rsync_bin'
],
environ
[
'PATH'
]
])
environ
[
'PATH'
]
])
environ
[
'MIOGA_SITEPERL'
]
=
self
.
options
[
'mioga_siteperl'
]
environ
[
'MIOGA_SITEPERL'
]
=
self
.
options
[
'mioga_siteperl'
]
...
@@ -115,9 +125,6 @@ class Recipe(GenericBaseRecipe):
...
@@ -115,9 +125,6 @@ class Recipe(GenericBaseRecipe):
os.chmod(pgpassfilepath, stat.S_IRUSR | stat.S_IWUSR)
os.chmod(pgpassfilepath, stat.S_IRUSR | stat.S_IWUSR)
environ['
PGPASSFILE
'] = pgpassfilepath
environ['
PGPASSFILE
'] = pgpassfilepath
# environ = self.options['
mioga_compile_env
']
print pprint.pformat(environ)
# We must call "make" in the SAME environment that
# We must call "make" in the SAME environment that
# "perl Makefile.PL" left!
# "perl Makefile.PL" left!
...
...
software/mioga/instance-apacheperl.cfg
View file @
a0000542
...
@@ -16,6 +16,8 @@ bin = $${buildout:directory}/bin
...
@@ -16,6 +16,8 @@ bin = $${buildout:directory}/bin
etc = $${buildout:directory}/etc
etc = $${buildout:directory}/etc
srv = $${buildout:directory}/srv
srv = $${buildout:directory}/srv
log = $${buildout:directory}/log
log = $${buildout:directory}/log
var = $${buildout:directory}/var
buildinst = $${buildout:directory}/buildinst
[basedirectory]
[basedirectory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
...
@@ -86,7 +88,9 @@ mioga_location = ${mioga:location}
...
@@ -86,7 +88,9 @@ mioga_location = ${mioga:location}
mioga_buildinst = ${mioga:buildinst}
mioga_buildinst = ${mioga:buildinst}
libxslt_bin = ${libxslt:location}/bin
libxslt_bin = ${libxslt:location}/bin
libxml2_bin = ${libxml2:location}/bin
libxml2_bin = ${libxml2:location}/bin
var_directory = $${buildout:directory}/var
rsync_bin = ${rsync:location}/bin
var_directory = $${rootdirectory:var}
buildinst_directory = $${rootdirectory:buildinst}
instance_root = $${buildout:directory}
instance_root = $${buildout:directory}
perl_bin = ${perl:location}/bin
perl_bin = ${perl:location}/bin
postgres_bin = ${postgresql:location}/bin
postgres_bin = ${postgresql:location}/bin
...
...
software/mioga/mioga-patch
View file @
a0000542
...
@@ -12,7 +12,7 @@ index ef0f369..b275a48 100644
...
@@ -12,7 +12,7 @@ index ef0f369..b275a48 100644
This script must be run by cron in a day basis with apache user (www-data for Debian)
This script must be run by cron in a day basis with apache user (www-data for Debian)
diff --git a/Makefile.PL b/Makefile.PL
diff --git a/Makefile.PL b/Makefile.PL
index 3582d20..
46608ca
100644
index 3582d20..
80ea444
100644
--- a/Makefile.PL
--- a/Makefile.PL
+++ b/Makefile.PL
+++ b/Makefile.PL
@@ -20,8 +20,10 @@
@@ -20,8 +20,10 @@
...
@@ -87,7 +87,7 @@ index 3582d20..46608ca 100644
...
@@ -87,7 +87,7 @@ index 3582d20..46608ca 100644
+ "$(MIOGA_BUILDINST)"
+ "$(MIOGA_BUILDINST)"
+
+
+slapos-instantiation ::
+slapos-instantiation ::
+ for i in web/conf conf sql ; \
+ for i in web/conf conf
web/skel
sql ; \
+ do \
+ do \
+ (cd $$i && $(MAKE) install) || exit 1;\
+ (cd $$i && $(MAKE) install) || exit 1;\
+ done
+ done
...
@@ -97,27 +97,19 @@ index 3582d20..46608ca 100644
...
@@ -97,27 +97,19 @@ index 3582d20..46608ca 100644
doc:
doc:
for i in ' . $docsubdirs . ' ; \
for i in ' . $docsubdirs . ' ; \
do \
do \
@@ -176,9 +202,
26
@@
installall: install install-all
@@ -176,9 +202,
18
@@
installall: install install-all
#
#
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
+my $Mioga2_pm = 'lib/Mioga2.pm';
+my $Mioga2_pm = 'lib/Mioga2.pm';
+foreach my $envkey (keys %ENV) {
+ print "VHH DEBUG: found envvar $envkey\n";
+}
+if ((not -e $Mioga2_pm) and exists($ENV{MIOGA_SITEPERL})) {
+if ((not -e $Mioga2_pm) and exists($ENV{MIOGA_SITEPERL})) {
+ print "VHH DEBUG: looking into SITEPERL\n";
+ my $findfile = sub {
+ my $findfile = sub {
+ if ($_ eq 'Mioga2.pm') {
+ if ($_ eq 'Mioga2.pm') {
+ $Mioga2_pm = $File::Find::name;
+ $Mioga2_pm = $File::Find::name;
+ print "VHH DEBUG: Found Mioga2.pm in $Mioga2_pm\n";
+ }
+ }
+ };
+ };
+ find($findfile, $ENV{MIOGA_SITEPERL});
+ find($findfile, $ENV{MIOGA_SITEPERL});
+};
+};
+print "VHH DEBUG: Found finally: $Mioga2_pm\n";
+print 'VHH DEBUG: SIZE = ' . ( stat($Mioga2_pm) )[8] . "\n";
+print "VHH DEBUG: Current directory is ".getcwd."\n";
WriteMakefile(
WriteMakefile(
'NAME' => 'Mioga',
'NAME' => 'Mioga',
'DIR' => ['bin', 'web', 'locales', 'docs', 'sql'],
'DIR' => ['bin', 'web', 'locales', 'docs', 'sql'],
...
@@ -649,6 +641,17 @@ index 66af45f..9649a02 100644
...
@@ -649,6 +641,17 @@ index 66af45f..9649a02 100644
mkdir -p $(TMP_DIR)
mkdir -p $(TMP_DIR)
mkdir -p $(DESTDIR)$(INSTALL_DIR)/$(INSTANCE_IDENT)/$(MIOGA_FILES)
mkdir -p $(DESTDIR)$(INSTALL_DIR)/$(INSTANCE_IDENT)/$(MIOGA_FILES)
diff --git a/web/conf/Makefile b/web/conf/Makefile
index 1573e5c..189f2fd 100644
--- a/web/conf/Makefile
+++ b/web/conf/Makefile
@@ -14,5 +14,6 @@
install:
# is done in ../Makefile
clean:
+ echo "VHH DEBUG: web/conf make clean, deleting apache/ !"
rm -Rf apache Mioga.conf .memdump
diff --git a/web/conf/startup.pl b/web/conf/startup.pl
diff --git a/web/conf/startup.pl b/web/conf/startup.pl
index a9dc968..6558061 100644
index a9dc968..6558061 100644
--- a/web/conf/startup.pl
--- a/web/conf/startup.pl
...
...
software/mioga/software.cfg
View file @
a0000542
...
@@ -4,6 +4,7 @@ develop =
...
@@ -4,6 +4,7 @@ develop =
/opt/slapdev_build
/opt/slapdev_build
extends =
extends =
../../component/rsync/buildout.cfg
../../component/apache-perl/buildout.cfg
../../component/apache-perl/buildout.cfg
../../component/perl-Crypt-SSLeay/buildout.cfg
../../component/perl-Crypt-SSLeay/buildout.cfg
../../component/perl-XML-Parser/buildout.cfg
../../component/perl-XML-Parser/buildout.cfg
...
@@ -35,6 +36,7 @@ parts =
...
@@ -35,6 +36,7 @@ parts =
perl-String-Checker-mioga
perl-String-Checker-mioga
perl-Search-Xapian
perl-Search-Xapian
cpan-simple-modules
cpan-simple-modules
rsync
mioga
mioga
template
template
template-apacheperl
template-apacheperl
...
@@ -103,7 +105,7 @@ environment =
...
@@ -103,7 +105,7 @@ environment =
MIOGA_BUILDINST=${mioga:buildinst}
MIOGA_BUILDINST=${mioga:buildinst}
MIOGA_STATIC=${mioga:static}
MIOGA_STATIC=${mioga:static}
MIOGA_SITEPERL=${perl:siteprefix}
MIOGA_SITEPERL=${perl:siteprefix}
PATH=${libxslt:location}/bin:${libxml2:location}/bin:${perl:location}/bin:${perl:siteprefix}/bin:%(PATH)s
PATH=${libxslt:location}/bin:${libxml2:location}/bin:${perl:location}/bin:${perl:siteprefix}/bin:
${rsync:location}/bin:
%(PATH)s
patch-options = -p1
patch-options = -p1
patches =
patches =
${mioga-patch:location}/${mioga-patch:filename}
${mioga-patch:location}/${mioga-patch:filename}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment