Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / sysui / CustomTarget_deb.mk
blob92cda34a3bfe6a6ce2de5e1799041d8baa4d15c4
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 include $(SRCDIR)/sysui/productlist.mk
12 deb_WORKDIR := $(call gb_CustomTarget_get_workdir,sysui/deb)
13 deb_SRCDIR := $(SRCDIR)/sysui/desktop/debian
15 $(eval $(call gb_CustomTarget_CustomTarget,sysui/deb))
17 $(eval $(call gb_CustomTarget_register_targets,sysui/deb,\
18 $(foreach product,$(PRODUCTLIST),\
19 $(product)-desktop-integration.tar.gz \
20 $(product)/DEBIAN/control \
21 $(product)/DEBIAN/postinst \
22 $(product)/DEBIAN/postrm \
23 $(product)/DEBIAN/prerm \
24 $(product)$(PKGVERSIONSHORT)-debian-menus_$(PKGVERSION)-$(LIBO_VERSION_PATCH)_all.deb) \
27 $(deb_WORKDIR)/%-desktop-integration.tar.gz: $(deb_WORKDIR)/%$(PKGVERSIONSHORT)-debian-menus_$(PKGVERSION)-$(LIBO_VERSION_PATCH)_all.deb
28 fakeroot $(GNUTAR) -C $(deb_WORKDIR) -cf - $(notdir $<) | gzip > $@
30 $(deb_WORKDIR)/%/DEBIAN/postrm: $(deb_SRCDIR)/postrm
31 cat $< | tr -d "\015" | \
32 sed 's/%PREFIX/$(UNIXFILENAME.$*)/g' >> $@
34 $(deb_WORKDIR)/%/DEBIAN/postinst: $(deb_SRCDIR)/postinst
35 cat $< | tr -d "\015" | \
36 sed 's/%PREFIX/$(UNIXFILENAME.$*)/g' >> $@
38 $(deb_WORKDIR)/%/DEBIAN/prerm: $(deb_SRCDIR)/prerm
39 cat $< | tr -d "\015" | \
40 sed 's/%PREFIX/$(UNIXFILENAME.$*)/g' >> $@
42 $(deb_WORKDIR)/%/DEBIAN/control: $(deb_SRCDIR)/control $(call gb_CustomTarget_get_workdir,sysui/share)/%/create_tree.sh
43 mkdir -p $(deb_WORKDIR)/$*/usr/lib/menu
44 cd $(call gb_CustomTarget_get_workdir,sysui/share)/$* \
45 && DESTDIR=$(deb_WORKDIR)/$* \
46 ICON_PREFIX=$(UNIXFILENAME.$*) \
47 KDEMAINDIR=/usr \
48 GNOMEDIR=/usr \
49 PREFIXDIR=/usr \
50 ./create_tree.sh
51 sed $(deb_SRCDIR)/openoffice.org-debian-menus \
52 -e 's/%PRODUCTNAME/$(PRODUCTNAME.$*) $(PRODUCTVERSION)/' \
53 -e 's/%PREFIX/$(UNIXFILENAME.$*)/' \
54 -e 's/%ICONPREFIX/$(UNIXFILENAME.$*)/' \
55 > $(deb_WORKDIR)/$*/usr/lib/menu/$*$(PKGVERSIONSHORT)
56 echo "Package: $*$(PKGVERSIONSHORT)-debian-menus" >$@
57 cat $< | tr -d "\015" | \
58 sed 's/%productname/$(PRODUCTNAME.$*) $(PRODUCTVERSION)/' \
59 >> $@
60 echo "Version: $(PKGVERSION)-$(LIBO_VERSION_PATCH)" >>$@
61 du -k -s $(deb_WORKDIR)/$* | $(gb_AWK) -F ' ' '{ printf "Installed-Size: %s\n", $$1 ; }' >>$@
63 $(deb_WORKDIR)/%$(PKGVERSIONSHORT)-debian-menus_$(PKGVERSION)-$(LIBO_VERSION_PATCH)_all.deb: $(deb_WORKDIR)/%/DEBIAN/postrm $(deb_WORKDIR)/%/DEBIAN/postinst $(deb_WORKDIR)/%/DEBIAN/prerm $(deb_WORKDIR)/%/DEBIAN/control
65 chmod -R g-w $(deb_WORKDIR)/$*
66 chmod a+rx $(deb_WORKDIR)/$*/DEBIAN \
67 $(deb_WORKDIR)/$*/DEBIAN/pre* $(deb_WORKDIR)/$*/DEBIAN/post*
68 chmod g-s $(deb_WORKDIR)/$*/DEBIAN
69 fakeroot dpkg-deb --build $(deb_WORKDIR)/$* $@
71 # vim: set noet sw=4 ts=4: