seeddms-code/Makefile

98 lines
4.4 KiB
Makefile

VERSION=$(shell php -r 'include("inc/inc.Version.php"); $$v=new SeedDMS_Version(); echo $$v->version();')
SRC=CHANGELOG inc conf utils index.php .htaccess languages op out controllers doc TODO LICENSE webdav install restapi pdfviewer
VIEWS ?= bootstrap bootstrap4
NODISTFILES=utils/importmail.php utils/seedddms-importmail utils/remote-email-upload utils/remote-upload utils/da-bv-reminder.php utils/seeddms-da-bv-reminder utils/relodge.php utils/seeddms-relodge .svn .gitignore
PHPDOC=~/Downloads/phpDocumentor.phar
dist:
mkdir -p tmp/seeddms-$(VERSION)
cp -a $(SRC) tmp/seeddms-$(VERSION)
mkdir -p tmp/seeddms-$(VERSION)/views
mkdir -p tmp/seeddms-$(VERSION)/styles
for view in $(VIEWS) ; do \
if [ -d "views/$$view" ] ; then \
cp -a views/$$view tmp/seeddms-$(VERSION)/views ; \
fi ; \
if [ -d "styles/$$view" ] ; then \
cp -a styles/$$view tmp/seeddms-$(VERSION)/styles ; \
fi ; \
done
(cd tmp/seeddms-$(VERSION); rm -rf $(NODISTFILES); mv conf conf.template)
(cd tmp; tar --exclude=.svn --exclude=.gitignore -czvf ../seeddms-$(VERSION).tar.gz seeddms-$(VERSION))
rm -rf tmp
quickstart:
vendor/bin/phing -Dversion=$(VERSION) package
unittest:
vendor/bin/phing -Dversion=$(VERSION) phpunitfast
pear:
(cd SeedDMS_Core/; pear package)
(cd SeedDMS_Lucene/; pear package)
(cd SeedDMS_Preview/; pear package)
(cd SeedDMS_SQLiteFTS/; pear package)
webdav:
mkdir -p tmp/seeddms-webdav-$(VERSION)
cp webdav/* tmp/seeddms-webdav-$(VERSION)
(cd tmp; tar --exclude=.svn -czvf ../seeddms-webdav-$(VERSION).tar.gz seeddms-webdav-$(VERSION))
rm -rf tmp
webapp:
mkdir -p tmp/seeddms-webapp-$(VERSION)
cp -a restapi webapp tmp/seeddms-webapp-$(VERSION)
(cd tmp; tar --exclude=.svn -czvf ../seeddms-webapp-$(VERSION).tar.gz seeddms-webapp-$(VERSION))
rm -rf tmp
repository:
mkdir -p tmp/seeddms-repository-$(VERSION)
cp -a repository/www repository/utils repository/doc tmp/seeddms-repository-$(VERSION)
rm -f tmp/seeddms-repository/utils/update-repository.log
mkdir -p tmp/seeddms-repository-$(VERSION)/files
mkdir -p tmp/seeddms-repository-$(VERSION)/accounts
cp -a repository/files/.htaccess tmp/seeddms-repository-$(VERSION)/files
cp -a repository/accounts/.htaccess tmp/seeddms-repository-$(VERSION)/accounts
cp inc/inc.ClassExtensionMgr.php tmp/seeddms-repository-$(VERSION)/utils
(cd tmp; tar --exclude=.svn -czvf ../seeddms-repository-$(VERSION).tar.gz seeddms-repository-$(VERSION))
rm -rf tmp
doc:
$(PHPDOC) -d SeedDMS_Core --ignore 'getusers.php,getfoldertree.php,config.php,reverselookup.php' --force -t html
# Download apigen with
# composer create-project --no-dev apigen/apigen:^7.0@alpha tools/apigen
apidoc:
tools/apigen/bin/apigen SeedDMS_Core/Core --exclude "tests/*" --output html
# Turn the package.xml file into CHANGELOG.md
#
# The idea is to form blocks of lines separated by an empty line.
# Echo block consists of the version number, release date und notes.
# This blocks are turned into single lines which are than sorted.
# Afterwards the single lines are turned back into blocks.
#
# It first uses sgrep to extract the version, date und notes. This is
# feed to sed to isolated the date and version and put them on separate
# lines. Each version
# forms a block of n lines with the first two being the version and date.
# All remaining lines are notes. Blocks are separated by an empty line.
# It's important to form blocks without ane empty lines because the following
# awk will create a single line from each block which can then be sorted
# (or simply reversed in order).
# Because the blocks are listed in the wrong order (last version first and
# previous version last, e.g. 5.1.29, 3.3.0, 3.3.1, ...., 5.1.27, 5.1.28) they
# need to be reversed in order. This is done by turning each block into line
# with the former new lines replaced by a '|'. So it's basically a '|' separated
# csv file which is then reversed in order by 'sort -r'. In order to separate
# blocks by a newline, each line of that output is appended by another
# line break. Result is put back
# into the original format by replacing all '|' by newline.
#
changelog:
@sgrep 'stag("DATE") .. etag("DATE") or ((stag("RELEASE") .. etag("RELEASE")) in (stag("VERSION") .. etag("VERSION"))) or inner(stag("NOTES") __ etag("NOTES"))' SeedDMS_Core/package.xml | sed -e 's#^ *<date>\([-0-9]*\)</date><release>\([0-9.]*\)</release>#\n\n\2 (\1)\n---------------------#' | awk -F'\n' -vRS='' -vOFS='|' '{$$1=$$1}1' | sort -V -r | sed 's/$$/\n/' | tr '|' '\n'
.PHONY: doc webdav webapp repository changelog