2014-04-19 12:46:27 +02:00
#!/usr/bin/make -f
SHELL = /bin/sh -e
PACKAGES := $(shell dh_listpackages)
MODULES = $(filter-out core,$(patsubst egroupware-epl-%,%,$(filter egroupware-epl-%,$(PACKAGES))))
COREDIR = debian/egroupware-epl-core/usr/share/egroupware
2016-05-27 17:20:06 +02:00
COREDOC = debian/egroupware-epl-core/usr/share/doc/egroupware-epl-core
2014-04-19 12:46:27 +02:00
PACKAGEDIR = debian/egroupware-epl-$${APP}/usr/share/egroupware/$${APPDIR}
2016-05-27 17:20:06 +02:00
PACKAGEDOC = debian/egroupware-epl-$${APP}/usr/share/doc/egroupware-epl-$${APPDIR}
2014-04-19 12:46:27 +02:00
COPYRIGHT = -iname 'copyright*' -or -iname 'copying*' -or -iname '*license*'
CHANGELOG = -iname 'changelog*'
EXTRADOC = -iname readme -or -iname todo
FINDOPT = -type f
APPFILES = -not \( -path '*/doc/*' -or -path '.' -or -name '*.pl' -or $(COPYRIGHT) -or $(CHANGELOG) -or -iname install -or $(EXTRADOC) \)
SPECIALDOC = -size 0 -or -iname install -or $(CHANGELOG) -or $(COPYRIGHT) -or \
-name '*.sgml' -or -name '*.lyx' -or -name '*.ps' -or -name '*.dvi' -or -name '*.rtf'
DOCFILES = -not \( $(SPECIALDOC) \)
INSTALL = install -D -m 644
clean:
dh_testdir
dh_testroot
debconf-updatepo
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# apply the patch
2016-05-27 17:20:06 +02:00
cat ./doc/rpm-build/asyncservice.patch | patch -p1
2014-04-19 12:46:27 +02:00
2017-11-13 18:58:20 +01:00
# customize webserver config
2014-04-19 12:46:27 +02:00
mkdir -p $(CURDIR)/debian/egroupware-epl-core/etc/egroupware
2016-05-27 17:20:06 +02:00
cp $(CURDIR)/doc/rpm-build/apache.conf $(CURDIR)/debian/egroupware-epl-core/etc/egroupware/apache.conf
2017-11-13 17:41:08 +01:00
cp $(CURDIR)/doc/rpm-build/nginx.conf $(CURDIR)/debian/egroupware-epl-core/etc/egroupware/nginx.conf
2014-04-19 12:46:27 +02:00
# install core modules
2016-06-04 10:15:14 +02:00
for DIR in api admin home emailadmin preferences addressbook setup doc pixelegg; do \
2014-04-19 12:46:27 +02:00
cd $(CURDIR)/$${DIR}; \
find $(FINDOPT) $(APPFILES) \
-exec $(INSTALL) {} $(CURDIR)/$(COREDIR)/$${DIR}/{} \; ; \
2016-05-27 17:20:06 +02:00
if [ -d $(CURDIR)/$${DIR}/doc ] ; then \
cd $(CURDIR)/$${DIR}/doc; \
find $(FINDOPT) $(DOCFILES) \
-exec $(INSTALL) {} $(CURDIR)/$(COREDOC)/{} \; ;\
fi ; \
2014-04-19 12:46:27 +02:00
done
# install applications
# lv: activesync (tm) microsoft and has to be renamed
for APP in $(MODULES) ; do \
2016-05-27 17:20:06 +02:00
case $${APP} in \
"esync") \
APPDIR="activesync"; \
;; \
"compat") \
APPDIR="phpgwapi"; \
cd $(CURDIR)/$${APPDIR}; \
find $(FINDOPT) $(APPFILES) \
-exec $(INSTALL) {} $(CURDIR)/$(PACKAGEDIR)/{} \; ; \
if [ -d $(CURDIR)/$${APPDIR}/doc ] ; then \
cd $(CURDIR)/$${APPDIR}/doc; \
find $(FINDOPT) $(DOCFILES) \
-exec $(INSTALL) {} $(CURDIR)/$(PACKAGEDOC)/{} \; ;\
fi ; \
APPDIR="etemplate"; \
;; \
*) \
APPDIR=$$(echo $${APP} | sed 's/-/_/g') ; \
;; \
esac; \
2014-04-19 12:46:27 +02:00
if [ -d $(CURDIR)/$${APPDIR} ] ; then \
cd $(CURDIR)/$${APPDIR}; \
find $(FINDOPT) $(APPFILES) \
-exec $(INSTALL) {} $(CURDIR)/$(PACKAGEDIR)/{} \; ; \
if [ -d $(CURDIR)/$${APPDIR}/doc ] ; then \
cd $(CURDIR)/$${APPDIR}/doc; \
find $(FINDOPT) $(DOCFILES) \
-exec $(INSTALL) {} $(CURDIR)/$(PACKAGEDOC)/{} \; ;\
fi ; \
else \
echo "PACKAGING ERROR: directory $${APPDIR} not found" 1>&2; exit 1 ; \
fi ; \
done
# install cron-file
mkdir -p debian/egroupware-epl-core/etc/cron.d
sed 's/apache/www-data/' doc/rpm-build/egroupware.cron > debian/egroupware-epl-core/etc/cron.d/egroupware
dh_install
# delete some stuff
for APKG in $(PACKAGES) ; do \
if [ -f debian/$${APKG}.remove ] ; then \
perl -l0 -p -e '' debian/$${APKG}.remove | xargs -0ri /bin/sh -c "rm -rf debian/$${APKG}/{}" ; \
fi ; \
done
# make postinstall executable
#chmod a+x debian/egroupware-epl-core/usr/share/egroupware/doc/rpm-build/post_install.php
ls -al debian/egroupware-epl-*/usr/share/egroupware/*/*cli.php debian/egroupware-epl-*/usr/share/egroupware/phpgwapi/cron/*.php debian/egroupware-epl-*/usr/share/egroupware/doc/rpm-build/*.php
chmod a+x debian/egroupware-epl-*/usr/share/egroupware/*/*cli.php debian/egroupware-epl-*/usr/share/egroupware/phpgwapi/cron/*.php debian/egroupware-epl-*/usr/share/egroupware/doc/rpm-build/*.php
binary-indep: build install
dh_testdir -i
dh_testroot -i
dh_installdebconf -i
dh_installdocs -i
dh_installexamples -i
dh_installchangelogs -i
dh_link -i
dh_compress -i -X .php
dh_fixperms -i
dh_installdeb -i
(echo -n "egw:Modules="; for x in $(MODULES); do echo -n "egroupware-epl-$$x,"; done; echo) >>debian/egroupware-epl.substvars
perl -l0 -p -e 's/^/-V/' debian/substvars | xargs -0 dh_gencontrol -i --
dh_md5sums -i
dh_builddeb -i
binary: binary-indep binary-arch
.PHONY: build binary binary-arch binary-indep clean install
# vim: ts=4 noet