[Pkg-octave-commit] [dynare] 03/05: Use the new upstream "make install" rule.

Sébastien Villemot sebastien at debian.org
Thu Jul 31 19:10:07 UTC 2014


This is an automated email from the git hooks/post-receive script.

sebastien pushed a commit to branch master
in repository dynare.

commit a3537901200a81f39de7d6eb223df2ee09bf987d
Author: Sébastien Villemot <sebastien at debian.org>
Date:   Thu Jul 31 20:43:12 2014 +0200

    Use the new upstream "make install" rule.
    
     + The whole package is now installed under /usr/lib/dynare/.
     + As a consequence, drop the dynare-common package.
     + fhs-compliance.patch: removed, no longer needed.
     + hardcode-dynareroot.patch: new patch.
     + Simplify debian/rules, and no longer use Build-Depends-Indep field.
    
    Git-Dch: Full
---
 debian/README.Debian                               |   4 +-
 debian/control                                     |  44 +------
 debian/dynare-common.install                       |   3 -
 debian/dynare-matlab.NEWS                          |   7 ++
 ...common.emacsen-compat => dynare.emacsen-compat} |   0
 ...mmon.emacsen-install => dynare.emacsen-install} |   4 +-
 ...common.emacsen-remove => dynare.emacsen-remove} |   4 +-
 ...mmon.emacsen-startup => dynare.emacsen-startup} |   0
 debian/dynare.install                              |   7 +-
 debian/patches/extra-addpatch.patch                |   4 +-
 debian/patches/fhs-compliance.patch                | 133 ---------------------
 debian/patches/hardcode-dynareroot.patch           |  15 +++
 debian/patches/series                              |   2 +-
 debian/rules                                       |  27 ++---
 14 files changed, 48 insertions(+), 206 deletions(-)

diff --git a/debian/README.Debian b/debian/README.Debian
index 779fd35..4055603 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -35,6 +35,6 @@ files on your machine, using your copy of MATLAB.
 
 Before using Dynare on MATLAB, you need to type the following:
 
-  addpath /usr/share/dynare/matlab
+  addpath /usr/lib/dynare/matlab
 
- -- Sébastien Villemot <sebastien at debian.org>, Sat, 13 Oct 2012 15:20:16 +0200
+ -- Sébastien Villemot <sebastien at debian.org>, Thu, 31 Jul 2014 18:33:19 +0200
diff --git a/debian/control b/debian/control
index f1d4d8c..883905e 100644
--- a/debian/control
+++ b/debian/control
@@ -4,8 +4,8 @@ Uploaders: Sébastien Villemot <sebastien at debian.org>
 Section: math
 Priority: optional
 Build-Depends: debhelper (>= 9), liboctave-dev, libboost-graph-dev (>= 1.36),
- libmatio-dev, libgsl0-dev, libslicot-dev, dh-autoreconf, libsuitesparse-dev
-Build-Depends-Indep: texlive, texlive-publishers, texlive-extra-utils,
+ libmatio-dev, libgsl0-dev, libslicot-dev, dh-autoreconf, libsuitesparse-dev,
+ texlive, texlive-publishers, texlive-extra-utils,
  texlive-formats-extra, texlive-generic-recommended, texi2html, latex2html,
  latex-beamer, texlive-math-extra
 Standards-Version: 3.9.5
@@ -15,9 +15,10 @@ Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-octave/dynare.git
 
 Package: dynare
 Architecture: any
-Depends: octave, dynare-common (= ${source:Version}), ${shlibs:Depends},
- ${misc:Depends}
+Depends: octave, ${shlibs:Depends}, ${misc:Depends}
 Suggests: dynare-doc, dynare-matlab
+Breaks: dynare-common
+Replaces: dynare-common
 Recommends: liboctave-dev, octave-optim, octave-io, octave-statistics,
  octave-control, matlab2tikz
 Description: platform for handling a wide class of economic models
@@ -46,41 +47,6 @@ Description: platform for handling a wide class of economic models
  .
  This package provides a full installation of Dynare, to be run on top of GNU
  Octave.
- .
- It contains:
-  * the binary preprocessor
-  * dynamic loadable libraries for faster computation, compiled for Octave
-  * the standalone program Dynare++ for higher-order approximations
-
-Package: dynare-common
-Architecture: all
-Depends: ${misc:Depends}
-Description: platform for handling a wide class of economic models (common files)
- Dynare is a software platform for handling a wide class of economic models, in
- particular dynamic stochastic general equilibrium (DSGE) and overlapping
- generations (OLG) models. The models solved by Dynare include those relying on
- the rational expectations hypothesis, wherein agents form their expectations
- about the future in a way consistent with the model. But Dynare is also able
- to handle models where expectations are formed differently: on one extreme,
- models where agents perfectly anticipate the future; on the other extreme,
- models where agents have limited rationality or imperfect knowledge of the
- state of the economy and, hence, form their expectations through a learning
- process. In terms of types of agents, models solved by Dynare can incorporate
- consumers, productive firms, governments, monetary authorities, investors and
- financial intermediaries. Some degree of heterogeneity can be achieved by
- including several distinct classes of agents in each of the aforementioned
- agent categories.
- .
- Dynare offers a user-friendly and intuitive way of describing these models. It
- is able to perform simulations of the model given a calibration of the model
- parameters and is also able to estimate these parameters given a dataset. In
- practice, the user will write a text file containing the list of model
- variables, the dynamic equations linking these variables together, the
- computing tasks to be performed and the desired graphical or numerical
- outputs.
- .
- This package contains the various M-files which can be run under both GNU
- Octave and MATLAB.
 
 Package: dynare-doc
 Architecture: all
diff --git a/debian/dynare-common.install b/debian/dynare-common.install
deleted file mode 100644
index 5afc36d..0000000
--- a/debian/dynare-common.install
+++ /dev/null
@@ -1,3 +0,0 @@
-matlab/                                 /usr/share/dynare/
-contrib/ms-sbvar/TZcode/MatlabFiles     /usr/share/dynare/contrib/ms-sbvar/TZcode/
-scripts/dynare.el                       /usr/share/emacs/site-lisp/dynare-common
diff --git a/debian/dynare-matlab.NEWS b/debian/dynare-matlab.NEWS
new file mode 100644
index 0000000..44c48d1
--- /dev/null
+++ b/debian/dynare-matlab.NEWS
@@ -0,0 +1,7 @@
+dynare-matlab (4.4.3-1) unstable; urgency=medium
+
+  The path of Dynare has changed in this version. You should now do in MATLAB:
+  
+    addpath /usr/lib/dynare/matlab/
+
+ -- Sébastien Villemot <sebastien at debian.org>  Thu, 31 Jul 2014 18:36:42 +0200
diff --git a/debian/dynare-common.emacsen-compat b/debian/dynare.emacsen-compat
similarity index 100%
rename from debian/dynare-common.emacsen-compat
rename to debian/dynare.emacsen-compat
diff --git a/debian/dynare-common.emacsen-install b/debian/dynare.emacsen-install
similarity index 85%
rename from debian/dynare-common.emacsen-install
rename to debian/dynare.emacsen-install
index 0f41d85..5512d0c 100644
--- a/debian/dynare-common.emacsen-install
+++ b/debian/dynare.emacsen-install
@@ -6,8 +6,8 @@ echo install/foo: Handling install of emacsen flavor ${FLAVOR}
 
 byte_compile_options="-batch -f batch-byte-compile"
 el_files="dynare.el" 
-el_dir=/usr/share/emacs/site-lisp/dynare-common/
-elc_dir=/usr/share/${FLAVOR}/site-lisp/dynare-common/
+el_dir=/usr/share/emacs/site-lisp/dynare/
+elc_dir=/usr/share/${FLAVOR}/site-lisp/dynare/
 
 if [ ${FLAVOR} != emacs ]
 then
diff --git a/debian/dynare-common.emacsen-remove b/debian/dynare.emacsen-remove
similarity index 72%
rename from debian/dynare-common.emacsen-remove
rename to debian/dynare.emacsen-remove
index d228cb4..5e4fb33 100644
--- a/debian/dynare-common.emacsen-remove
+++ b/debian/dynare.emacsen-remove
@@ -2,7 +2,7 @@
 set -e
 
 FLAVOR=$1
-elc_dir=/usr/share/${FLAVOR}/site-lisp/dynare-common
+elc_dir=/usr/share/${FLAVOR}/site-lisp/dynare
 
 echo remove/foo: Handling removal of emacsen flavor ${FLAVOR}
 
@@ -11,6 +11,6 @@ then
   echo emacsen-common: purging byte-compiled files for ${FLAVOR}
   rm -f ${elc_dir}/*.elc
   rm -f ${elc_dir}/*.el         # Install might have been interrupted.
-  rmdir --ignore-fail-on-non-empty ${elc_dir}
+  [ -d ${elc_dir} ] && rmdir --ignore-fail-on-non-empty ${elc_dir}
 fi
 exit 0;
diff --git a/debian/dynare-common.emacsen-startup b/debian/dynare.emacsen-startup
similarity index 100%
rename from debian/dynare-common.emacsen-startup
rename to debian/dynare.emacsen-startup
diff --git a/debian/dynare.install b/debian/dynare.install
index 70b7dfc..5897782 100644
--- a/debian/dynare.install
+++ b/debian/dynare.install
@@ -1,2 +1,5 @@
-preprocessor/dynare_m                        /usr/lib/dynare/matlab
-dynare++/src/dynare++                        /usr/bin
+usr/lib/dynare/matlab/
+usr/lib/dynare/mex/
+usr/lib/dynare/contrib/
+usr/bin/dynare++
+scripts/dynare.el                       /usr/share/emacs/site-lisp/dynare
diff --git a/debian/patches/extra-addpatch.patch b/debian/patches/extra-addpatch.patch
index ce914ba..d16120b 100644
--- a/debian/patches/extra-addpatch.patch
+++ b/debian/patches/extra-addpatch.patch
@@ -9,14 +9,14 @@ Forwarded: not-needed
 Last-Update: 2012-03-19
 --- a/matlab/dynare.m
 +++ b/matlab/dynare.m
-@@ -33,6 +33,14 @@
+@@ -33,6 +33,14 @@ function dynare(fname, varargin)
  % You should have received a copy of the GNU General Public License
  % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
  
 +if exist('OCTAVE_VERSION')
 +    warning('off', 'Octave:shadowed-function')
 +end
-+addpath /usr/share/dynare/matlab
++addpath /usr/lib/dynare/matlab
 +if exist('OCTAVE_VERSION')
 +    warning('on', 'Octave:shadowed-function')
 +end
diff --git a/debian/patches/fhs-compliance.patch b/debian/patches/fhs-compliance.patch
deleted file mode 100644
index dc2451a..0000000
--- a/debian/patches/fhs-compliance.patch
+++ /dev/null
@@ -1,133 +0,0 @@
-Description: Fix paths according to the Debian package layout
- Hardcode paths in `dynare_config.m', reflecting the FHS compliance of the
- package.
-Author: Sébastien Villemot <sebastien at debian.org>
-Forwarded: not-needed
---- a/matlab/dynare_config.m
-+++ b/matlab/dynare_config.m
-@@ -35,7 +35,8 @@ function dynareroot = dynare_config(path
- if nargin && ~isempty(path_to_dynare)
-     addpath(path_to_dynare);
- end
--dynareroot = strrep(which('dynare'),'dynare.m','');
-+dynareroot = '/usr/lib/dynare/matlab/';
-+dynareroot_mfiles = '/usr/share/dynare/matlab/';
- 
- origin = pwd();
- cd([dynareroot '/..'])
-@@ -45,66 +46,66 @@ if ~nargin || nargin==1
- end
- 
- 
--addpath([dynareroot '/distributions/'])
--addpath([dynareroot '/kalman/'])
--addpath([dynareroot '/kalman/likelihood'])
--addpath([dynareroot '/AIM/'])
--addpath([dynareroot '/partial_information/'])
--addpath([dynareroot '/ms-sbvar/'])
--addpath([dynareroot '/ms-sbvar/identification/'])
--addpath([dynareroot '../contrib/ms-sbvar/TZcode/MatlabFiles/'])
--addpath([dynareroot '/parallel/'])
--addpath([dynareroot '/particle/'])
--addpath([dynareroot '/gsa/'])
--addpath([dynareroot '/ep/'])
--addpath([dynareroot '/utilities/doc/'])
--addpath([dynareroot '/utilities/tests/'])
--addpath([dynareroot '/utilities/dates/'])
--addpath([dynareroot '/utilities/dataset/'])
--addpath([dynareroot '/utilities/general/'])
--addpath([dynareroot '/reports/'])
-+addpath([dynareroot_mfiles '/distributions/'])
-+addpath([dynareroot_mfiles '/kalman/'])
-+addpath([dynareroot_mfiles '/kalman/likelihood'])
-+addpath([dynareroot_mfiles '/AIM/'])
-+addpath([dynareroot_mfiles '/partial_information/'])
-+addpath([dynareroot_mfiles '/ms-sbvar/'])
-+addpath([dynareroot_mfiles '/ms-sbvar/identification/'])
-+addpath([dynareroot_mfiles '../contrib/ms-sbvar/TZcode/MatlabFiles/'])
-+addpath([dynareroot_mfiles '/parallel/'])
-+addpath([dynareroot_mfiles '/particle/'])
-+addpath([dynareroot_mfiles '/gsa/'])
-+addpath([dynareroot_mfiles '/ep/'])
-+addpath([dynareroot_mfiles '/utilities/doc/'])
-+addpath([dynareroot_mfiles '/utilities/tests/'])
-+addpath([dynareroot_mfiles '/utilities/dates/'])
-+addpath([dynareroot_mfiles '/utilities/dataset/'])
-+addpath([dynareroot_mfiles '/utilities/general/'])
-+addpath([dynareroot_mfiles '/reports/'])
- 
- % For functions that exist only under some Octave versions
- % or some MATLAB versions, and for which we provide some replacement functions
- 
- if ~isoctave
-     % Replacements for rows(), columns() and issquare() (inexistent under MATLAB)
--    addpath([dynareroot '/missing/rows_columns'])
--    addpath([dynareroot '/missing/issquare'])
-+    addpath([dynareroot_mfiles '/missing/rows_columns'])
-+    addpath([dynareroot_mfiles '/missing/issquare'])
-     % Replacement for vec() (inexistent under MATLAB)
--    addpath([dynareroot '/missing/vec'])
-+    addpath([dynareroot_mfiles '/missing/vec'])
-     if ~user_has_matlab_license('statistics_toolbox')
-         % Replacements for functions of the stats toolbox
--        addpath([dynareroot '/missing/stats/'])
-+        addpath([dynareroot_mfiles '/missing/stats/'])
-     end
- end
- 
- % ordeig() doesn't exist in Octave
- if isoctave
--    addpath([dynareroot '/missing/ordeig'])
-+    addpath([dynareroot_mfiles '/missing/ordeig'])
- end
- 
- % bsxfun is missing in old versions of MATLAB (and exists in Octave)
- if ~isoctave && matlab_ver_less_than('7.4')
--    addpath([dynareroot '/missing/bsxfun'])
-+    addpath([dynareroot_mfiles '/missing/bsxfun'])
- end
- 
- % ilu is missing in old versions of MATLAB and in Octave
- if isoctave || matlab_ver_less_than('7.4')
--    addpath([dynareroot '/missing/ilu'])
-+    addpath([dynareroot_mfiles '/missing/ilu'])
- end
- 
- % strjoin is missing in older versions of MATLAB and in Octave < 3.8
- if (isoctave && octave_ver_less_than('3.8')) || ...
-         (~isoctave && matlab_ver_less_than('8.1'))
--    addpath([dynareroot '/missing/strjoin'])
-+    addpath([dynareroot_mfiles '/missing/strjoin'])
- end
- 
- % nanmean is in Octave Forge Statistics package and in MATLAB Statistics
- % toolbox
- if (isoctave && ~user_has_octave_forge_package('statistics')) ...
-     || (~isoctave && ~user_has_matlab_license('statistics_toolbox'))
--    addpath([dynareroot '/missing/nanmean'])
-+    addpath([dynareroot_mfiles '/missing/nanmean'])
- end
- 
- % Add path to MEX files
-@@ -211,10 +212,10 @@ number_of_mex_files = size(mex_status,1)
- %% subfolders if valid mex files exist.
- matlab_path = path;
- for i=1:number_of_mex_files
--    test = strfind(matlab_path,[dynareroot mex_status{i,2}]);
-+    test = strfind(matlab_path,[dynareroot_mfiles mex_status{i,2}]);
-     action = length(test);
-     if action
--        rmpath([dynareroot mex_status{i,2}]);
-+        rmpath([dynareroot_mfiles mex_status{i,2}]);
-         matlab_path = path;
-     end
- end
-@@ -228,7 +229,7 @@ end
- for i=1:number_of_mex_files
-     test = (exist(mex_status{i,1},'file') == 3);
-     if ~test
--        addpath([dynareroot mex_status{i,2}]);
-+        addpath([dynareroot_mfiles mex_status{i,2}]);
-         message = '[m]   ';
-     else
-         message = '[mex] ';
diff --git a/debian/patches/hardcode-dynareroot.patch b/debian/patches/hardcode-dynareroot.patch
new file mode 100644
index 0000000..3a300fb
--- /dev/null
+++ b/debian/patches/hardcode-dynareroot.patch
@@ -0,0 +1,15 @@
+Description: Hardcode the root of the Dynare installation
+ Otherwise it will be incorrectly detected because of the symlink for Octave.
+Author: Sébastien Villemot <sebastien at debian.org>
+Forwarded: not-needed
+--- a/matlab/dynare_config.m
++++ b/matlab/dynare_config.m
+@@ -35,7 +35,7 @@ function dynareroot = dynare_config(path
+ if nargin && ~isempty(path_to_dynare)
+     addpath(path_to_dynare);
+ end
+-dynareroot = strrep(which('dynare'),'dynare.m','');
++dynareroot = '/usr/lib/dynare/matlab/';
+ 
+ origin = pwd();
+ cd([dynareroot '/..'])
diff --git a/debian/patches/series b/debian/patches/series
index 67c8b41..d400ad4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,2 @@
 extra-addpatch.patch
-fhs-compliance.patch
+hardcode-dynareroot.patch
diff --git a/debian/rules b/debian/rules
index 4a7dcb4..cce8353 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,32 +5,19 @@ include /usr/share/octave/debian/defs.make
 %:
 	dh $@ --parallel --with autoreconf
 
-override_dh_auto_build-indep:
-	dh_auto_build --parallel -- pdf html
+# Disable multi-arch path
+override_dh_auto_configure:
+	dh_auto_configure -- --libdir=/usr/lib
 
-# Prevent the compilation of arch-dep files
-override_dh_auto_install-indep:
+# Also build PDF and HTML docs
+override_dh_auto_build:
+	dh_auto_build --parallel -- all pdf html
 
 # Don't run the testsuite
 override_dh_auto_test:
 
-override_dh_install-arch:
-	dh_install -a
-	mkdir -p debian/dynare/usr/lib/dynare/mex/octave
-	cp mex/octave/* debian/dynare/usr/lib/dynare/mex/octave
-
-override_dh_install-indep:
-	dh_install -i
-	rm debian/dynare-common/usr/share/dynare/matlab/dynare_m
-
 override_dh_link:
-	dh_link --package=dynare-common /usr/share/dynare/matlab/dynare.m $(MDIR)/dynare.m
-
-# Fix wrong permissions in upstream tarball
-override_dh_fixperms-indep:
-	dh_fixperms -i
-	find debian/dynare-matlab/usr/src/matlab/dynare-matlab \( -name '*.am' -or -name '*.m4' -or -name '*.ac' \) -exec chmod -x '{}' ';'
-	find debian/dynare-common/usr/share/dynare/matlab/ -name '*.m' -exec chmod -x '{}' ';'
+	dh_link --package=dynare /usr/lib/dynare/matlab/dynare.m $(MDIR)/dynare.m
 
 get-orig-source:
 	uscan --force-download --rename --destdir .

-- 
Alioth's /home/groups/pkg-octave/bin/git-commit-notice on /srv/git.debian.org/git/pkg-octave/dynare.git



More information about the Pkg-octave-commit mailing list