octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave-Forge: requirement for a maintainer Makefile for release


From: Juan Pablo Carbajal
Subject: Re: Octave-Forge: requirement for a maintainer Makefile for release
Date: Wed, 30 Nov 2016 00:40:31 +0100

On Fri, Nov 25, 2016 at 12:45 AM, Carnë Draug <address@hidden> wrote:
> On 16 November 2016 at 14:47, Alexander Barth <address@hidden> wrote:
>> Hi all,
>>
>> I am maintain currently 6 packages and I use a bash script to prepare
>> a release (do a clean check out, remove unnecessary files such as
>> .gitignore, make configure script, run tests, generate documentation
>> ...)
>>
>> I think it would be good to have all these tasks at a central place (a
>> bash script or a Makefile fragment) rather than to explicitly copy
>> this logic in all 6 Makefiles. Otherwise it would be quite difficult
>> to maintain the Makefiles in the long run.
>>
>
> The problem with a central place with a unique script or Makefile for
> releases is that it would impose a unique shape on all packages which
> would be too restritive (or would have to be too complex to achieve
> that flexibility).  For example, not all packages need to run autoconf
> to create the configure script.  Some of those need also to run aclocal
> before.  Some packages have directories for scripts and code snippets
> that are removed from package releases.  The ltfat Octave package is
> only part of a larger project.  I am sure there will be other cases.
>
> You can still keep all the 6 Makefile on your packages the same, it's
> just that you would have to sync them when a change is made.  You can
> even a one line Makefile that only calls your script (but your existing
> script would still have to be committed on the six repos).  I would
> guess that they wouldn't change much overtime so it wouldn't be too
> much of a burden.
>
> Also, while it would be nice to also have targets on the Makefile to
> run the tests and install development versions, I am only proposing
> a target to make a release which can be this:
>
>     PACKAGE := $(shell grep "^Name: " DESCRIPTION | cut -f2 -d" ")
>     VERSION := $(shell grep "^Version: " DESCRIPTION | cut -f2 -d" ")
>
>     TARGET_DIR := target/
>     RELEASE_DIR     := $(TARGET_DIR)/$(PACKAGE)-$(VERSION)
>     RELEASE_TARBALL := $(TARGET_DIR)/$(PACKAGE)-$(VERSION).tar.gz
>
>     .PHONY: dist
>
>     dist: $(RELEASE_TARBALL)
>
>     %.tar.gz: %
>         tar -c -f - --posix -C "$(TARGET_DIR)/" "$(notdir $<)" | gzip -9n > 
> "$@"
>
>     $(RELEASE_DIR): .git/index
>         $(RM) -r "$@"
>         git archive --format=tar --prefix="$@/" HEAD | tar -x
>         $(RM) "$@/.gitignore"
>         chmod -R a+rX,u+w,go-w "$@"
>
> I have also written a template [1] for the developers instructions based on
> the existing Makefiles now present on the forge packages (the example above
> is adapted from it).  Could you give any feedback if that can help?
>
> Carnë
>
> [1] 
> http://hg.code.sf.net/p/octave/project-web/file/d2dd7f6a47d6/htdocs/templates/Makefile
>

Carne,

The Makefile in templates will fail to make check with packages that
have dependencies. They need ot be loaded. Mike fixed this in signal,
then I improve it in geometry.

DEPENDS := $(shell $(SED) -n -e 's/^Depends[^,]*, \(.*\)/\1/p'
DESCRIPTION | $(SED) 's/ *([^()]*),*/ /g')

check: all
$(OCTAVE) --silent \
 --eval 'if(!isempty("$(DEPENDS)")); pkg load $(DEPENDS); endif;' \
 --eval 'addpath (fullfile ([pwd filesep "inst"]));' \
 --eval '$(PKG_ADD)'\
 --eval 'cellfun(@(x)runtests (x), __geometry_package_register__);'

Same goes for make run



reply via email to

[Prev in Thread] Current Thread [Next in Thread]