-
Notifications
You must be signed in to change notification settings - Fork 314
Description
Generate the package meta data
This should be based on build system inputs. This could look like this for `maven':
<control>
<package>(default from pom)</package>
<version>(default from pom)</version>
<section>(default 'misc')</section>
<priority>(default 'low')</priority>
<architecture>(default 'all')</architecture>
<maintainer>(default from pom)</maintainer>
<pre-inst src="${basedir}/someshell.sh"/>
<pre-rm src="${basedir}/someshell.sh"/>
<post-inst src="${basedir}/someshell.sh"/>
<post-rm src="${basedir}/someshell.sh"/>
</control>
and for ant
:
<control>
<package>(no default)</package>
<version>(no default)</version>
<section>(default 'misc')</section>
<priority>(default 'low')</priority>
<architecture>(default 'all')</architecture>
<maintainer>(no default)</maintainer>
<pre-inst src="${basedir}/someshell.sh"/>
<pre-rm src="${basedir}/someshell.sh"/>
<post-inst src="${basedir}/someshell.sh"/>
<post-rm src="${basedir}/someshell.sh"/>
</control>
Of course we could us attributes for ant
instead. While that makes things more ant
like it does not make things much easier to read IMO. Maybe we could allow both - not sure how I feel about supporting both though. MIght be more confusing than it helps.
Inline data configurations
We could use explicit nesting to define the virtual file system properties inside a debian archive tree. We would then map it to the sources. Here attributes would cut down the verboseness immensely. Unfortunately maven
still doesn't support this. Which could be a point for a custom descriptor. For now the proposal looks like this:
<!-- defaults:
dir: own=root:root mod=750
file: own=root:root mod=640 filter=no compress=no
-->
<data>
<dir>
<dir>
<name>usr</name>
<own>root:root</own>
<mod>755</mod>
<dir>
<name>bin</bin>
<file>
<name>test</test>
<own>root:root</own>
<mod>755</mod>
<src>${basedir}/someshell.sh</src>
<filter>yes|no</filter>
</file>
<file>
<name>test-as-link</test>
<own>root:root</own>
<mod>755</mod>
<type>symbolic</type>
<target>test</target>
</file>
</dir>
<dir>
<name>lib</bin>
<file>
<name>${project.build.finalName}.jar</test>
<mod>755</mod>
<src>${project.build.directory}/${project.build.finalName}.jar</src>
</file>
<file>
<name>${project.build.finalName}.man.gz</test>
<mod>755</mod>
<src>somepath</src>
<compress>gzip</compress>
</file>
</dir>
<dir>
<name>doc</bin>
<src>${basedir}/docs</src>
<own>auto</own>
<mod>auto</mod>
<dir>
<name>examples</bin>
<src>${basedir}/examples.tgz</src>
<own>auto</own>
<mod>auto</mod>
</dir>
</dir>
</dir>
</data>
In ant
we could use filesets to provide the be src
of dir
elements. To make the the mapping less verbose we could use pattern matching to define default values to specify owner, permissions and so on - or fall back to the defaults or the permissions (since java7) on disk. I assume this would break cross platform buildability though. (Could a windows user confirm?)
Question is whether we need this to be a little more dynamic and allow for generating sub trees base on some kind "generator".
<data id="root">
<dir>
<each>
<id>item</id>
</each>
<data id="item">
<dir>
<dir>
<name>...</name>
But is that really needed? One could also just prepare the dir on disk like before and then just map the dir and apply patterns for permissions. For now I would omit this.
Based on the old gist https://gist.github.com/tcurdt/9275523