You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Daniel Mahler <ma...@cyc.com> on 2001/03/21 01:41:52 UTC
jakarta/Ant naming convention nightmares
I install and maintain a lot publicly available software.
I am not a superuser so I have a subdirectory in my home directory
with the same structure as /usr/local.
I use stow to keep my installation sane, and to avoid having
a $PATH as long as your arm.
I have a Makefile which automates the
untar/configure/make/install/stow process.
I just cd to ~/local and say 'make package-version'
and, for the vast majority of distributions,
that is all I need to do.
This relies on a very simple naming convention being used in most
distributions
I now need to install the various jakarta packages.
I figured I would just extend my script and all would be well.
However, the distributions use a rather baroque naming convention:
* jakarta-<project>-src-<version>.<archivetype> for the distribution
* name of the unpacked directory may or may not contain the "-src"
* {build,dist}/jakarta-<project> for the default install directories
* <project>.<property> for the ant properties
writing a generic script to automate this is a royal pain.
The following to simplify install automation:
- either drop the jakarta prefix or always use it as a part of the
project name
Assuming "jakarta-" is dropped:
* <project>-<version>.<archivetype> for the source distribution
* <project>-<version> for the expanded top directory
* {build,dist}/<project>-<version> for the default install directories
together with a {build,dist}/<project> symlink to the directory
* just <property> for the buildfile properties pertaining to the current
project
regards
Daniel
PS: here is the MakeFile I use,
it assumes TAR, SRC and STOW subdirectories of ~/local
.SUFFIXES: .jar .tar .tar..bz2 .tar.gz .tgz .Z .zip .build .kill .clean
.check .test
%: STOW/%
rm -f $</info/dir; # remove this line if installing emacs itself
(cd STOW; stow $(<F));
STOW/%: SRC/%.build
$(MAKE) $(@F).kill;
cp -a STOW/LOCAL $@
$(MAKE) -C SRC/$(@F) install;
#STOW/%: SRC/%/build.sh
# (cd $(<D); sh ./build.sh -Dbuild=$@)
STOW/%: SRC/%/build.xml
$(MAKE) $(@F).kill;
cp -a STOW/LOCAL $@
ant -buildfile $< all
SRC/%/build.sh: SRC/%
SRC/%/build.xml: SRC/%
SRC/%.build: SRC/%/Makefile
$(MAKE) -C $(<D);
SRC/%/Makefile: SRC/%
(cd $<; ./configure --prefix=$(STOW)/$(<F));
SRC/%: TAR/%.tgz
tar zfx $< --directory $(@D);
SRC/%: TAR/%.tar.gz
tar zfx $< --directory $(@D);
SRC/%: TAR/%.tar.Z
tar zfx $< --directory $(@D);
SRC/%: TAR/%.zip
unzip -d $(@) $<
SRC/%: TAR/%.tar
tar fx $< --directory $(@D);
TAR/%.tar: TAR/%.tar.bz2
bunzip2 $<
SRC/%: TAR/%.jar
jar fx $< --directory $(@D);
%.kill:
(cd STOW; stow -D $(*F))
rm -rf STOW/$(*F);
%.clean: %.kill
rm -rf SRC/$(*F);
%.check: SRC/%/Makefile
$(MAKE) -C $(<D) check;
%.test: SRC/%/Makefile
$(MAKE) -C $(<D) test;
#STOW/%: SRC/%/Makefile
# $(MAKE) -C $(<D);
# $(MAKE) $(@F).kill;
# mkdir $@;
# $(MAKE) -C $(<D) install;
#STOW/%: SRC/%
## $(MAKE) $</Makefile
# (cd $<; ./configure --prefix=$(STOW)/$(@F);)
# $(MAKE) -C $<;
# $(MAKE) %.kill;
# mkdir $@;
# $(MAKE) -C $< install;
---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
For additional commands, e-mail: general-help@jakarta.apache.org