Merge lp:~emaadmanzoor/mvhub/mvhub-bzrbuilddeb-experiment into lp:mvhub

Proposed by Emaad Ahmed Manzoor
Status: Needs review
Proposed branch: lp:~emaadmanzoor/mvhub/mvhub-bzrbuilddeb-experiment
Merge into: lp:mvhub
Prerequisite: lp:~emaadmanzoor/mvhub/move-out-update-cpan-libs
Diff against target: 524 lines (+365/-9)
19 files modified
.bzr-builddeb/default.conf (+3/-0)
app-mvhub/project-tools/bin/mv_add_doc_header (+3/-0)
app-mvhub/project-tools/bin/mv_buildpkg (+80/-0)
app-mvhub/project-tools/templates/template.conf (+3/-0)
app-mvhub/t/header_doc_existence.t (+2/-1)
debian/changelog (+5/-0)
debian/compat (+1/-0)
debian/control (+22/-0)
debian/copyright (+72/-0)
debian/libmvhub-tests.lintian-overrides (+1/-0)
debian/mvhub-dev-env.install (+3/-0)
debian/mvhub-dev-env.links (+1/-0)
debian/mvhub-dev-env.lintian-overrides (+1/-0)
debian/mvhub-dev-env.postinst (+106/-0)
debian/mvhub-dev-env.postrm (+41/-0)
debian/rules (+13/-0)
lib-mvhub/README (+6/-7)
lib-mvhub/lib/MVHub/Utils/Setup/CPANLibs.pm (+1/-1)
lib-mvhub/t/conf/all.conf (+1/-0)
To merge this branch: bzr merge lp:~emaadmanzoor/mvhub/mvhub-bzrbuilddeb-experiment
Reviewer Review Type Date Requested Status
Dan MacNeil Needs Fixing
Review via email: mp+71519@code.launchpad.net

This proposal supersedes a proposal from 2011-07-12.

Description of the change

New changes:

* Single package now, to stay focussed on goals of the dev-env package.

* No separate CPAN package:
    - libmvhub-cpan installed modules to /usr/share/perl5 that were never used after installation.
    - CPANPLUS::Backend causes issues when run as root behind a proxy.
    - Its purpose is achieved by a single command: perl -MMVHub::Utils::Setup::CPANLibs -e 'MVHub::Utils::Setup::CPANLibs::update_cpan_libs();'

* Completed post-installation and post-removal scripts.

Old Changes:

* Added the debian folder
* Updated the wiki with how-to-build instructions
* Added conf files for bzr-builddeb
* Added the package building script: mv_build_env
* Updated template.conf to add the built_packages dir
* mv_build_env renamed to mv_build_devpkg
* mv_build_devpkg now has options: --quiet, --signed, --help; using Getopt::Long
* Added package build configuration for libmvhub-perl and libmvhubtests-perl
* Removed trailing /'s from symlinks that were preventing successful package builds
* Added the ${cpan:Depends} substitution variable to debian/control, taken from debian/substvars
* Overrode dh_gencontrol in debian/rules to use our new substvars
* Separate package to fetch cpan libs
* Overrode lintian warning about itp bug
* Pushed down version dependency on bzr-builddeb
* --builder=debuild option specified to bzr-builddeb in mv_buildpkg

To post a comment you must log in.
Revision history for this message
Dan MacNeil (omacneil) wrote : Posted in a previous version of this proposal

The existing criteria for accepting a merge request to trunk is:

  1) code becomes better in some way
  2) code is worse in no ways

I'm not sure if (new?) criteria should be #3 or #1a "actually does something useful" and "without too much work"

If I knew how to build a package, would these additions let me build a package ?

review: Needs Information
Revision history for this message
Dan MacNeil (omacneil) wrote : Posted in a previous version of this proposal

10 +result-dir = /var/www/mvhub/$USER/built_packages

There are other places in the code where the /var/www/mvhub/$USER nastiness exists

I'm not sure that makes it right. In the best case, we're a little hosed if $SERVER_BASE_DIR changes from /var/www/mvhub.

In the worst case this isn't going to work at all because .bzr-builddeb doesn't understand what an environment variable is and there is no literal path that contains '$USER'

From:

zless /usr/share/doc/bzr-builddeb/README.gz

> The following options are read from the configuration files. Most
> can also be used as command line arguments by prepending ``--`` to
> the names and not using the ``\=`` symbol. There are a few exceptions
> to this that are noted in the descriptions.

so creating (in perl) mv_build which calls the routines in MVHub::Wrap::ConfigSimple to get the paths see:

           perldoc MVHub::Wrap::ConfigSimple

...might be a better tactic

Revision history for this message
Dan MacNeil (omacneil) wrote : Posted in a previous version of this proposal

you will also need to modify:

    app-mvhub/project-tools/templates/template.conf

to include the built_packages dir so that:

 mv_update_development creates the directory.

Revision history for this message
Emaad Ahmed Manzoor (emaadmanzoor) wrote : Posted in a previous version of this proposal

> If I knew how to build a package, would these additions let me build a
> package ?
>

I forgot to add the link to the entry in the description of changes:

    * Updated the wiki with how-to-build instructions:
http://wiki.thecsl.org/mediawiki/index.php/Dev_Env_Package#To_Build_The_Package

Yes, these additions would let you build the package.

--
Emaad Ahmed Manzoor

Revision history for this message
Emaad Ahmed Manzoor (emaadmanzoor) wrote : Posted in a previous version of this proposal

I don't know how, but I missed your previous mails about using
MVHub::Wrap::ConfigSimple. The builddeb.conf file actually works with
environment variables (/var/www/mvhub/$USER/* works), but you're right about
being adaptable to changes in the future. Working on the mv_build_env script
now.

On Sat, Jul 9, 2011 at 11:04 AM, Dan MacNeil <email address hidden> wrote:

>
> 10 +result-dir = /var/www/mvhub/$USER/built_packages
>
> There are other places in the code where the /var/www/mvhub/$USER nastiness
> exists
>
> I'm not sure that makes it right. In the best case, we're a little hosed if
> $SERVER_BASE_DIR changes from /var/www/mvhub.
>
> In the worst case this isn't going to work at all because .bzr-builddeb
> doesn't understand what an environment variable is and there is no literal
> path that contains '$USER'
>
> From:
>
> zless /usr/share/doc/bzr-builddeb/README.gz
>
> > The following options are read from the configuration files. Most
> > can also be used as command line arguments by prepending ``--`` to
> > the names and not using the ``\=`` symbol. There are a few exceptions
> > to this that are noted in the descriptions.
>
> so creating (in perl) mv_build which calls the routines in
> MVHub::Wrap::ConfigSimple to get the paths see:
>
> perldoc MVHub::Wrap::ConfigSimple
>
> ...might be a better tactic
>
> --
>
> https://code.launchpad.net/~emaadmanzoor/mvhub/mvhub-bzrbuilddeb-experiment/+merge/66864<https://code.launchpad.net/%7Eemaadmanzoor/mvhub/mvhub-bzrbuilddeb-experiment/+merge/66864>
> You are the owner of lp:~emaadmanzoor/mvhub/mvhub-bzrbuilddeb-experiment.
>

--
Emaad Ahmed Manzoor

Revision history for this message
Dan MacNeil (omacneil) wrote : Posted in a previous version of this proposal

OPTIONAL nits (fix to suckup , but not required for merge approval)
 rename mv_build_env to mv_build

 hid status noise. / add a verbose flag
    --s there a --quiet flag

REQUIRED (or prove I'm wrong)
   chmod +x app-mvhub/project-tools/bin/mv_build_env

   run with no lintian errors

   change so build fails on lintian errors

  run if Emaad private key not available (but warn)

  run without prompting user re tar.orig

  add bzr-builddeb to build-depends

Revision history for this message
Emaad Ahmed Manzoor (emaadmanzoor) wrote : Posted in a previous version of this proposal

> OPTIONAL nits (fix to suckup , but not required for merge approval)
> rename mv_build_env to mv_build
>
>
You want this script to eventually build all the packages? I thought this
was only for the mvhub-dev-env package, because the mvhub/mvhub-cpan
packages might require something else. Even if they're the same, the mvhub
package will take a lot more time than the other 2, so someone testing out
the mvhub-dev-env package will have to wait unnecessarily until the mvhub
package builds too.

--
Emaad Ahmed Manzoor

Revision history for this message
Dan MacNeil (omacneil) wrote : Posted in a previous version of this proposal

app-mvhub/project-tools/bin/mv_build_env

should use

Getopt::Long;

See:

app-mvhub/bin/dump.pl
app-mvhub/bin/notification_email.pl
app-mvhub/project-tools/bin/mv_update_production
app-mvhub/project-tools/bin/mv_update_development
app-mvhub/project-tools/bin/mv_update_staging

620. By Emaad Ahmed Manzoor

added env var to use default values for all cpan prompts

621. By Emaad Ahmed Manzoor

merged from trunk

Revision history for this message
Dan MacNeil (omacneil) wrote :

/var/www/mvhub/$USER/source-code/build-area

should be:

/var/www/mvhub/$USER/build-area

review: Needs Fixing
622. By Emaad Ahmed Manzoor

hard coded default builder as debuild, pushed down build-depends version of bzr-builddeb

623. By Emaad Ahmed Manzoor

hard coded quick builder

624. By Emaad Ahmed Manzoor

wrapped builder command in quotes

625. By Emaad Ahmed Manzoor

using autodie

626. By Emaad Ahmed Manzoor

removed check on $result

627. By Emaad Ahmed Manzoor

merged from trunk

628. By Emaad Ahmed Manzoor

perltidy fix, quiet output fix

Revision history for this message
Emaad Ahmed Manzoor (emaadmanzoor) wrote :

* mv_buildpkg looks like it's working fine for --quiet and --help, needs a signing program for --signed.

* Testing the rest of this branch will involve the following:
- Setup a pbuilder environment
- Install libmvhub-perl and check test for the existence mvhub modules on the system
- Install libmvhub-tests-perl and test (?)
- Install libmvhub-cpan and test if required modules are being fetched
  - TODO: Use debconf to prompt for running tests on the CPAN modules

629. By Emaad Ahmed Manzoor

updated pourpose of script

630. By Emaad Ahmed Manzoor

added dependency on default mail transport agent

Revision history for this message
Dan MacNeil (omacneil) wrote :

apache2-mpm-itk is used in development, but not production as itk provides smooth way to do suexec stuff (run cgi process as particular user) but at 30% performance hit.

stated project goal is to get developer setup working in 10 minutes but I expect also to use this in migration from development-->staging-->production

perhaps should be:

   apache2-mpm-itk|apache2-mpm

Revision history for this message
Dan MacNeil (omacneil) wrote :

issues with:
   Line: 148

apparent duplicate:
  libdbd-pg-perl, libdbd-pg-perl,

 no longer needed:

  libdbd-sqlite,libfile-readbackwards-perl, libconfig-inifiles-perl

belong in testing package:

libdbd-mock-perl, libdbd-sqlite, libdbd-sqlite3-perl, libdevel-cover-perl, libhtml-lint-perl,
libtest-base-perl, libtest-class-perl, libtest-differences-perl, libtest-exception-perl, libtest-html-content-perl, libtest-mockmodule-perl, libtest-mockobject-perl, libtest-nowarnings-perl, libtest-warn-perl, perltidy, postgresql, tidy,

631. By Emaad Ahmed Manzoor

merged from trunk

632. By Emaad Ahmed Manzoor

merged Dans package descriptions

633. By Emaad Ahmed Manzoor

merged from trunk

634. By Emaad Ahmed Manzoor

removed packages unnecessary for mvhub-dev-env

635. By Emaad Ahmed Manzoor

added mv_aliases

636. By Emaad Ahmed Manzoor

perltidy

637. By Emaad Ahmed Manzoor

postrm script to remove mv_aliases

638. By Emaad Ahmed Manzoor

perltidy

639. By Emaad Ahmed Manzoor

merged from trunk

Revision history for this message
Emaad Ahmed Manzoor (emaadmanzoor) wrote :

> no longer needed:
>
> libdbd-sqlite,libfile-readbackwards-perl, libconfig-inifiles-perl

So these will need to be removed from debian_installed_packages.t too?

Revision history for this message
Dan MacNeil (omacneil) wrote :

On 02/28/2012 04:33 PM, Emaad Ahmed Manzoor wrote:
>> > libdbd-sqlite,libfile-readbackwards-perl, libconfig-inifiles-perl
> So these will need to be removed from debian_installed_packages.t too?

Almost certainly yes.

btw, I've added:

    texlive-fonts-recommended

to:

 app-mvhub/t/debian_installed packages.t

--
<email address hidden> ---> personal, private home / side job address.
<email address hidden> ---> Community Software not private.
cell: 978-455-1885

640. By Emaad Manzoor <email address hidden>

Creates user directory structure, pulls dependencies, Apache config

641. By Emaad Manzoor <email address hidden>

/etc/hosts config, Apache hosts config

642. By Emaad Manzoor <email address hidden>

apache admin auth

643. By Emaad Manzoor <email address hidden>

Move common tasks into a method

644. By Emaad Manzoor <email address hidden>

merged from trunk

645. By Emaad Manzoor <email address hidden>

merged my old revisions

646. By Emaad Ahmed Manzoor

Finished postrm script

647. By Emaad Manzoor <email address hidden>

libmvhub-cpan now handles all CPANPLUS stuff

648. By Emaad Manzoor <email address hidden>

Removed libmvhub-cpan

649. By Emaad Manzoor <email address hidden>

mvhub-dev-env postrm removes mvhub.data site

650. By Emaad Manzoor <email address hidden>

create file if it doesn't exist

651. By Emaad Manzoor <email address hidden>

create log dirs, or apache fails to restart

652. By Emaad Ahmed Manzoor

merged from trunk

653. By Emaad Manzoor <email address hidden>

Restored old install instructions

654. By Emaad Ahmed Manzoor

perltidy fixes to make tests pass

655. By Emaad Manzoor <email address hidden>

fixed lintian errors

656. By rachee <email address hidden>

Patch to get username on Ubuntu; remove extra newline from text appended by package

657. By rachee <email address hidden>

Fixed bug removing one extra character from the file appended to

Unmerged revisions

657. By rachee <email address hidden>

Fixed bug removing one extra character from the file appended to

656. By rachee <email address hidden>

Patch to get username on Ubuntu; remove extra newline from text appended by package

655. By Emaad Manzoor <email address hidden>

fixed lintian errors

654. By Emaad Ahmed Manzoor

perltidy fixes to make tests pass

653. By Emaad Manzoor <email address hidden>

Restored old install instructions

652. By Emaad Ahmed Manzoor

merged from trunk

651. By Emaad Manzoor <email address hidden>

create log dirs, or apache fails to restart

650. By Emaad Manzoor <email address hidden>

create file if it doesn't exist

649. By Emaad Manzoor <email address hidden>

mvhub-dev-env postrm removes mvhub.data site

648. By Emaad Manzoor <email address hidden>

Removed libmvhub-cpan

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory '.bzr-builddeb'
2=== added file '.bzr-builddeb/default.conf'
3--- .bzr-builddeb/default.conf 1970-01-01 00:00:00 +0000
4+++ .bzr-builddeb/default.conf 2012-07-17 19:36:21 +0000
5@@ -0,0 +1,3 @@
6+[BUILDDEB]
7+split = True
8+quick-builder = debuild -us -uc
9
10=== modified symlink 'app-mvhub/conf/templates/html/all'
11=== target changed u'../../../DocumentRoot/static/all/' => u'../../../DocumentRoot/static/all'
12=== modified symlink 'app-mvhub/conf/templates/html/inc'
13=== target changed u'../../../DocumentRoot/static/all/inc/' => u'../../../DocumentRoot/static/all/inc'
14=== modified symlink 'app-mvhub/conf/templates/html/mvh'
15=== target changed u'../../../DocumentRoot/static/mvh/' => u'../../../DocumentRoot/static/mvh'
16=== modified symlink 'app-mvhub/conf/templates/html/nsp'
17=== target changed u'../../../DocumentRoot/static/nsp/' => u'../../../DocumentRoot/static/nsp'
18=== modified file 'app-mvhub/project-tools/bin/mv_add_doc_header'
19--- app-mvhub/project-tools/bin/mv_add_doc_header 2011-12-02 15:08:42 +0000
20+++ app-mvhub/project-tools/bin/mv_add_doc_header 2012-07-17 19:36:21 +0000
21@@ -190,6 +190,9 @@
22 {
23 return "REGULAR";
24 }
25+ elsif ( $filename =~ /\.?(postinst|postrm|preinst|prerm)$/ ) {
26+ return "REGULAR";
27+ }
28 else {
29 return "UNDEF";
30 }
31
32=== added file 'app-mvhub/project-tools/bin/mv_buildpkg'
33--- app-mvhub/project-tools/bin/mv_buildpkg 1970-01-01 00:00:00 +0000
34+++ app-mvhub/project-tools/bin/mv_buildpkg 2012-07-17 19:36:21 +0000
35@@ -0,0 +1,80 @@
36+#!/usr/bin/perl
37+
38+# LICENSE: GNU Affero General Public License v3
39+# COPYRIGHT: Community Software Lab
40+# CONTACT: help@thecsl.org
41+# PROJECT: https://launchpad.net/mvhub/
42+
43+# PURPOSE: Build mvhub's Debian packages
44+
45+use strict;
46+use warnings "all";
47+
48+use MVHub::Wrap::ConfigSimple;
49+use Getopt::Long;
50+use File::Basename;
51+
52+use autodie qw(:all);
53+
54+my $cfg = MVHub::Wrap::ConfigSimple->new( $ENV{MV_CONFIG_FILE}, $ENV{USER} );
55+my $build_dir = $cfg->param('ABSOLUTE_PATH.tmp_dir');
56+my $result_dir = $cfg->param('ABSOLUTE_PATH.result_dir');
57+
58+my $builder = "debuild";
59+my $quick_builder = "debuild -us -uc";
60+
61+my $signed = 0;
62+my $quiet = 0;
63+my $usage = 0;
64+
65+Getopt::Long::GetOptions(
66+ 'signed' => \$signed,
67+ 'quiet' => \$quiet,
68+ 'help' => \$usage
69+) or die "GetOptions failed\n";
70+
71+if ($usage) {
72+ print usage();
73+ exit 0;
74+}
75+
76+if ($signed) {
77+ if ($quiet) {
78+ system(
79+ "bzr bd --builder=\"$builder\" --build-dir=$build_dir --result-dir=$result_dir > /dev/null 2>&1"
80+ );
81+ }
82+ else {
83+ system(
84+ "bzr bd --builder=\"$builder\" --build-dir=$build_dir --result-dir=$result_dir"
85+ );
86+ }
87+}
88+else {
89+ if ($quiet) {
90+ system(
91+ "bzr bd --builder=\"$quick_builder\" --build-dir=$build_dir --result-dir=$result_dir > /dev/null 2>&1"
92+ );
93+ }
94+ else {
95+ system(
96+ "bzr bd --builder=\"$quick_builder\" --build-dir=$build_dir --result-dir=$result_dir"
97+ );
98+ }
99+}
100+
101+print "Package built successfully\n";
102+
103+sub usage {
104+ my $this_script = File::Basename::basename($0);
105+ return << "USAGE";
106+$this_script - Script to build the mvhub Debian packages
107+
108+Options:
109+ --quiet Suppresses all output
110+ --signed Signs the package changes after building (requires your secret key)
111+ --help Gets this screen
112+
113+USAGE
114+
115+}
116
117=== modified file 'app-mvhub/project-tools/templates/template.conf'
118--- app-mvhub/project-tools/templates/template.conf 2011-12-02 15:08:42 +0000
119+++ app-mvhub/project-tools/templates/template.conf 2012-07-17 19:36:21 +0000
120@@ -137,6 +137,9 @@
121 user_conf_dir=conf/
122 log_dir=BAD_FIX_IN_CONF_FILE
123
124+# Directory for built packages
125+result_dir=built_packages/
126+
127 [COOKIES]
128 # name of cookie used to store
129 # session id for authentification / authorization
130
131=== modified symlink 'app-mvhub/t/conf'
132=== target changed u'../../lib-mvhub/t/conf/' => u'../../lib-mvhub/t/conf'
133=== modified file 'app-mvhub/t/header_doc_existence.t'
134--- app-mvhub/t/header_doc_existence.t 2012-03-20 02:44:08 +0000
135+++ app-mvhub/t/header_doc_existence.t 2012-07-17 19:36:21 +0000
136@@ -29,9 +29,10 @@
137 (\.(save|bak|tmp|pdf) )$ # any file ending with these
138 | (reminder.*tmpl)$ # email reminders can't have comments all text is sent
139 | (\.bzr.+)$ # internal version control directories
140+ | (changelog|compat|control|copyright|install|links|lintian-overrides|substvars|rules|substvars)$ # Debian package files
141 /x;
142 Readonly::Scalar my $KNOWN_FILE_TYPES =>
143- qr/^((.*\/mv_[\w_\d]+)|(.*\.?(lib|sql|html|shtml|inc|tmpl|css|js|pl|pm|conf|txt|sh|t|pod|list|rc|CONTRIBUTORS|README|LICENSE|config|mvhub-cron|rm_session_files|run_external_reports)))$/;
144+ qr/^((.*\/mv_[\w_\d]+)|(.*\.?(lib|sql|html|shtml|inc|tmpl|css|js|pl|pm|conf|txt|sh|t|pod|list|rc|CONTRIBUTORS|README|LICENSE|config|mvhub-cron|rm_session_files|run_external_reports|postinst|postrm|preinst|prerm)))$/;
145
146 my @files = get_files(qq{'*'});
147 my @known_failed_files = ();
148
149=== modified symlink 'app-mvhub/t/lib'
150=== target changed u'../../lib-mvhub/t/lib/' => u'../../lib-mvhub/t/lib'
151=== added directory 'debian'
152=== added file 'debian/changelog'
153--- debian/changelog 1970-01-01 00:00:00 +0000
154+++ debian/changelog 2012-07-17 19:36:21 +0000
155@@ -0,0 +1,5 @@
156+mvhub (0.25-1) UNRELEASED; urgency=medium
157+
158+ * Initial release (Closes: LP: #538086)
159+
160+ -- Emaad Ahmed Manzoor <emaadmanzoor@gmail.com> Mon, 20 Jun 2011 09:09:33 +0530
161
162=== added file 'debian/compat'
163--- debian/compat 1970-01-01 00:00:00 +0000
164+++ debian/compat 2012-07-17 19:36:21 +0000
165@@ -0,0 +1,1 @@
166+7
167
168=== added file 'debian/control'
169--- debian/control 1970-01-01 00:00:00 +0000
170+++ debian/control 2012-07-17 19:36:21 +0000
171@@ -0,0 +1,22 @@
172+Source: mvhub
173+Section: web
174+Priority: optional
175+Maintainer: Emaad Ahmed Manzoor <emaadmanzoor@gmail.com>
176+Build-Depends: debhelper (>= 7.0.50~), bzr-builddeb (>= 2.4)
177+Standards-Version: 3.9.1
178+Homepage: https://launchpad.net/mvhub
179+
180+Package: mvhub-dev-env
181+Section: perl
182+Architecture: all
183+Depends: ${misc:Depends}, analog, apache2-mpm-itk|apache2-mpm, bzr, graphviz, jdresolve, libapache2-mod-macro, libautodie-perl, libcgi-application-perl, libcgi-application-plugins-perl, libcgi-session-perl, libconfig-simple-perl, libdate-calc-perl, libdatetime-perl, libdbd-mock-perl, libdbd-pg-perl, libdbd-sqlite3-perl, libdbi-perl, libdevel-cover-perl, libhtml-strip-perl, libhtml-template-perl, libio-all-perl, libio-prompt-perl, libipc-system-simple-perl, liblingua-stem-perl, libmime-tools-perl, libparams-validate-perl, libtemplate-perl, libtext-template-perl, liburi-perl, postfix | mail-transport-agent, postgresql, texlive-latex-base, texlive-fonts-recommended, visitors, wamerican
184+Description: Package to set up the mvhub developer environment
185+ This package is sets up a machine so it can host MVHub development environments
186+ for individual developers.
187+
188+Package: libmvhub-tests
189+Section: perl
190+Architecture: all
191+Depends: ${misc:Depends}, libhtml-lint-perl, libtest-base-perl, libtest-class-perl, libtest-differences-perl, libtest-exception-perl, libtest-html-content-perl, libtest-mockmodule-perl, libtest-mockobject-perl, libtest-nowarnings-perl, libtest-warn-perl, libtest-trap-perl, tidy, perltidy
192+Description: Packages needed to run tests
193+ Metapackage that pulls in dependencies needed only to run MVHub's tests.
194
195=== added file 'debian/copyright'
196--- debian/copyright 1970-01-01 00:00:00 +0000
197+++ debian/copyright 2012-07-17 19:36:21 +0000
198@@ -0,0 +1,72 @@
199+This work was packaged for Debian by:
200+
201+ MVHub Development group <joe@thecsl.org> on Mon, 13 Jun 2011 08:39:48 +0530
202+
203+It was downloaded from:
204+
205+ https://launchpad.net/mvhub
206+
207+Upstream Author(s):
208+
209+ Bill Cowie
210+ Dan MacNeil
211+ David Siegal
212+ Eric Marc Adum
213+ Evan Fiore
214+ Frank Allaby
215+ Himabindu N. Sanagavarapu
216+ Hsienwen Hsu
217+ James Reynolds
218+ John Miller
219+ Keith Fader
220+ Lee Goodrich
221+ Mansi Dadhania
222+ Kamala Kalluri
223+ Nicholas Lavertue
224+ Eric Marc Adum
225+ Priya Ravindran
226+ Saroun Sek
227+ Sijing Shen
228+ Sri Reddy
229+ Steven Leboeuf
230+ Swetha Chandrashekar
231+ Yashwanth Gidugu
232+ Sam J Antonaccio
233+ Sean Cronin
234+ Trevor Cappallo
235+ Ferhat Elmas
236+ Nathan Gilbert
237+ Emaad Ahmed Manzoor
238+ Rachee Singh
239+ Christopher Smith
240+ Victor Pomponiu
241+ Jeff Bonhag
242+ Roger Wieand
243+
244+Copyright:
245+
246+ Copyright (C) 2011 Community Software Lab, Inc
247+
248+For general inquiries email Joe <joe@thecsl.org>
249+
250+License:
251+
252+ This program is free software: you can redistribute it and/or modify
253+ it under the terms of the GNU Affero General Public License as
254+ published by the Free Software Foundation, either version 3 of the
255+ License, or (at your option) any later version.
256+
257+ This program is distributed in the hope that it will be useful,
258+ but WITHOUT ANY WARRANTY; without even the implied warranty of
259+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
260+ GNU Affero General Public License for more details.
261+
262+ You should have received a copy of the GNU Affero General Public License
263+ along with this program. If not, see <http://www.gnu.org/licenses/>.
264+
265+The Debian packaging is:
266+
267+ Copyright (C) 2011 Community Software Lab, Inc
268+
269+and is also licensed under the GNU Affero General Public License,
270+either version 3 of the License, or (at your option) any later version.
271
272=== added file 'debian/libmvhub-tests.lintian-overrides'
273--- debian/libmvhub-tests.lintian-overrides 1970-01-01 00:00:00 +0000
274+++ debian/libmvhub-tests.lintian-overrides 2012-07-17 19:36:21 +0000
275@@ -0,0 +1,1 @@
276+new-package-should-close-itp-bug
277
278=== added file 'debian/mvhub-dev-env.install'
279--- debian/mvhub-dev-env.install 1970-01-01 00:00:00 +0000
280+++ debian/mvhub-dev-env.install 2012-07-17 19:36:21 +0000
281@@ -0,0 +1,3 @@
282+app-mvhub/project-tools/mv_aliases etc/mvhub-dev-env
283+app-mvhub/project-tools/templates/template.conf etc/mvhub-dev-env
284+app-mvhub/setup/etc/apache2/sites-available/* etc/apache2/sites-available
285
286=== added file 'debian/mvhub-dev-env.links'
287--- debian/mvhub-dev-env.links 1970-01-01 00:00:00 +0000
288+++ debian/mvhub-dev-env.links 2012-07-17 19:36:21 +0000
289@@ -0,0 +1,1 @@
290+etc/apache2/sites-available/mvhub.conf etc/apache2/sites-enabled/mvhub.conf
291
292=== added file 'debian/mvhub-dev-env.lintian-overrides'
293--- debian/mvhub-dev-env.lintian-overrides 1970-01-01 00:00:00 +0000
294+++ debian/mvhub-dev-env.lintian-overrides 2012-07-17 19:36:21 +0000
295@@ -0,0 +1,1 @@
296+new-package-should-close-itp-bug
297
298=== added file 'debian/mvhub-dev-env.postinst'
299--- debian/mvhub-dev-env.postinst 1970-01-01 00:00:00 +0000
300+++ debian/mvhub-dev-env.postinst 2012-07-17 19:36:21 +0000
301@@ -0,0 +1,106 @@
302+#!/usr/bin/perl
303+
304+# LICENSE: GNU Affero General Public License v3
305+# COPYRIGHT: Community Software Lab
306+# CONTACT: help@thecsl.org
307+# PROJECT: https://launchpad.net/mvhub/
308+
309+# PURPOSE: Does the following:
310+# - Creates $base_dir, $source_code_dir, $conf_dir
311+# - Creates log/mvh and log/nsp in $BASE_DIR
312+# - Configures Apache admin auth
313+# - Adds aliases to /etc/profile
314+# - Adds hosts to /etc/hosts
315+# - Adds Apache test hostnames
316+# - Enables Apache modules
317+
318+use strict;
319+use warnings;
320+
321+use File::Path qw(make_path);
322+use File::Copy;
323+
324+my $USER = $ENV{SUDO_USER};
325+$USER = $USER || `logname`;
326+chomp($USER);
327+
328+my $uid = getpwnam($USER);
329+my $gid = getgrnam($USER);
330+
331+my $base_dir = "/var/www/mvhub/$USER";
332+my $source_code_dir = "$base_dir/source-code";
333+my $conf_dir = "$base_dir/conf";
334+my $conf_template_file = "$conf_dir/nsp.conf";
335+my $apache_auth_file = "$conf_dir/auth_apache_users";
336+my $mvh_log_dir = "$base_dir/log/mvh";
337+my $nsp_log_dir = "$base_dir/log/nsp";
338+
339+print "Setting up directories for user: $USER\n";
340+make_path( $base_dir, $source_code_dir, $conf_dir, $mvh_log_dir,
341+ $nsp_log_dir );
342+copy( "/etc/mvhub-dev-env/template.conf", $conf_template_file );
343+
344+print "Configuring Apache admin authorization\n";
345+system("htpasswd -cb $conf_dir/auth_apache_users test test");
346+
347+foreach my $file_or_dir ( $base_dir, $source_code_dir, $conf_dir,
348+ $conf_template_file, $apache_auth_file )
349+{
350+ chown $uid, $gid, $file_or_dir
351+ or warn "Could not chown $file_or_dir as $USER";
352+}
353+
354+my $aliases_append_data = <<ALIASES;
355+source /etc/mvhub-dev-env/mv_aliases
356+ALIASES
357+
358+check_and_append( "Adding mv_aliases to /etc/profile\n",
359+ "/etc/profile", $aliases_append_data );
360+
361+my $apache_hosts_append_data = <<"HOSTS";
362+Use MVHub $USER nsp nsp.$USER.localhost
363+Use MVHub $USER mvh mvh.$USER.localhost
364+HOSTS
365+
366+check_and_append(
367+ "Configuring Apache with test hostnames\n",
368+ "/etc/apache2/sites-available/mvhub.data",
369+ $apache_hosts_append_data
370+);
371+
372+my $etc_hosts_append_data = <<"HOSTS";
373+127.0.0.1 mvh.$USER.localhost
374+127.0.0.1 nsp.$USER.localhost
375+HOSTS
376+
377+check_and_append( "Configuring /etc/hosts\n",
378+ "/etc/hosts", $etc_hosts_append_data );
379+
380+print "Enabling Apache modules:\n";
381+system("a2enmod macro");
382+system("a2enmod rewrite");
383+system("a2enmod include");
384+system("a2ensite mvhub.conf");
385+system("apache2ctl restart");
386+system("/etc/init.d/apache2 reload");
387+
388+sub check_and_append {
389+ my ( $message, $filename, $append_data ) = @_;
390+ chomp($append_data);
391+ my $marker_string = "## Added by mvhub-dev-env";
392+ print $message;
393+ open( FILE, $filename );
394+ if ( !open( FILE, $filename )
395+ or scalar( grep {/$marker_string/} <FILE> ) == 0 )
396+ {
397+ open( FILE, ">>$filename" );
398+ print FILE <<"HERE";
399+\n$marker_string
400+$append_data
401+##
402+HERE
403+ }
404+ close FILE;
405+}
406+
407+#DEBHELPER#
408
409=== added file 'debian/mvhub-dev-env.postrm'
410--- debian/mvhub-dev-env.postrm 1970-01-01 00:00:00 +0000
411+++ debian/mvhub-dev-env.postrm 2012-07-17 19:36:21 +0000
412@@ -0,0 +1,41 @@
413+#!/usr/bin/perl
414+
415+# LICENSE: GNU Affero General Public License v3
416+# COPYRIGHT: Community Software Lab
417+# CONTACT: help@thecsl.org
418+# PROJECT: https://launchpad.net/mvhub/
419+
420+# PURPOSE: Does the following:
421+# - Removes aliases from /etc/profile
422+# - Removes hosts from /etc/hosts
423+# - Deletes /etc/apache2/sites-available/mvhub.data
424+
425+use strict;
426+use warnings;
427+use File::Path;
428+
429+check_and_remove("/etc/profile");
430+check_and_remove("/etc/hosts");
431+
432+print "Disabling Apache modules:\n";
433+system("a2dismod macro");
434+system("a2dismod rewrite");
435+system("a2dismod include");
436+system("a2dissite mvhub.conf");
437+system("apache2ctl restart");
438+system("/etc/init.d/apache2 reload");
439+unlink('/etc/apache2/sites-available/mvhub.data');
440+
441+sub check_and_remove {
442+ my $filename = shift;
443+ open( FILE, "<$filename" );
444+ my $filedata = join( "", <FILE> );
445+ close FILE;
446+ $filedata =~ s/\n## Added by mvhub-dev-env(.|[\r\n])*##$//;
447+ $filedata = substr($filedata, 0, length($filedata));
448+ open( FILE, ">$filename" );
449+ print FILE $filedata;
450+ close FILE;
451+}
452+
453+#DEBHELPER#
454
455=== added file 'debian/rules'
456--- debian/rules 1970-01-01 00:00:00 +0000
457+++ debian/rules 2012-07-17 19:36:21 +0000
458@@ -0,0 +1,13 @@
459+#!/usr/bin/make -f
460+# -*- makefile -*-
461+# Sample debian/rules that uses debhelper.
462+# This file was originally written by Joey Hess and Craig Small.
463+# As a special exception, when this file is copied by dh-make into a
464+# dh-make output file, you may use that output file without restriction.
465+# This special exception was added by Craig Small in version 0.37 of dh-make.
466+
467+# Uncomment this to turn on verbose mode.
468+# export DH_VERBOSE=1
469+
470+%:
471+ dh $@
472
473=== modified file 'lib-mvhub/README'
474--- lib-mvhub/README 2011-12-02 15:08:42 +0000
475+++ lib-mvhub/README 2012-07-17 19:36:21 +0000
476@@ -17,12 +17,12 @@
477
478 INSTALLATION
479
480-To install this module, run the following commands:
481-
482- perl Build.PL
483- ./Build
484- ./Build test
485- ./Build install
486+-To install this module, run the following commands:
487+-
488+- perl Build.PL
489+- ./Build
490+- ./Build test
491+- ./Build install
492
493 SUPPORT AND DOCUMENTATION
494
495@@ -40,4 +40,3 @@
496 Copyright (C) 2008 Community Software Lab
497
498 The GNU Affero General Public License, version 3 (AGPLv3)
499-
500
501=== modified file 'lib-mvhub/lib/MVHub/Utils/Setup/CPANLibs.pm'
502--- lib-mvhub/lib/MVHub/Utils/Setup/CPANLibs.pm 2011-12-02 15:08:42 +0000
503+++ lib-mvhub/lib/MVHub/Utils/Setup/CPANLibs.pm 2012-07-17 19:36:21 +0000
504@@ -24,7 +24,7 @@
505 conf => {
506 allow_build_interactivity => 'false',
507 prereqs => 1,
508- verbose => 'false',
509+ verbose => 'true',
510 }
511 );
512
513
514=== modified file 'lib-mvhub/t/conf/all.conf'
515--- lib-mvhub/t/conf/all.conf 2011-12-02 15:08:42 +0000
516+++ lib-mvhub/t/conf/all.conf 2012-07-17 19:36:21 +0000
517@@ -111,6 +111,7 @@
518 user_conf_dir=conf/
519 log_dir=log/nsp/
520 sqlite_data_dir=tmp/
521+result_dir=built_packages/
522
523 [COOKIES]
524 # name of cookie used to store

Subscribers

People subscribed via source and target branches