xref: /trunk/main/sysui/desktop/debian/makefile.mk (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28PRJ=..$/..
29
30PRJNAME=sysui
31TARGET=debian
32
33# !!! FIXME !!!
34# debian-menus file.
35
36# --- Settings -----------------------------------------------------
37
38.INCLUDE :  settings.mk
39
40# --- Product Version Information ----------------------------------
41
42.INCLUDE :  ../productversion.mk
43
44# --- Files --------------------------------------------------------
45
46.IF "$(PKGFORMAT)"!="$(PKGFORMAT:s/deb//)"
47
48DEBFILES=$(foreach,i,{$(PRODUCTLIST)} $(PKGDIR)$/$i3.4-$(TARGET)-menus_$(PKGVERSION.$i)-$(PKGREV)_all.deb)
49
50.ENDIF
51
52# --- Targets -------------------------------------------------------
53
54.INCLUDE :  target.mk
55
56.IF "$(PKGFORMAT)"!="$(PKGFORMAT:s/deb//)"
57
58ALLTAR : $(DEBFILES)
59
60
61%/DEBIAN/control : $$(@:f)
62	@$(MKDIRHIER) $(@:d) $*$/etc $*$/usr/share/applnk/Office $*$/usr/lib/menu
63	ln -sf /opt/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.4//)) $*$/etc$/
64	/bin/sh -c -x "cd $(COMMONMISC)$/$(*:f:s/-/ /:1:s/3.4//) && DESTDIR=$(shell @cd $*; pwd) ICON_PREFIX=$(ICONPREFIX) KDEMAINDIR=/usr GNOMEDIR=/usr create_tree.sh"
65        @cat openoffice.org-debian-menus | sed -e 's/%PRODUCTNAME/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/3.4//)) $(PRODUCTVERSION.$(*:f:s/-/ /:1:s/3.4//))/' -e 's/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.4//))/' -e 's/%ICONPREFIX/$(ICONPREFIX.$(*:f:s/-/ /:1:s/3.4//))/' > $*$/usr/lib/menu/$(*:f:s/_/ /:1:s/3.4//)
66	echo "Package: $(*:f:s/_/ /:1:s/3.4//)" > $@
67	cat $(@:f) | tr -d "\015" | sed "s/%productname/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/3.4//))/" >> $@
68	echo "Version: $(PKGVERSION.$(*:f:s/-/ /:1:s/3.4//))-$(PKGREV)" >> $@
69	@du -k -s $* | awk -F ' ' '{ printf "Installed-Size: %s\n", $$1 ; }' >> $@
70
71%/DEBIAN/postinst : $$(@:f)
72	 @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.4//))/g" > $@
73
74%/DEBIAN/postrm : $$(@:f)
75	 @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.4//))/g" > $@
76
77%/DEBIAN/prerm : $$(@:f)
78	 @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.4//))/g" > $@
79
80# --- packaging ---------------------------------------------------
81
82# getuid.so fakes the user/group for us
83$(DEBFILES) : $(COMMONMISC)$/{$(PRODUCTLIST)}$/build.flag
84$(DEBFILES) : makefile.mk control postinst postrm prerm
85	-$(RM) $(@:d)$(@:f:s/_/ /:1)_*
86	$(RM) -r $(MISC)$/$(@:b)
87	dmake $(MISC)$/$(@:b)$/DEBIAN$/{control postinst postrm prerm}
88	@chmod -R g-w $(MISC)$/$(@:b)
89	@chmod a+rx $(MISC)$/$(@:b)$/DEBIAN $(MISC)/$(@:b)/DEBIAN/post* $(MISC)/$(@:b)/DEBIAN/pre*
90	@chmod g-s $(MISC)/$(@:b)/DEBIAN
91	@mkdir -p $(PKGDIR)
92	/bin/bash -c "LD_PRELOAD=$(SOLARBINDIR)/getuid.so dpkg-deb --build $(MISC)/$(@:b) $@"
93	$(RM) -r $(MISC)$/$(@:b)
94#	@chmod -R g+w $(MISC)/$(TARGET)/$(DEBFILE:f)
95
96.ENDIF
97