~ubuntu-branches/ubuntu/wily/octave-miscellaneous/wily

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot, Rafael Laboissiere, Sébastien Villemot
  • Date: 2012-10-17 13:40:55 UTC
  • mfrom: (1.2.1) (12 sid)
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: package-import@ubuntu.com-20121017134055-vatltexghy77fnv7
Tags: 1.2.0-1
[ Rafael Laboissiere ]
* Imported Upstream version 1.2.0
* Bump Standards-Version to 3.9.4 (no changes needed)
* Refresh for new upstream release
* Use Sébastien Villemot's @debian.org email address
* Remove obsolete DM-Upload-Allowed flag
* Add patch autoload-yes.patch
* Add copyright info for file lauchli.m (included in a Debian patch)
* Add patch partcnt-test-succeeds.patch
* Build-depends on octave-pkg-dev >= 1.0.3

[ Sébastien Villemot ]
* debian/control: fix versioned dependency on debhelper
* Add lintian override for false positive on hardening (fortify)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
## Generic Makefile to allow the octave-forge packages to be build and 
2
 
## installed using "configure; make all; make install". This Makefile
3
 
## includes the capability to install to a temporary location, and install
4
 
## an on_uninstall.m file that prevents the user removing this package
5
 
## with Octave's package manager. This is useful for for the distribution's
6
 
## various package managers and is forced by defining DESTDIR and DISTPKG.
7
 
 
8
 
PKGDIR := $(shell pwd | sed -e 's|^.*/||')
9
 
TMPDIR ?= /tmp
10
 
PACKAGE ?= $(TMPDIR)/$(PKGDIR).tar.gz
11
 
PKG := $(shell echo $(PKGDIR) | sed -e 's|^\(.*\)-.*|\1|')
12
 
 
13
 
all: build package
14
 
 
15
 
build:
16
 
        @if [ -e src/Makefile ]; then \
17
 
           $(MAKE) -C src all; \
18
 
        fi
19
 
 
20
 
package: build
21
 
        @if [ -e src/Makefile ]; then \
22
 
          mv src/Makefile src/Makefile.disable; \
23
 
        fi; \
24
 
        if [ -e src/configure ]; then \
25
 
          mv src/configure src/configure.disable; \
26
 
        fi; \
27
 
        cd ..; tar -czf $(PACKAGE) $(PKGDIR); \
28
 
 
29
 
install:
30
 
        @cd ../; \
31
 
        if [ "X${DISTPKG}X" != "XX" ]; then \
32
 
          stripcmd="unlink(pkg('local_list'));unlink(pkg('global_list'));"; \
33
 
        fi; \
34
 
        if [ "X$(DESTDIR)X" = "XX" ]; then \
35
 
          pkgdir=`octave -H -q --no-site-file --eval "warning('off','all');pkg('install','$(PACKAGE)');l=pkg('list');disp(l{cellfun(@(x)strcmp(x.name,'$(PKG)'),l)}.dir);$$stripcmd;"`; \
36
 
        else \
37
 
          shareprefix=$(DESTDIR)/`octave -H -q --no-site-file --eval "disp(fullfile(OCTAVE_HOME(),'share','octave'));"`; \
38
 
          libexecprefix=$(DESTDIR)/`octave -H -q --no-site-file --eval "disp(fullfile(octave_config_info('libexecdir'),'octave'));"`; \
39
 
          octprefix=$$shareprefix/packages; \
40
 
          archprefix=$$libexecprefix/packages; \
41
 
          if [ ! -e $$octprefix ]; then \
42
 
            mkdir -p $$octprefix; \
43
 
          fi; \
44
 
          if [ ! -e $$archprefix ]; then \
45
 
            mkdir -p $$archprefix; \
46
 
          fi; \
47
 
          octave -H -q --no-site-file --eval "warning('off','all');pkg('prefix','$$octprefix','$$archprefix');pkg('global_list',fullfile('$$shareprefix','octave_packages'));pkg('local_list',fullfile('$$shareprefix','octave_packages'));pkg('install','-nodeps','-verbose','$(PACKAGE)');"; \
48
 
          pkgdir=`octave -H -q --no-site-file --eval "warning('off','all');pkg('prefix','$$octprefix','$$archprefix');pkg('global_list',fullfile('$$shareprefix','octave_packages'));pkg('local_list',fullfile('$$shareprefix','octave_packages'));l=pkg('list');disp(l{cellfun(@(x)strcmp(x.name,'$(PKG)'),l)}.dir);$$stripcmd;"`; \
49
 
        fi; \
50
 
        if [ "X${DISTPKG}X" != "XX" ]; then \
51
 
          if [ -e $$pkgdir/packinfo/on_uninstall.m ]; then \
52
 
            mv $$pkgdir/packinfo/on_uninstall.m \
53
 
               $$pkgdir/packinfo/on_uninstall.m.orig; \
54
 
          fi; \
55
 
          echo "function on_uninstall (desc)" > $$pkgdir/packinfo/on_uninstall.m; \
56
 
          echo "  error ('Can not uninstall %s installed by the $(DISTPKG) package manager', desc.name);" >> $$pkgdir/packinfo/on_uninstall.m; \
57
 
          echo "endfunction" >> $$pkgdir/packinfo/on_uninstall.m; \
58
 
          echo "#! /bin/sh -f" > $$pkgdir/packinfo/dist_admin; \
59
 
          echo "if [ \"\$$1\" == \"install\" ]; then" >> $$pkgdir/packinfo/dist_admin; \
60
 
          echo "  octave -H -q --no-site-file --eval \"pkg('rebuild');\"" >> $$pkgdir/packinfo/dist_admin; \
61
 
          echo "else"  >> $$pkgdir/packinfo/dist_admin; \
62
 
          echo "  pkgdir=\`octave -H -q --no-site-file --eval \"pkg('rebuild');l=pkg('list');disp(l{cellfun(@(x)strcmp(x.name,'$(PKG)'),l)}.dir);\"\`" >> $$pkgdir/packinfo/dist_admin; \
63
 
          echo "  rm \$$pkgdir/packinfo/on_uninstall.m" >> $$pkgdir/packinfo/dist_admin; \
64
 
          echo "  if [ -e \$$pkgdir/packinfo/on_uninstall.m.orig ]; then" >> $$pkgdir/packinfo/dist_admin; \
65
 
          echo "    mv \$$pkgdir/packinfo/on_uninstall.m.orig \$$pkgdir/packinfo/on_uninstall.m" >> $$pkgdir/packinfo/dist_admin; \
66
 
          echo "    cd \$$pkgdir/packinfo" >> $$pkgdir/packinfo/dist_admin; \
67
 
          echo "    octave -q -H --no-site-file --eval \"l=pkg('list');on_uninstall(l{cellfun(@(x)strcmp(x.name,'$(PKG)'),l)});\"" >> $$pkgdir/packinfo/dist_admin; \
68
 
          echo "  fi"  >> $$pkgdir/packinfo/dist_admin; \
69
 
          echo "fi"  >> $$pkgdir/packinfo/dist_admin; \
70
 
          chmod a+x $$pkgdir/packinfo/dist_admin; \
71
 
        fi;
72
 
 
73
 
clean:
74
 
        rm $(PACKAGE)
75
 
        $(MAKE) -C src clean