annotate packages/package_Makefile.in @ 12671:20e8aca47b2c octave-forge

prepare for release
author cdf
date Mon, 17 Aug 2015 10:19:39 +0000
parents c91d68122e06
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3641
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
1 ## Generic Makefile to allow the octave-forge packages to be build and
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
2 ## installed using "configure; make all; make install". This Makefile
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
3 ## includes the capability to install to a temporary location, and install
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
4 ## an on_uninstall.m file that prevents the user removing this package
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
5 ## with Octave's package manager. This is useful for for the distribution's
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
6 ## various package managers and is forced by defining DESTDIR and DISTPKG.
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
7
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
8 PKGDIR := $(shell pwd | sed -e 's|^.*/||')
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
9 TMPDIR ?= /tmp
3895
889cd9a53749 Update SRPM build to allow for noarch packages
adb014
parents: 3893
diff changeset
10 PACKAGE ?= $(TMPDIR)/$(PKGDIR).tar.gz
3641
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
11 PKG := $(shell echo $(PKGDIR) | sed -e 's|^\(.*\)-.*|\1|')
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
12
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
13 all: build package
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
14
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
15 build:
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
16 @if [ -e src/Makefile ]; then \
3864
fa2169b77926 Call make with $(MAKE) instead of make
opoplawski
parents: 3641
diff changeset
17 $(MAKE) -C src all; \
3641
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
18 fi
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
19
3864
fa2169b77926 Call make with $(MAKE) instead of make
opoplawski
parents: 3641
diff changeset
20 package: build
3893
09df560cb393 Add -nodeps for DISTPKG install and only move src/{Makefile,configure} in src/ rather than most files
adb014
parents: 3891
diff changeset
21 @if [ -e src/Makefile ]; then \
09df560cb393 Add -nodeps for DISTPKG install and only move src/{Makefile,configure} in src/ rather than most files
adb014
parents: 3891
diff changeset
22 mv src/Makefile src/Makefile.disable; \
09df560cb393 Add -nodeps for DISTPKG install and only move src/{Makefile,configure} in src/ rather than most files
adb014
parents: 3891
diff changeset
23 fi; \
09df560cb393 Add -nodeps for DISTPKG install and only move src/{Makefile,configure} in src/ rather than most files
adb014
parents: 3891
diff changeset
24 if [ -e src/configure ]; then \
09df560cb393 Add -nodeps for DISTPKG install and only move src/{Makefile,configure} in src/ rather than most files
adb014
parents: 3891
diff changeset
25 mv src/configure src/configure.disable; \
3891
5a54e68e7f15 Put tar in package target outside if-block (For Orion Poplawski)
adb014
parents: 3875
diff changeset
26 fi; \
5a54e68e7f15 Put tar in package target outside if-block (For Orion Poplawski)
adb014
parents: 3875
diff changeset
27 cd ..; tar -czf $(PACKAGE) $(PKGDIR); \
3641
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
28
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
29 install:
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
30 @cd ../; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
31 if [ "X${DISTPKG}X" != "XX" ]; then \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
32 stripcmd="unlink(pkg('local_list'));unlink(pkg('global_list'));"; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
33 fi; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
34 if [ "X$(DESTDIR)X" = "XX" ]; then \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
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;"`; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
36 else \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
37 shareprefix=$(DESTDIR)/`octave -H -q --no-site-file --eval "disp(fullfile(OCTAVE_HOME(),'share','octave'));"`; \
3875
e05bc41b0228 Update rpm packaging and octave-forge default Makefile for new version of pkg
adb014
parents: 3864
diff changeset
38 libexecprefix=$(DESTDIR)/`octave -H -q --no-site-file --eval "disp(fullfile(octave_config_info('libexecdir'),'octave'));"`; \
3641
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
39 octprefix=$$shareprefix/packages; \
3875
e05bc41b0228 Update rpm packaging and octave-forge default Makefile for new version of pkg
adb014
parents: 3864
diff changeset
40 archprefix=$$libexecprefix/packages; \
3641
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
41 if [ ! -e $$octprefix ]; then \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
42 mkdir -p $$octprefix; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
43 fi; \
3875
e05bc41b0228 Update rpm packaging and octave-forge default Makefile for new version of pkg
adb014
parents: 3864
diff changeset
44 if [ ! -e $$archprefix ]; then \
e05bc41b0228 Update rpm packaging and octave-forge default Makefile for new version of pkg
adb014
parents: 3864
diff changeset
45 mkdir -p $$archprefix; \
e05bc41b0228 Update rpm packaging and octave-forge default Makefile for new version of pkg
adb014
parents: 3864
diff changeset
46 fi; \
3902
c91d68122e06 Use -verbose during installs
opoplawski
parents: 3895
diff changeset
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)');"; \
c91d68122e06 Use -verbose during installs
opoplawski
parents: 3895
diff changeset
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;"`; \
3641
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
49 fi; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
50 if [ "X${DISTPKG}X" != "XX" ]; then \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
51 if [ -e $$pkgdir/packinfo/on_uninstall.m ]; then \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
52 mv $$pkgdir/packinfo/on_uninstall.m \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
53 $$pkgdir/packinfo/on_uninstall.m.orig; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
54 fi; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
55 echo "function on_uninstall (desc)" > $$pkgdir/packinfo/on_uninstall.m; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
56 echo " error ('Can not uninstall %s installed by the $(DISTPKG) package manager', desc.name);" >> $$pkgdir/packinfo/on_uninstall.m; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
57 echo "endfunction" >> $$pkgdir/packinfo/on_uninstall.m; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
58 echo "#! /bin/sh -f" > $$pkgdir/packinfo/dist_admin; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
59 echo "if [ \"\$$1\" == \"install\" ]; then" >> $$pkgdir/packinfo/dist_admin; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
60 echo " octave -H -q --no-site-file --eval \"pkg('rebuild');\"" >> $$pkgdir/packinfo/dist_admin; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
61 echo "else" >> $$pkgdir/packinfo/dist_admin; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
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; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
63 echo " rm \$$pkgdir/packinfo/on_uninstall.m" >> $$pkgdir/packinfo/dist_admin; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
64 echo " if [ -e \$$pkgdir/packinfo/on_uninstall.m.orig ]; then" >> $$pkgdir/packinfo/dist_admin; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
65 echo " mv \$$pkgdir/packinfo/on_uninstall.m.orig \$$pkgdir/packinfo/on_uninstall.m" >> $$pkgdir/packinfo/dist_admin; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
66 echo " cd \$$pkgdir/packinfo" >> $$pkgdir/packinfo/dist_admin; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
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; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
68 echo " fi" >> $$pkgdir/packinfo/dist_admin; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
69 echo "fi" >> $$pkgdir/packinfo/dist_admin; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
70 chmod a+x $$pkgdir/packinfo/dist_admin; \
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
71 fi;
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
72
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
73 clean:
7a2096f330ea Include Makefile/configure in packages to allow 'configure; make all; make install' work
adb014
parents:
diff changeset
74 rm $(PACKAGE)
3864
fa2169b77926 Call make with $(MAKE) instead of make
opoplawski
parents: 3641
diff changeset
75 $(MAKE) -C src clean